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

darwin: Backport tbd stdenv (Big Sur support) to 20.09 #121040

Closed

Conversation

Gabriella439
Copy link
Contributor

Fixes #118103

This backport cherrypicks the commits from these three pull requests, in order:

Motivation for this change

Currently Big Sur is only supported on master, but not in any of the stable releases (e.g. 20.09), so this backports Big Sur support to 20.09 so people don't have to switch to the nixpkgs-unstable release in order to support Mac.

Things done
$ nix build --file ./default.nix hello  # On Big Sur, which succeeded
  • 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.

thefloweringash and others added 21 commits April 27, 2021 11:44
installTarget looks like a typo for installTargets. This causes a lot
of llvm and clang to be built and installed.

Clang is not intended to be an external dependency. The source bundle
includes llvm and clang. Adding include paths and building clangBasic
first is sufficient to use the internal clang components.
This new version has tapi support, which is needed to build the new
stubs based libSystem, etc. and Big Sur support.

You can verify the provenance of these yourself by checking Hydra here:
https://hydra.nixos.org/build/128192471
Adapted from main expression for clang 7.
Build the llvm support libraries (libcxx, libcxxabi) from scratch
without using the existing llvm libraries. This is the same spirit and
similar implementation as the "useLLVM" bootstrap in llvm package
sets. Critically it avoids having libcxxabi provided by the cc-wrapper
when building libcxx, which otherwise results in two libcxxabi
instances.

$ otool -L /nix/store/vd4vvgs9xngqbjzpg3qc41wl6jh42s9i-libc++-7.1.0/lib/libc++.dylib
/nix/store/vd4vvgs9xngqbjzpg3qc41wl6jh42s9i-libc++-7.1.0/lib/libc++.dylib:
        /nix/store/vd4vvgs9xngqbjzpg3qc41wl6jh42s9i-libc++-7.1.0/lib/libc++.1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
        /nix/store/gmpwk5fyp3iasppqrrdpswxvid6kcp8r-libc++abi-7.1.0/lib/libc++abi.dylib (compatibility version 1.0.0, current version 1.0.0)
        /nix/store/3hn7azynqgp2pm5gpdg45gpq0ia72skg-libc++abi-7.1.0/lib/libc++abi.dylib (compatibility version 1.0.0, current version 1.0.0)
        /nix/store/1nq94scbxs6bk7pimqhvz76q6cfmbv97-Libsystem-osx-10.12.6/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)

Additionally move some utilities (clang, binutils, coreutils, gnugrep)
to the stage layers so they can be replaced before the final
stdenv. This should cause most of stage4 to be built from the
toolchain assembled as of stage3 instead of the bootstrap toolchain.
Exposed by the tbd stubs which contains fat libraries. The previously
used proxy libraries were x86_64 only.
Used during bootstrap to check that re-exported libraries are not
dangling.
Fixes bootstrapping on macOS Big Sur.
@r-rmcgibbo
Copy link

r-rmcgibbo commented Apr 28, 2021

Result of nixpkgs-review pr 121040 at a18f34f run on x86_64-linux 1

30 packages marked as broken and skipped:
  • clang-sierraHack
  • clang-sierraHack-stdenv
  • darwin.CF
  • darwin.binutils
  • darwin.binutils-unwrapped
  • darwin.cctools
  • darwin.configd
  • darwin.libtapi
  • libsForQt512.akonadi
  • libsForQt512.akonadi-calendar
  • ...
279 packages skipped due to time constraints:
  • boomerang
  • colord-kde
  • golden-cheetah
  • libsForQt512.accounts-qt
  • libsForQt512.alkimia
  • libsForQt512.appstream-qt
  • libsForQt512.ark
  • libsForQt512.attica
  • libsForQt512.baloo
  • libsForQt512.bluedevil
  • ...
14 packages built successfully:
  • darwin.darwin-stubs
  • darwin.print-reexports
  • libsForQt512.libdbusmenu
  • libsForQt512.phonon
  • libsForQt512.polkit-qt
  • qt512.qmake
  • qt512.qtbase
  • qt512.qtdeclarative
  • qt512.qtgraphicaleffects
  • qt512.qtsvg
  • qt512.qttools
  • qt512.qttranslations
  • qt512.qtwebchannel
  • qt512.qtx11extras
3 suggestions:
  • warning: missing-phase-hooks

    installPhase should probably contain runHook preInstall and runHook postInstall.

    Near pkgs/os-specific/darwin/darwin-stubs/default.nix:14:3:

       |
    14 |   installPhase = ''
       |   ^
    
  • warning: license-missing

    Package is missing a license.

    Near pkgs/os-specific/darwin/darwin-stubs/default.nix:12:3:

       |
    12 |   dontBuild = true;
       |   ^
    
  • warning: maintainers-missing

    Package does not have a maintainer. Consider adding yourself?

    Near pkgs/os-specific/darwin/darwin-stubs/default.nix:12:3:

       |
    12 |   dontBuild = true;
       |   ^
    

Result of nixpkgs-review pr 121040 at a18f34f run on aarch64-linux 1

23 packages marked as broken and skipped:
  • clang-sierraHack
  • clang-sierraHack-stdenv
  • libsForQt512.akonadi
  • libsForQt512.akonadi-calendar
  • libsForQt512.akonadi-contacts
  • libsForQt512.akonadi-notes
  • libsForQt512.akonadi-search
  • libsForQt512.akregator
  • libsForQt512.elisa
  • libsForQt512.kaddressbook
  • ...
267 packages skipped due to time constraints:
  • golden-cheetah
  • libsForQt512.accounts-qt
  • libsForQt512.alkimia
  • libsForQt512.appstream-qt
  • libsForQt512.ark
  • libsForQt512.attica
  • libsForQt512.baloo
  • libsForQt512.bluedevil
  • libsForQt512.bluez-qt
  • libsForQt512.bomber
  • ...
11 packages built successfully:
  • libsForQt512.libdbusmenu
  • libsForQt512.phonon
  • libsForQt512.polkit-qt
  • qt512.qtbase
  • qt512.qtdeclarative
  • qt512.qtgraphicaleffects
  • qt512.qtsvg
  • qt512.qttools
  • qt512.qttranslations
  • qt512.qtwebchannel
  • qt512.qtx11extras

@SuperSandro2000
Copy link
Member

I don't think we should backport such a big change to 20.09 when 21.05 is right around the corner.

@mweinelt
Copy link
Member

mweinelt commented Jul 5, 2021

Unfortunately NixOS 20.09 has reached its end-of-life status on 2021-07-01, one
month after the release of NixOS 21.05.

Since we do not accept any changes to its branches anymore, I'm closing this pull
request.

@mweinelt mweinelt closed this Jul 5, 2021
@Gabriella439 Gabriella439 deleted the gabriel/backport_big_sur branch December 1, 2021 17:19
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

7 participants