NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.39k stars 14.35k forks source link

closure-size: investigate code containing buildEnv #14850

Closed mucaho closed 7 years ago

mucaho commented 8 years ago

As suggested, recent changes to the buildEnv may have broken code in some nix expressions. Some nix expressions use buildEnv to get links to the environment's shared libraries, which is now with the new changes no longer the default case. Replacing buildEnv with makeLibraryPath is a straightforward fix to this, as described in the linked issue.

grep -rnlw '.nix-defexpr/channels/nixpkgs/' -e "buildEnv" gives me

.nix-defexpr/channels/nixpkgs/doc/languages-frameworks/bower.xml
.nix-defexpr/channels/nixpkgs/doc/languages-frameworks/python.md
.nix-defexpr/channels/nixpkgs/pkgs/applications/audio/deadbeef/wrapper.nix
.nix-defexpr/channels/nixpkgs/pkgs/applications/audio/puredata/wrapper.nix
.nix-defexpr/channels/nixpkgs/pkgs/applications/misc/keepass-plugins/keefox/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/applications/misc/ding/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/applications/misc/rxvt_unicode/wrapper.nix
.nix-defexpr/channels/nixpkgs/pkgs/applications/misc/keepass/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/applications/graphics/gimp/wrapper.nix
.nix-defexpr/channels/nixpkgs/pkgs/applications/editors/brackets/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/applications/editors/neovim/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/applications/editors/lighttable/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/applications/editors/zed/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/applications/editors/eclipse/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/applications/video/avidemux/wrapper.nix
.nix-defexpr/channels/nixpkgs/pkgs/applications/networking/instant-messengers/pidgin/wrapper.nix
.nix-defexpr/channels/nixpkgs/pkgs/applications/networking/browsers/google-chrome/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/applications/networking/cluster/panamax/api/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/desktops/xfce/core/thunar.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/erlang-modules/build-rebar3.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/interpreters/pypy/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/interpreters/ruby/dev.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/interpreters/ruby/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/interpreters/python/3.4/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/interpreters/python/3.3/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/interpreters/python/3.2/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/interpreters/python/wrapper.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/interpreters/python/2.6/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/interpreters/python/3.5/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/interpreters/python/2.7/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/haskell-modules/with-packages-wrapper.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/compilers/ghc/with-packages.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/compilers/ocaml/4.02.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/compilers/ocaml/4.01.0.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/compilers/elm/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/ruby-modules/bundler-env/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/bower-modules/generic/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/libraries/thrift/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/guile-modules/guile-sdl/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/python-modules/dbus/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/tools/thrust/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/tools/haskell/ihaskell/wrapper.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/tools/node-webkit/nw12.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/tools/node-webkit/nw9.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/tools/node-webkit/nw11.nix
.nix-defexpr/channels/nixpkgs/pkgs/development/tools/electron/env-atom.nix
.nix-defexpr/channels/nixpkgs/pkgs/servers/x11/xquartz/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/misc/vim-plugins/vim-utils.nix
.nix-defexpr/channels/nixpkgs/pkgs/os-specific/linux/kmod/aggregator.nix
.nix-defexpr/channels/nixpkgs/pkgs/build-support/build-fhs-chrootenv/env.nix
.nix-defexpr/channels/nixpkgs/pkgs/build-support/buildenv/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/build-support/docker/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/games/megaglest/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/games/steam/update-runtime-shell.nix
.nix-defexpr/channels/nixpkgs/pkgs/games/simutrans/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix
.nix-defexpr/channels/nixpkgs/pkgs/games/dwarf-fortress/wrapper/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/top-level/all-packages.nix
.nix-defexpr/channels/nixpkgs/pkgs/tools/inputmethods/fcitx/wrapper.nix
.nix-defexpr/channels/nixpkgs/pkgs/tools/package-management/nix-prefetch-scripts/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/tools/audio/darkice/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/tools/security/tor/torbrowser.nix
.nix-defexpr/channels/nixpkgs/pkgs/tools/typesetting/tex/texlive-new/combine.nix
.nix-defexpr/channels/nixpkgs/pkgs/tools/typesetting/tex/texlive-new/default.nix
.nix-defexpr/channels/nixpkgs/pkgs/tools/networking/nylon/default.nix
.nix-defexpr/channels/nixpkgs/nixos/doc/manual/release-notes/rl-1412.xml
.nix-defexpr/channels/nixpkgs/nixos/doc/manual/release-notes/rl-1509.xml
.nix-defexpr/channels/nixpkgs/nixos/modules/services/search/elasticsearch.nix
.nix-defexpr/channels/nixpkgs/nixos/modules/services/mail/opensmtpd.nix
.nix-defexpr/channels/nixpkgs/nixos/modules/services/audio/mopidy.nix
.nix-defexpr/channels/nixpkgs/nixos/modules/services/misc/bepasty.nix
.nix-defexpr/channels/nixpkgs/nixos/modules/services/misc/zookeeper.nix
.nix-defexpr/channels/nixpkgs/nixos/modules/services/misc/octoprint.nix
.nix-defexpr/channels/nixpkgs/nixos/modules/services/misc/apache-kafka.nix
.nix-defexpr/channels/nixpkgs/nixos/modules/services/printing/cupsd.nix
.nix-defexpr/channels/nixpkgs/nixos/modules/services/hardware/udev.nix
.nix-defexpr/channels/nixpkgs/nixos/modules/services/monitoring/graphite.nix
.nix-defexpr/channels/nixpkgs/nixos/modules/services/databases/postgresql.nix
.nix-defexpr/channels/nixpkgs/nixos/modules/services/web-servers/uwsgi.nix
.nix-defexpr/channels/nixpkgs/nixos/modules/services/web-servers/zope2.nix
.nix-defexpr/channels/nixpkgs/nixos/modules/services/networking/znc.nix
.nix-defexpr/channels/nixpkgs/nixos/modules/services/networking/nsd.nix
.nix-defexpr/channels/nixpkgs/nixos/modules/config/system-path.nix
.nix-defexpr/channels/nixpkgs/nixos/modules/hardware/opengl.nix
vcunat commented 8 years ago

Another way is to pass extraOutputsToInstall = [ "lib" .... ] to buildEnv.

domenkozar commented 8 years ago

@vcunat is this still relevant?

vcunat commented 8 years ago

The core of the issue is that default output(s) no longer contain everything, so the contents of buildEnv result was reduced and some use cases might miss something. It isn't really specific to buildEnv, as I see it...

dezgeg commented 7 years ago

It's been a year with no apparent problems, so either all instances have been fixed or the remaining ones are in packages that no one literally uses.

Closing.