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

binutils: No more darwin conditionals #38399

Merged
merged 1 commit into from Apr 4, 2018

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Apr 3, 2018

Motivation for this change

Since at least d7bddc2, we've had a
situation where one should depend on:

  • stdenv.cc.bintools: for executables at build time
  • libbfd or libiberty: for those libraries
  • targetPackages.cc.bintools: for exectuables at run time
  • binutils: only for specifically GNU Binutils's executables,
    regardless of the host platform, at run time.

and that commit cleaned up this usage to reflect that. This PR flips the
switch so that:

  • binutils is indeed unconditionally GNU Binutils
  • binutils-raw, which previously served that role, is gone.

so that the correct usage will be enforced going forward and everything
is simple.

N.B In a few cases binutils-unwrapped (which before and now was
unconditionally actual GNU binutils), rather than binutils was used to
replace old binutils-raw as it is friendly towards some cross
compilation usage by avoiding a reference to the next bootstrapping
change.

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.

CC @kmicklas @nixos/darwin-maintainers

@Ericson2314 Ericson2314 added the 6.topic: portability General portability concerns, not specific to cross-compilation or a specific platform label Apr 3, 2018
@shlevy
Copy link
Member

shlevy commented Apr 3, 2018

@Ericson2314 Would you terribly mind rebasing this on top of staging so we don't have to deal with the 2.30 conflicts?

@GrahamcOfBorg GrahamcOfBorg added the 6.topic: darwin Running or building packages on Darwin label Apr 3, 2018
@Ericson2314
Copy link
Member Author

Ericson2314 commented Apr 3, 2018

@shlevy I'll do that if this turns out to be a mass rebuild, or resolve them myself with a merge if it isn't.

@Ericson2314 Ericson2314 changed the title binutils: No more darwin conditionalism binutils: No more darwin conditionals Apr 3, 2018
@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: binutils

Partial log (click to expand)

/nix/store/1is4c0vfcs0q5i3ygij21y6z713lihw9-binutils-wrapper-2.28.1

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: binutils

Partial log (click to expand)

/nix/store/aa96xvaz1x0glq9ih45b9jdcaqsh0yka-binutils-wrapper-2.28.1

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: binutils

Partial log (click to expand)

building '/nix/store/pnqv90y6hv0icpp0l1v8iqshlxx5czn6-binutils-wrapper-2.28.1.drv'...
unpacking sources
patching sources
configuring
no configure script, doing nothing
installing
post-installation fixup
patching script interpreter paths in /nix/store/ry5c3rl7r4kyj08x778lxawx9b11pd14-binutils-wrapper-2.28.1
Using dynamic linker: '/usr/lib/dyld'
/nix/store/ry5c3rl7r4kyj08x778lxawx9b11pd14-binutils-wrapper-2.28.1

Since at least d7bddc2, we've had a
situation where one should depend on:

 - `stdenv.cc.bintools`: for executables at build time
 - `libbfd` or `libiberty`: for those libraries
 - `targetPackages.cc.bintools`: for exectuables at *run* time
 - `binutils`: only for specifically GNU Binutils's executables,
   regardless of the host platform, at run time.

and that commit cleaned up this usage to reflect that. This PR flips the
switch so that:

 - `binutils` is indeed unconditionally GNU Binutils
 - `binutils-raw`, which previously served that role, is gone.

so that the correct usage will be enforced going forward and everything
is simple.

N.B. In a few cases `binutils-unwrapped` (which before and now was
unconditionally actual GNU binutils), rather than `binutils` was used to
replace old `binutils-raw` as it is friendly towards some cross
compilation usage by avoiding a reference to the next bootstrapping
change.
@Ericson2314 Ericson2314 changed the base branch from master to staging April 3, 2018 17:35
@Ericson2314
Copy link
Member Author

Ericson2314 commented Apr 3, 2018

@shlevy urgg... my guess is the lack of a binutils-unwrapped preservation override in the Darwin bootstrapping before this caused the mass rebuild. Rebased.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: binutils

Partial log (click to expand)

/nix/store/w8c8szci956bi10m6fh8ad802qij6w3h-binutils-wrapper-2.30

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: binutils

Partial log (click to expand)

/nix/store/j8wyhwi347990b3rcd5mf0iqr1ng6jd1-binutils-wrapper-2.30

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: binutils

Partial log (click to expand)

Creating Perl synonyms
Writing tables
Making pod file
Making test script
Updating 'mktables.lst'
builder for '/nix/store/2yd6r3q8waq4rdnkvrgbh8visw7a2hl3-perl-5.24.3.drv' failed with exit code 2
cannot build derivation '/nix/store/zgaw3g72l4argrgb6xrcwgx63s8c6fxv-bison-3.0.4.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/l8gh4lfg56lhi450lr037152sx0ddawz-binutils-2.30.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/ajpb0pf9xlv2krxbf9fzr0z5vvhh37az-binutils-wrapper-2.30.drv': 1 dependencies couldn't be built
�[31;1merror:�[0m build of '/nix/store/ajpb0pf9xlv2krxbf9fzr0z5vvhh37az-binutils-wrapper-2.30.drv' failed

Copy link
Member

@LnL7 LnL7 left a comment

Choose a reason for hiding this comment

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

Did you also test the bootstrap tools?

@ttuegel ttuegel removed their request for review April 3, 2018 19:39
@Ericson2314
Copy link
Member Author

I built stdenv on darwin myself, so no not really sure what the ofborg failure is about.

@Ericson2314 Ericson2314 merged commit e4e0cd6 into NixOS:staging Apr 4, 2018
@Ericson2314 Ericson2314 deleted the binutils-is-binutils branch April 4, 2018 01:28
@Ericson2314 Ericson2314 added this to @bgamari's and @dtzWill's numerous fixes in Cross compilation Jul 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin 6.topic: portability General portability concerns, not specific to cross-compilation or a specific platform 8.has: clean-up 8.has: package (new) 10.rebuild-darwin: 501+ 10.rebuild-darwin-stdenv 10.rebuild-linux: 11-100
Projects
No open projects
Cross compilation
@bgamari's and @dtzWill's num...
Development

Successfully merging this pull request may close these issues.

None yet

4 participants