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

perl: substitute /bin/pwd with host pwd #58979

Closed
wants to merge 1 commit into from

Conversation

illegalprime
Copy link
Member

Motivation for this change

/bin/pwd is replaced during the build with nix's version.
it was incorrectly set to the build-time pwd, this would set it to the host's pwd

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option 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 nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

benley
benley previously approved these changes Apr 4, 2019
@benley
Copy link
Member

benley commented Apr 4, 2019

This definitely looks like a good fix but I'm not 100% sure if it's safe to merge; maybe it had something to do with perl being a bootstrapping dependency? @edolstra introduced this quirk so perhaps he should take a look.

@illegalprime
Copy link
Member Author

illegalprime commented Apr 4, 2019

btw: should I be putting PRs into staging? (not master)

@benley
Copy link
Member

benley commented Apr 4, 2019

Master is fine for most things; staging is for changes that are going to require massive rebuilds, as it gives hydra a chance to catch up before things hit the nixos channels. Perl may actually be one of those things :-P

btw, here is a comment I found about the $pwd thing in git blame history:

    # There's an annoying bug on sandboxed Darwin in Perl's Cwd.pm where it looks for pwd
    # in /bin/pwd and /usr/bin/pwd and then falls back on just "pwd" if it can't get them
    # while at the same time erasing the PATH environment variable so it unconditionally
    # fails. The code in question is guarded by a check for Mac OS, but the patch below
    # doesn't have any runtime effect on other platforms.
    postPatch = optional stdenv.isDarwin ''
      pwd="$(type -P pwd)"
      substituteInPlace dist/PathTools/Cwd.pm \
        --replace "/bin/pwd" "$pwd"
    '';

@benley benley dismissed their stale review April 4, 2019 18:02

someone else should approve this, I think

@illegalprime illegalprime changed the base branch from master to staging April 4, 2019 18:03
@illegalprime illegalprime changed the base branch from staging to master April 4, 2019 18:03
@illegalprime
Copy link
Member Author

yeah, :( the motivation here is to not bring along build-time dependencies when cross compiling

@GrahamcOfBorg GrahamcOfBorg added 6.topic: emacs Text editor 6.topic: GNOME GNOME desktop environment and its underlying platform 6.topic: haskell 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: pantheon The Pantheon desktop environment 6.topic: policy discussion 6.topic: printing 6.topic: python 6.topic: qt/kde 6.topic: ruby 6.topic: rust 6.topic: vim 8.has: changelog 8.has: documentation 8.has: module (update) This PR changes an existing module in `nixos/` 2.status: merge conflict This PR has merge conflicts with the target branch and removed 6.topic: emacs Text editor 6.topic: GNOME GNOME desktop environment and its underlying platform 6.topic: haskell 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: pantheon The Pantheon desktop environment labels Apr 4, 2019
@illegalprime
Copy link
Member Author

I'm not sure why ofborg isn't building, it's building on my machine... will investigate more

@Ekleog
Copy link
Member

Ekleog commented May 24, 2019

@GrahamcOfBorg eval

@GrahamcOfBorg build perl gitFull

Copy link
Member

@Ekleog Ekleog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@illegalprime This change appears to break evaluation on at least darwin: https://github.com/NixOS/nixpkgs/pull/58979/checks?check_run_id=135801652

@lopsided98
Copy link
Contributor

See #65761 for my PR that fixes the Darwin issue and another accidental reference.

@illegalprime
Copy link
Member Author

closing in favor of #65761

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants