nixpkgs/pkgs/top-level
aszlig 19e83bc2ba
Merge autoPatchelfHook improvements (#47222)
This includes the initialy commit was done by @Mic92 plus a few fixes
from my side. So essentially this avoids patching statically linked
executables and also speeds up searching for ELF files altogether.

I've tested this by comparing the outputs of all the derivations which
make use of this hook using the following Nix expression:

  let
    getPackagesForRev = rev: with import (builtins.fetchGit {
      url = ./.;
      inherit rev;
    }) { config.allowUnfree = true; }; [
      cups-kyodialog3 elasticsearch franz gurobi javacard-devkit
      masterpdfeditor maxx oracle-instantclient powershell reaper
      teamviewer unixODBCDrivers.msodbcsql17 virtlyst wavebox zoom-us
    ];

    pkgs = import <nixpkgs> {};
    baseRev = "ef764eb0d8314b81a012dae04642b4766199956d";

  in pkgs.runCommand "diff-contents" {
    chset = pkgs.lib.zipListsWith (old: new: pkgs.runCommand "diff" {
      inherit old new;
      nativeBuildInputs = [ pkgs.nukeReferences ];
    } ''
      mkdir -p "''${NIX_STORE#/}"
      cp --no-preserve=all -r "$old" "''${NIX_STORE#/}"
      cp --no-preserve=all -r "$new" "''${NIX_STORE#/}"
      find "''${old#/}" "''${new#/}" \
        \( -type f -exec nuke-refs {} + \) -o \( -type l -delete \)
      mkdir "$out"
      echo "$old" > "$out/old-path"
      echo "$new" > "$out/new-path"
      diff -Nur "''${old#/}" "''${new#/}" > "$out/diff" || :
    '') (getPackagesForRev baseRev) (getPackagesForRev "");
  } ''
    err=0
    for c in $chset; do
      if [ -s "$c/diff" ]; then
        echo "$(< "$c/old-path") -> $(< "$c/new-path")" \
             "differs, report: $c/diff" >&2
        err=1
      fi
    done
    [ $err -eq 0 ] && touch "$out"
  ''

With these changes there is only one derivation which has altered
contents, which is "franz". However the reason why it has differing
contents is not directly because of the autoPatchelfHook changes, but
because the "env-vars" file from the builder is in
"$out/opt/franz/env-vars" (Cc: @gnidorah) and we now have different
contents for NIX_CFLAGS_COMPILE and other environment variables.

I also tested this against a random static binary and the hook no longer
tries to patch it.

Merges: #47222
2018-09-25 05:21:01 +02:00
..
aliases.nix goimports: Remove in favor of gotools 2018-09-17 07:58:04 +02:00
all-packages.nix Merge autoPatchelfHook improvements (#47222) 2018-09-25 05:21:01 +02:00
beam-packages.nix beam-packages: default erlangR19 -> erlangR20 2018-08-07 23:27:41 +02:00
coq-packages.nix coq_8_6: use OCaml 4.05 2018-08-29 12:49:32 +00:00
darwin-packages.nix treewide: Remove usage of remaining redundant platform compatability stuff 2018-08-30 17:20:32 -04:00
default.nix
dotnet-packages.nix Deedle: 1.2.0 -> 1.2.5 (#46702) 2018-09-15 16:18:29 +02:00
emacs-packages.nix elpy: fix build dep 2018-09-09 17:14:59 +02:00
emscripten-packages.nix
haskell-packages.nix ghc, ghcjs: Get rid of extraneous alex, happy, and hscolour args 2018-09-24 20:00:39 -04:00
haxe-packages.nix pkgs/*: remove unreferenced function arguments 2018-07-21 02:48:04 +00:00
impure.nix impure.nix: fix handling of localSystem 2018-06-25 17:13:02 -04:00
java-packages.nix pkgs/*: remove unreferenced function arguments 2018-07-21 02:48:04 +00:00
lua-packages.nix luaPackages.luadbi: 0.5 -> 0.6 (#47156) 2018-09-22 22:27:35 +02:00
make-tarball.nix tarball job: more --show-trace 2018-09-03 14:24:42 +02:00
metrics.nix Revert "release/metrics: drop requiredSystemFeatures" 2018-07-30 10:46:20 +02:00
ocaml-packages.nix ocamlPackages.odoc: init at 1.2.0 2018-09-24 05:08:37 +00:00
perl-packages.nix perlPackages.MojoIOLoopForkCall: 0.19 -> 0.20 2018-09-20 15:17:30 -05:00
php-packages.nix phpPackages.phpcbf: 3.3.1 -> 3.3.2 2018-09-24 22:17:51 +02:00
pure-packages.nix
python-packages.nix Merge pull request #47283 from flokli/elasticsearch-dsl-6.2.1 2018-09-24 20:40:21 +01:00
release-cross.nix
release-lib.nix
release-python.nix pkgs/*: remove unreferenced function arguments 2018-07-21 02:48:04 +00:00
release-small.nix
release.nix release.nix: fix a typo (breaking tarball job) 2018-08-18 08:45:28 +02:00
splice.nix treewide: Remove usage of remaining redundant platform compatability stuff 2018-08-30 17:20:32 -04:00
stage.nix top-level: `system` should still come from the host platform 2018-09-23 13:24:44 -04:00
unix-tools.nix treewide: Remove usage of remaining redundant platform compatability stuff 2018-08-30 17:20:32 -04:00
wine-packages.nix wine: build wineWow packages on hydra 2018-07-03 21:29:32 +03:00