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

stdenv/darwin: put compiler-rt into bootstrap tarball #94426

Draft
wants to merge 1 commit into
base: master
from

Conversation

@thefloweringash
Copy link
Member

thefloweringash commented Aug 1, 2020

compiler-rt is no longer included in clang, so the current result of
building bootstrap tools doesn't include compiler-rt at all.

Motivation for this change

I want to update bootstrap tools soon as part of #19906, but just doing the update results in a subtly broken early toolchain. It looks like the bootstrap tools builder needs a small update. This is the first part that puts the required parts into the tarball, there's a follow up that fixes the unpacking stage.

This defines a new set of bootstrap tools, see #94427 for the "other half" that uses the updated bootstrap tools.

Possibly related #39743

cc @matthewbauer and @LnL7 who seem to work on the bootstrap files

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
compiler-rt is no longer included in clang, so the current result of
building bootstrap tools doesn't include compiler-rt at all.
@thefloweringash
Copy link
Member Author

thefloweringash commented Aug 1, 2020

The main problem I'm seeing with trying to update the bootstrap tools without both of these changes is

$ nix-build -A perlPackages.LocaleGettext
[...]
running tests
check flags: SHELL=/nix/store/2zpjcwvc73cmirzvw7g461s96ri6dr55-bash-4.4-p23/bin/bash VERBOSE=y test
"/nix/store/z72xsh2ks2w337q2mr8kanhb47hln76l-perl-5.30.3/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- gettext.bs blib/arch/auto/Locale/gettext/gettext.bs 644
PERL_DL_NONLAZY=1 "/nix/store/z72xsh2ks2w337q2mr8kanhb47hln76l-perl-5.30.3/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/bind.t ....... Can't load '/private/tmp/nix-build-perl5.30.3-gettext-1.07.drv-1/Locale-gettext-1.07/blib/arch/auto/Locale/gettext/gettext.bundle' for module Locale::gettext: dlopen(/private/tmp/nix-build-perl5.30.3-gettext-1.07.drv-1/Locale-gettext-1.07/blib/arch/auto/Locale/gettext/gettext.bundle, 2): Symbol not found: ___isOSVersionAtLeast
  Referenced from: /nix/store/p4s4w4q1lwvcla9p88d9ikvvwfxl66fg-curl-7.71.1/lib/libcurl.4.dylib
  Expected in: flat namespace
 in /nix/store/p4s4w4q1lwvcla9p88d9ikvvwfxl66fg-curl-7.71.1/lib/libcurl.4.dylib at /nix/store/z72xsh2ks2w337q2mr8kanhb47hln76l-perl-5.30.3/lib/perl5/5.30.3/darwin-thread-multi-2level/DynaLoader.pm line 197.
 at t/bind.t line 6.
Compilation failed in require at t/bind.t line 6.
BEGIN failed--compilation aborted at t/bind.t line 6.
t/bind.t ....... Dubious, test returned 2 (wstat 512, 0x200)
Failed 1/1 subtests
[...]

Full log: https://gist.github.com/thefloweringash/10f236a3d9fee59298bdee2ec47480e8


The curl with the undefined ___isOSVersionAtLeast symbol is built from stage 4. Maybe the most significant change is the cc-wrapper setup in #94427.

$ nix show-derivation /nix/store/p4s4w4q1lwvcla9p88d9ikvvwfxl66fg-curl-7.71.1/lib/libcurl.4.dylib | head -2
{
  "/nix/store/cy80vkg7r3m4gi0c3lhlhk4a5dshlrnw-curl-7.71.1.drv": {

$ nix-store -q --references /nix/store/cy80vkg7r3m4gi0c3lhlhk4a5dshlrnw-curl-7.71.1.drv | grep stdenv
/nix/store/2p866jj5z5l1qgaz6h4a63pb1azakxs7-bootstrap-stage4-stdenv-darwin.drv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.