Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnirehtet: update cargo.lock to fix build with rust 1.64.0 #117139

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Formula/gnirehtet.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class Gnirehtet < Formula
desc "Reverse tethering tool for Android"
homepage "https://github.com/Genymobile/gnirehtet"
# Try to switch `rustup-init` to `rust` on the next release
url "https://github.com/Genymobile/gnirehtet/archive/v2.5.tar.gz"
sha256 "2b55b56e1b21d1b609a0899fe85d1f311120bb12b04761ec586187338daf6ec5"
license "Apache-2.0"
Expand All @@ -18,7 +19,7 @@ class Gnirehtet < Formula
sha256 cellar: :any_skip_relocation, x86_64_linux: "94166648cf3a8a072b85eed7436af2bddbcf5c2dfab939cd79590d4ff2b9a9c3"
end

depends_on "rust" => :build
depends_on "rustup-init" => :build
depends_on "socat" => :test

resource "java_bundle" do
Expand All @@ -29,6 +30,12 @@ class Gnirehtet < Formula
def install
resource("java_bundle").stage { libexec.install "gnirehtet.apk" }

# Building the binary with rust 1.64.0 or later results in an error when running `gnirehtet relay`.
# ERROR Main: Execution error: IO error: Address family not supported by protocol family (os error 47)
# Issue ref: https://github.com/Genymobile/gnirehtet/issues/475
system "rustup-init", "-qy", "--no-modify-path", "--default-toolchain", "1.63.0"
ENV.prepend_path "PATH", HOMEBREW_CACHE/"cargo_cache/bin"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If anyone knows of an upstreamable fix for Rust 1.64.0+, then we can patch it in instead.

For now, went with workaround of downgrading Rust version.


system "cargo", "install", *std_cargo_args(root: libexec, path: "relay-rust")
mv "#{libexec}/bin/gnirehtet", "#{libexec}/gnirehtet"

Expand Down