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

nixos: remove PKG_CONFIG_PATH/PERL5LIB environment variables #38791

Merged
merged 1 commit into from May 29, 2018

Conversation

LnL7
Copy link
Member

@LnL7 LnL7 commented Apr 11, 2018

Motivation for this change

These make libraries installed in the system or even user profiles
magically available.

Maybe there's a legitimate reason for this, but this is a bad idea IMHO.

Example: #38636 (comment)

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-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/)
  • Fits CONTRIBUTING.md.

These make libraries installed in the system or even user profiles
magically available.
@domenkozar
Copy link
Member

+1, such convenience exports turn out into horrible debugging sessions costing devs lots of time.

@LnL7
Copy link
Member Author

LnL7 commented May 29, 2018

I've been using a nixos config with these explicitly unset for a while now.

@LnL7 LnL7 merged commit c4e9ebc into NixOS:master May 29, 2018
@LnL7 LnL7 deleted the nixos-profile-variables branch May 29, 2018 22:23
@LnL7
Copy link
Member Author

LnL7 commented Oct 23, 2018

I'm not sure what your point is here, but it's pretty easy for libraries like this to end up in your system because of propagated inputs. I would personally prefer to go even further and remove /lib from the system profile altogether, however there are some practical reasons why we can't do that. That said I understand this might be convenient in some cases and it's possible to configure (for more than just perl packages) but it shouldn't be enabled by default IMHO.

@peti
Copy link
Member

peti commented Oct 23, 2018

The point is nix-env -i perlPackages.LWP and environment.systemPackages = [ pkgs.perlPackages.LWP ] should work and install the library for the user or system-wide.

For what it's worth, I don't think that these should work. Installing a Haskell library or an R package that way in Nix certainly won't work, and I don't see why it should be any different for Perl. The assumption that you can put a random library into your profile and henceforth all other software know that it's there and uses it automatically is false. We should not encourage users to assume that this would work.

@peti
Copy link
Member

peti commented Oct 23, 2018

Well, you can install perl + libraries system-wide. You just can't do it in the way you suggested above.

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

6 participants