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

google-chrome, treewide: fix patchelf usages to not crash constantly, patchelf as native #47444

Merged

Conversation

dtzWill
Copy link
Member

@dtzWill dtzWill commented Sep 27, 2018

Tired of seeing build logs telling me patchelf segfaults 20 times or
unfriendly assertion failure messages, neither of which are reasonable state of "normal".

  • 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.

Tested virtualbox, google-chrome, and a number of the expressions modified but not all.

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: google-chrome, virtualbox

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: google-chrome, virtualbox

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: virtualbox

The following builds were skipped because they don't evaluate on x86_64-linux: google-chrome

Partial log (click to expand)

patchelf: cannot find section '.dynamic'. The input file is most likely statically linked
patchelf: wrong ELF type
patchelf: wrong ELF type
patchelf: wrong ELF type
patchelf: wrong ELF type
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/v3wdajb2kbwia7rpic1nqk69g7yh8dsf-virtualbox-5.2.14-modsrc
/nix/store/v3wdajb2kbwia7rpic1nqk69g7yh8dsf-virtualbox-5.2.14-modsrc/build_in_tmp: interpreter directive changed from "/bin/sh" to "/nix/store/czx8vkrb9jdgjyz8qfksh10vrnqa723l-bash-4.4-p23/bin/sh"
checking for references to /build in /nix/store/v3wdajb2kbwia7rpic1nqk69g7yh8dsf-virtualbox-5.2.14-modsrc...
postPatchMkspecs

@xeji
Copy link
Contributor

xeji commented Sep 28, 2018 via email

Current/previous behavior is the patchelf process aborting after
a somewhat unfriendly message about an assertion failure.
In a few cases it wasn't clear so I left them as-is.

While visiting these moved other things to nativeBuildInputs
when it was clear they were one of these cases:

* makeWrapper
* archive utilities (in order to unpack src)
  * a few of these might no longer be needed but leaving for another day
@dtzWill dtzWill force-pushed the fix/patchelf-chrome-virtualbox-and-treewide branch from d3a465d to eb91037 Compare September 28, 2018 16:49
@dtzWill dtzWill changed the title google-chrome, virtualbox: fix patchelf usages to not crash constantly; tree: patchelf as native google-chrome, treewide: fix patchelf usages to not crash constantly, patchelf as native Sep 28, 2018
@dtzWill
Copy link
Member Author

dtzWill commented Sep 28, 2018

Bah, I'll just drop the virtualbox fix -- although I do still move it to nativeBuildInputs since that's where it should be as long as it's anywhere.

Then we can use your PR to remove it and leave fixing it for another day (another PR) since it appears to be more involved than I originally thought :).

@GrahamcOfBorg
Copy link

No attempt on x86_64-linux (full log)

The following builds were skipped because they don't evaluate on x86_64-linux: google-chrome

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: google-chrome

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

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

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.


@xeji
Copy link
Contributor

xeji commented Sep 28, 2018

@GrahamcOfBorg build virtualbox

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: virtualbox

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

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

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: virtualbox

Partial log (click to expand)

patchelf: wrong ELF type
patchelf: wrong ELF type
shrinking RPATHs of ELF executables and libraries in /nix/store/7bmm92big7jq83lic91agkjyqraiac0h-virtualbox-5.2.14-modsrc
shrinking RPATHs of ELF executables and libraries in /nix/store/7bmm92big7jq83lic91agkjyqraiac0h-virtualbox-5.2.14-modsrc
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/7bmm92big7jq83lic91agkjyqraiac0h-virtualbox-5.2.14-modsrc
/nix/store/7bmm92big7jq83lic91agkjyqraiac0h-virtualbox-5.2.14-modsrc/build_in_tmp: interpreter directive changed from "/bin/sh" to "/nix/store/czx8vkrb9jdgjyz8qfksh10vrnqa723l-bash-4.4-p23/bin/sh"
checking for references to /build in /nix/store/7bmm92big7jq83lic91agkjyqraiac0h-virtualbox-5.2.14-modsrc...
postPatchMkspecs
/nix/store/84grqvy1b7mja0750578bhc6nma27vph-virtualbox-5.2.14

@dtzWill
Copy link
Member Author

dtzWill commented Sep 28, 2018

Thanks for working with me on this!

@dtzWill dtzWill merged commit 3f0ae25 into NixOS:master Sep 28, 2018
@dtzWill dtzWill deleted the fix/patchelf-chrome-virtualbox-and-treewide branch September 28, 2018 19:25
@Ericson2314
Copy link
Member

Great stuff!

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