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: 2.2.1 -> 2.3 #46735

Merged
merged 1 commit into from Sep 17, 2018
Merged

gnirehtet: 2.2.1 -> 2.3 #46735

merged 1 commit into from Sep 17, 2018

Conversation

dywedir
Copy link
Member

@dywedir dywedir commented Sep 16, 2018

https://github.com/Genymobile/gnirehtet/releases/tag/v2.3

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

cc @symphorien

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: gnirehtet

Partial log (click to expand)

Cannot nix-instantiate `gnirehtet' because:
error: while evaluating the attribute 'patches' of the derivation 'gnirehtet-2.3' at /var/lib/gc-of-borg/nix-test-rs-21/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-21/pkgs/stdenv/generic/make-derivation.nix:179:11:
while evaluating the attribute 'adb' of the derivation 'paths.patch' at /var/lib/gc-of-borg/nix-test-rs-21/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-21/pkgs/stdenv/generic/make-derivation.nix:179:11:
while evaluating the attribute 'src' of the derivation 'android-platform-tools-r26.0.2' at /var/lib/gc-of-borg/nix-test-rs-21/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-21/pkgs/stdenv/generic/make-derivation.nix:179:11:
System aarch64-linux not supported!

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: gnirehtet

Partial log (click to expand)


installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/fbs76j88053lprnamfm31x6l3420v7xw-gnirehtet-2.3
shrinking /nix/store/fbs76j88053lprnamfm31x6l3420v7xw-gnirehtet-2.3/bin/gnirehtet
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/fbs76j88053lprnamfm31x6l3420v7xw-gnirehtet-2.3/bin
patching script interpreter paths in /nix/store/fbs76j88053lprnamfm31x6l3420v7xw-gnirehtet-2.3
checking for references to /build in /nix/store/fbs76j88053lprnamfm31x6l3420v7xw-gnirehtet-2.3...
/nix/store/fbs76j88053lprnamfm31x6l3420v7xw-gnirehtet-2.3

@symphorien
Copy link
Member

While testing this, I noticed one occurence of adb is missing from our patch.
Here is the diff, it would be nice if you could add it to the PR.

diff --git a/pkgs/tools/networking/gnirehtet/paths.patch b/pkgs/tools/networking/gnirehtet/paths.patch
index 72a8445d83b..600802cb57f 100644
--- a/pkgs/tools/networking/gnirehtet/paths.patch
+++ b/pkgs/tools/networking/gnirehtet/paths.patch
@@ -1,7 +1,7 @@
-diff --git a/relay-rust/src/main.rs b/relay-rust/src/main.rs
-index 4f1be53..96d2e78 100644
---- a/relay-rust/src/main.rs
-+++ b/relay-rust/src/main.rs
+Index: gnirehtet/relay-rust/src/main.rs
+===================================================================
+--- gnirehtet.orig/relay-rust/src/main.rs
++++ gnirehtet/relay-rust/src/main.rs
 @@ -299,7 +299,7 @@ impl Command for RelayCommand {
  
  fn cmd_install(serial: Option<&String>) -> Result<(), CommandExecutionError> {
@@ -11,7 +11,7 @@ index 4f1be53..96d2e78 100644
  }
  
  fn cmd_uninstall(serial: Option<&String>) -> Result<(), CommandExecutionError> {
-@@ -467,8 +467,8 @@ fn exec_adb<S: Into<String>>(
+@@ -464,8 +464,8 @@ fn exec_adb<S: Into<String>>(
      args: Vec<S>,
  ) -> Result<(), CommandExecutionError> {
      let adb_args = create_adb_args(serial, args);
@@ -22,7 +22,7 @@ index 4f1be53..96d2e78 100644
          Ok(exit_status) => {
              if exit_status.success() {
                  Ok(())
-@@ -490,8 +490,8 @@ fn must_install_client(serial: Option<&String>) -> Result<bool, CommandExecution
+@@ -487,8 +487,8 @@ fn must_install_client(serial: Option<&S
          serial,
          vec!["shell", "dumpsys", "package", "com.genymobile.gnirehtet"],
      );
@@ -33,3 +33,16 @@ index 4f1be53..96d2e78 100644
          Ok(output) => {
              if output.status.success() {
                  // the "regex" crate makes the binary far bigger, so just parse the versionCode
+Index: gnirehtet/relay-rust/src/adb_monitor.rs
+===================================================================
+--- gnirehtet.orig/relay-rust/src/adb_monitor.rs
++++ gnirehtet/relay-rust/src/adb_monitor.rs
+@@ -206,7 +206,7 @@ impl AdbMonitor {
+ 
+     fn start_adb_daemon() -> bool {
+         info!(target: TAG, "Restarting adb daemon");
+-        match process::Command::new("adb")
++        match process::Command::new("@adb@")
+             .args(&["start-server"])
+             .status() {
+             Ok(exit_status) => {

Except this, looks good to me. Thanks :)

@dywedir
Copy link
Member Author

dywedir commented Sep 16, 2018

Thank you!

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: gnirehtet

Partial log (click to expand)

Cannot nix-instantiate `gnirehtet' because:
error: while evaluating the attribute 'patches' of the derivation 'gnirehtet-2.3' at /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/pkgs/stdenv/generic/make-derivation.nix:179:11:
while evaluating the attribute 'adb' of the derivation 'paths.patch' at /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/pkgs/stdenv/generic/make-derivation.nix:179:11:
while evaluating the attribute 'src' of the derivation 'android-platform-tools-r26.0.2' at /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/pkgs/stdenv/generic/make-derivation.nix:179:11:
System aarch64-linux not supported!

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: gnirehtet

Partial log (click to expand)


installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/8qpfb95dwkfldh1qhiyh608b8jhf743j-gnirehtet-2.3
shrinking /nix/store/8qpfb95dwkfldh1qhiyh608b8jhf743j-gnirehtet-2.3/bin/gnirehtet
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/8qpfb95dwkfldh1qhiyh608b8jhf743j-gnirehtet-2.3/bin
patching script interpreter paths in /nix/store/8qpfb95dwkfldh1qhiyh608b8jhf743j-gnirehtet-2.3
checking for references to /build in /nix/store/8qpfb95dwkfldh1qhiyh608b8jhf743j-gnirehtet-2.3...
/nix/store/8qpfb95dwkfldh1qhiyh608b8jhf743j-gnirehtet-2.3

fn start_adb_daemon() -> bool {
info!(target: TAG, "Restarting adb daemon");
- match process::Command::new("adb")
+ match process::Command::new("@adb@")
Copy link
Member

Choose a reason for hiding this comment

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

Is it not easier and less likely to break to use makeWrapper instead and extend the PATH?

Copy link
Member

Choose a reason for hiding this comment

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

Initially, the reason I went for a patch was that we need the patch anyway to fix the path to the apk.

@Mic92 Mic92 merged commit f86e309 into NixOS:master Sep 17, 2018
@dywedir dywedir deleted the gnirehtet branch September 18, 2018 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants