nixpkgs/pkgs
Damien Diederen 3363377530 vmTools.debClosureGenerator: Fix non-determinism in dependency graph
By default, Perl versions since 5.8.1 use randomization to make hashes
resistant to complexity attacks.

That randomization makes building VM images such as ubuntu1804x86_64
non-deterministic because the (imported) derivations built by
deb/deb-closure.pl are not stable.

This can easily be observed by repeating the following sequence of
commands and noting the path of the image's .drv:

    nix-instantiate -E '(import <nixpkgs> {}).vmTools.diskImageFuns.ubuntu1804x86_64 {}'
    nix-store --delete /nix/store/*ubuntu-18.04-bionic-amd64.nix

One source of non-determinism is the handling of Provides/Replaces,
which depends on the order of iteration over %packages.  Here is a
diff showing the corresponding change in output:

     >>> awk
    -virtual awk: using original-awk
    -    original-awk: libc6 (>= 2.14)
    +virtual awk: using mawk
    +    mawk: libc6 (>= 2.14)

    -    mawk: libc6 (>= 2.14)
    ->>> libc6

This patch sorts packages by name for Provides/Replaces processing,
which seems to result in stable output.

(If the above turns out not to be sufficient, one could also set the
PERL_HASH_SEED and PERL_PERTURB_KEYS environment variables, documented
in 'perlrun', to disable Perl's built-in randomization.  Complexity
attacks are not an issue as we control and trust all inputs.)
2020-12-30 11:37:37 +01:00
..
applications Merge pull request #84939 from doronbehar/package-ocrfeeder 2020-12-30 08:49:15 +02:00
build-support vmTools.debClosureGenerator: Fix non-determinism in dependency graph 2020-12-30 11:37:37 +01:00
common-updater
data Merge pull request #97226 from r-ryantm/auto-update/papirus-icon-theme 2020-12-29 06:06:58 +01:00
desktops gnome3.iagno: remove stale patch 2020-12-28 12:23:01 -08:00
development Merge pull request #84939 from doronbehar/package-ocrfeeder 2020-12-30 08:49:15 +02:00
games Merge pull request #103077 from freezeboy/add-colobot 2020-12-30 08:42:16 +02:00
misc Merge pull request #106800 from MetaDark/protontricks 2020-12-30 01:06:55 -03:00
os-specific Bump rtl8821cu for Linux 5.10 support 2020-12-29 19:08:37 -05:00
pkgs-lib
servers Merge pull request #102973 from pacien/matrix-appservice-discord-v1.0.0 2020-12-30 01:09:24 -03:00
shells oh-my-zsh: 2020-12-27 → 2020-12-28 2020-12-29 10:11:57 -05:00
stdenv
test Revert "bintools-wrapper: skip dynamic linker for static binaries" 2020-12-21 22:27:48 +01:00
tools Merge pull request #93118 from symphorien/kcollectd 2020-12-30 08:40:29 +02:00
top-level Merge pull request #84939 from doronbehar/package-ocrfeeder 2020-12-30 08:49:15 +02:00