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

Restore cross-patch-shebangs branch #49608

Merged
merged 3 commits into from Nov 7, 2018

Conversation

matthewbauer
Copy link
Member

Motivation for this change

This was merged, then reverted. This should address the issues that originally came up.

@grahamc
Copy link
Member

grahamc commented Nov 1, 2018

cc @LnL7

@GrahamcOfBorg GrahamcOfBorg added the 6.topic: stdenv Standard environment label Nov 1, 2018
@matthewbauer
Copy link
Member Author

@GrahamcOfBorg build stdenv

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: stdenv

Partial log (click to expand)

/nix/store/x9lh9vz8szz0xnl1wyb4ssrl26gl46rn-stdenv-linux
shrinking /nix/store/n8nd6zdmr0rccgkwmxdscpx5afi5p0qr-findutils-4.6.0/bin/find
gzipping man pages under /nix/store/n8nd6zdmr0rccgkwmxdscpx5afi5p0qr-findutils-4.6.0/share/man/
strip is /nix/store/8zbl35kgg8v7gircl3pvy9027vslll1q-bootstrap-tools/bin/strip
stripping (with command strip and flags -S) in /nix/store/n8nd6zdmr0rccgkwmxdscpx5afi5p0qr-findutils-4.6.0/libexec  /nix/store/n8nd6zdmr0rccgkwmxdscpx5afi5p0qr-findutils-4.6.0/bin
checking for references to /build in /nix/store/n8nd6zdmr0rccgkwmxdscpx5afi5p0qr-findutils-4.6.0...
shrinking RPATHs of ELF executables and libraries in /nix/store/7d2lcd5gkmqnhw1nf7i1lkq98brjcx6r-findutils-4.6.0-info
strip is /nix/store/8zbl35kgg8v7gircl3pvy9027vslll1q-bootstrap-tools/bin/strip
checking for references to /build in /nix/store/7d2lcd5gkmqnhw1nf7i1lkq98brjcx6r-findutils-4.6.0-info...
building '/nix/store/ir36kzlvnkx329g6wi068z9nnnyc64mx-stdenv-linux.drv'...

@GrahamcOfBorg
Copy link

Timed out, unknown build status on x86_64-linux (full log)

Attempted: stdenv

Partial log (click to expand)

cannot build derivation '/nix/store/bm6h4jfm47a9jflwp35540d5y36hqmib-help2man-1.47.7.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/h31va0b3c68mpp0s59zf90b92q8j14mz-binutils-wrapper-2.30.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/388i2z4ajfwq6z1wlyviia93c4iin2nc-diffutils-3.6.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/pnjpb9fq0s0z22npnhiqmkx0m37im5kh-findutils-4.6.0.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/q57rjagr1jdnyi6nzf0m7jbvlbsp0im8-libtool-2.4.6.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/xp7plrqcfspyxx2l5nykzs00g94gd7by-gcc-wrapper-7.3.0.drv': 5 dependencies couldn't be built
cannot build derivation '/nix/store/3541y1xp4agkgryl9s50nmcy83m23ycd-hook.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/gqax93zpb271j8ddlz2k5lcf74qxbd8w-patch-2.7.6.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/l6agzs3cjqh1xzfgwhacgv3wgs7kwabd-stdenv-linux.drv': 23 dependencies couldn't be built
error: build of '/nix/store/l6agzs3cjqh1xzfgwhacgv3wgs7kwabd-stdenv-linux.drv' failed

@GrahamcOfBorg
Copy link

Timed out, unknown build status on x86_64-darwin (full log)

Attempted: stdenv

Partial log (click to expand)

cannot build derivation '/nix/store/f1cw7a2ydmqk3vmd0cgnd2d7y2wzgxxy-gnutar-1.30.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/mqj3rjxqzcplhy14djq8kl2rf1rnh4c4-bootstrap_cmds-7.0.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/g24g0534pv3m8zx1s3ricccw2hf78bx7-cctools-binutils-darwin.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/c20k6xx3byrkvmf8n5yfl1fxsmlly5hw-cctools-binutils-darwin-wrapper.drv': 7 dependencies couldn't be built
cannot build derivation '/nix/store/rc7vfc8j4jkc6w9m7l34xc0sfqv7icds-libkrb5-1.15.2.drv': 6 dependencies couldn't be built
cannot build derivation '/nix/store/5zllr028nivabm1h063xdipql9r5z4vp-clang-wrapper-5.0.2.drv': 11 dependencies couldn't be built
cannot build derivation '/nix/store/8lpzgma5qz86vrzs79vp5b0d5yl27p7l-curl-7.61.1.drv': 9 dependencies couldn't be built
cannot build derivation '/nix/store/jaivq2jhdgdmfwnfs34dkha3s74pab1k-swift-corefoundation.drv': 6 dependencies couldn't be built
cannot build derivation '/nix/store/xhjbz02k0pqfkwdvn1f07gkcjyz26w3y-stdenv-darwin.drv': 42 dependencies couldn't be built
error: build of '/nix/store/xhjbz02k0pqfkwdvn1f07gkcjyz26w3y-stdenv-darwin.drv' failed

@@ -278,8 +278,8 @@ in rec {
# enables patchShebangs above. Unfortunately, patchShebangs ignores our $SHELL setting
# and instead goes by $PATH, which happens to contain bootstrapTools. So it goes and
# patches our shebangs back to point at bootstrapTools. This makes sure bash comes first.
Copy link
Member

Choose a reason for hiding this comment

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

Edit this comment to match the new reality, too? I also feel like if we can use your disallowRequisites patch with this, we can skip pkgs.bash in either list, which would be best. I'd be very down to collaborate getting all the stdenv deps to use strictDeps :).

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah that sounds good! It might have to go in another PR for now - I'm more worried about fixing cross compilation right now.

One thing these are all going to need though is bash in the buildInputs. I think there's quite a few of those that don't have it right now.

I think we could also do an override here that does something like:

stdenv = super.stdenv // { mkDerivation = args: super.stdenv.mkDerivation (args // { strictDeps = true; }); };

To avoid individually setting all of these.

Copy link
Member

Choose a reason for hiding this comment

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

Well I do want to audit those packages anyways. I think I've decided this PR and the disallowRequites one are good as is, and then all the per-package cleanup can happen in a 3rd PR.

In strictDeps=false, autoPatchshebangs should use
--build (corresponding to PATH) to lookup commands. This restores the
previous behavior of patchshebangs so that we don’t break stuff that
isn’t careful in the buildInputs vs. nativeBuildInputs distinction.
Unfortunately this won’t work under cross compilation.
patch shebangs needs to be in build inputs for it to get into
HOST_PATH.
@matthewbauer matthewbauer merged commit c8aff96 into NixOS:staging Nov 7, 2018
@matthewbauer matthewbauer mentioned this pull request Nov 21, 2018
13 tasks
@matthewbauer matthewbauer deleted the cross-patch-shebangs-2 branch February 22, 2019 04:23
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

4 participants