-
Notifications
You must be signed in to change notification settings - Fork 577
Update Cwd.pm to work on Guix & NixOS #18752
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
The more correct way to handle this (as a NixOS contributor) is to patch Cwd at build time to use an absolute path to pwd. Please don't merge this. |
As discussed in IRC, this doesn't work when using any of the common perl version managers (perlbrew/plenv) which do not use nix expressions or nix build tools. |
Those tools should also be patched. |
This would require actual rewriting of the tool so that it rewrites |
Unfortunately this will be true for lots of software installed by perlbrew etc, as lots of Perl packages expect programs at specific places in the FS. I wonder what other techniques might work? |
Typically this is for the same reason where you see it: to avoid breaking under taint mode, which is an ancient security feature. Short of deprecating taint mode or rewriting perl version managers (plenv/perlbrew) to rewrite the module in place before building, it's very difficult to solve. Regardless, perl should be able to be built in nixos with or without using nix build tools, because current nix build tools do not have the sophistication to replace something like perlbrew (managing multiple versions, and multiple |
Fix Travis (hopefully).
'/run/current-system/profile/bin/pwd', # GUIX | ||
'/run/current-system/sw/bin/pwd' # NixOS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Importantly, Nix's concept of closures is very important and highly valued. It is very common to export a closure and run it elsewhere, where /run/
doesn't exist in any form. This works "sometimes" but intentionally sidesteps the design philosophy of Nix, creating software artifacts that appear to work in development and then fails on deployment due to cheating like this.
I suspect from the discussion and from using nixos to test #18791 that Configure should be detecting pwd (or PATH) to save in I think the standard way would be to use confstr() to get the system PATH and search that, but POSIX.pm doesn't expose that, and POSIX.pm isn't available at the point this is called anyway. I'm pretty sure that would have the same problems that this change does, since the result of So from the discussion I don't think this change is appropriate. |
No one has disputed @tonycoz's judgment on this question in the past five months, so I'm closing this p.r. |
This sounds sensible to me |
refs #18703
This change fixes Cwd on NixOS/Guix.