Commit Graph

385 Commits

Author SHA1 Message Date
github-actions[bot]
3533282a88
Merge master into staging-next 2024-11-07 20:49:24 +00:00
Emily
38835c8256 stdenv/darwin: add darwin.{libutil,copyfile} to SDK packages 2024-11-07 19:08:52 +00:00
Emily
ad625dd172 stdenv/darwin: fix SDK overlays for macOS SDK < 11
Quite impressive that this worked up until now.

Co-authored-by: Lily Foster <lily@lily.flowers>
2024-11-07 17:58:57 +00:00
Reno Dakota
52bf1163fa
treewide: use getLib when accessing clang / libclang / stdenv.cc.cc
In preparation to eliminate the lib output for the unwrapped clang, use
`lib.getLib` to access the `lib` output.
2024-11-07 10:27:41 +00:00
Reno Dakota
0fc9787683
darwin.stdenv: add file to early stdenv stages
file is part of the final stdenv and llvm_19 requires it for tests. add
file to the path to the early stage stdenv's for the upcoming switch to
llvm_19
2024-11-02 19:00:00 -07:00
Emily
c5040d558c
darwin.stdenv: avoid building a second Python just for locales (#351501) 2024-10-26 19:37:05 +01:00
Randy Eckenrode
53765b0fb3
darwin.stdenv: avoid building a second Python just for locales 2024-10-26 14:28:00 -04:00
Emily
b75c70282f ld64: search standard library locations
This is basically harmless for the same reason as it is for Clang, and
lets us avoid doing wrapper hacks to fix things like the .NET build.

This reverts commit 4340a5addb.
2024-10-24 18:11:34 +01:00
Emily
514b00cf08 clang: skip the -nostdlibinc patch on Darwin 2024-10-24 17:55:27 +01:00
Randy Eckenrode
22885f81c5
freshBootstrapTools.bootstrapTools: update for new SDK pattern
- Drop libSystem. It’s no longer needed. The SDK can be downloaded and
  built with existing tools.
- Add jq and tapi. Adding these allows the stdenv bootstrap to stop
  special-casing stage 0.
- Update tests for updated ld64. It handles code-signing properly, so
  the signatures aren’t broken.
2024-10-11 18:40:58 -04:00
Randy Eckenrode
840a4f7771
darwin.stdenv: propagate bmake from stage 1 (for darwin.locale) 2024-10-11 17:58:38 -04:00
Randy Eckenrode
1d030c0ad7
darwin.stdenv: propagate darwin.locale as a no-CC package 2024-10-11 17:58:21 -04:00
Randy Eckenrode
092b50a92c
python3: fix stdenv bootstrap on x86_64-darwin
The bootstrap tools linker sometimes crashes when trying to link the
sqlite3 tests, which causes the bootstrap Python not to have the sqlite3
module. This causes the freezegun module to fail to build later in the
bootstrap. Using the 11.0 SDK fixes the problem.

Upstream Python supports building with a newer SDK and back-deploying,
so this change should not negatively affect users on pre-11.0 releases.
2024-10-10 16:23:09 -04:00
Randy Eckenrode
0e61488c5b
overrideSDK: update for the new SDK
Change the adapter to add the requested SDK to the target’s build
inputs. Note that only the “11.0” (i.e., 11.3) and 12.3 SDKs are
supported. This adapter is retained for compatibility. The preferred way
to override the SDK is to add it to the appropriate inputs directly.
2024-10-10 16:23:08 -04:00
Randy Eckenrode
66fcbb94e7
makeStaticDarwin: drop darwin-portable-libSystem-hook
`${stdenv.cc.libc}/lib/libSystem.B.dylib` does not exist and not existed
for as long as I have used nixpkgs. Since `/usr/lib/libSystem.B.dylib`
is already linked via text-based stubs, continue relying on those.
2024-10-10 16:23:08 -04:00
Randy Eckenrode
9c004ef367
darwin.stdenv: use xarMinimal
Using xarMinimal avoids pulling e2fsprogs and (eventually) macfuse-stubs
into the Darwin stdenv bootstrap.
2024-10-10 16:23:03 -04:00
Randy Eckenrode
76a5ef680e
darwin.stdenv: rework for the new SDK
While it would be nice if this could be split, there are too many
changes as part of the cleanup and improvements, including:

- Refactoring all propagated packages into functions that can be used to
  ensure that packages are propagated only at the expected stages;
- Using a sanity-checking merge function to ensure that packages are
  only propagated by one of the above functions;
- Reducing the number of Python builds during the bootstrap to one;
- Removing the extra sysctl stage;
- Using the LLVM bootstrap to build LLVM, clang, libc++, etc;
- Propagating llvmPackages_<version> in the final stdenv, so that
  packages needing that version specifically don’t have to rebuild it;
- Bootstrapping with the new Darwin SDK; and
- Reducing the overall number of paths build during a bootstrap by ~33%.
2024-10-10 16:23:03 -04:00
github-actions[bot]
b6b2ac4f61
Merge master into staging-next 2024-09-07 00:12:59 +00:00
Philip Taron
d89b0969ac
overrideSDK: fix on aarch64-darwin (#340131) 2024-09-06 14:01:44 -07:00
John Ericson
f43cc75868
Clean up cross bootstrapping, take 2 (#321525) 2024-09-06 14:56:54 -04:00
Emily
f69ba1fed5 overrideSDK: fix on aarch64-darwin
I don’t want to talk about it.

Fixes QEMU.
2024-09-06 16:59:17 +01:00
John Ericson
5f134ec6cf Clean up cross bootstrapping
For a long time, we've had `crossLibcStdenv`, `*Cross` libc attributes,
and `*bsdCross` pre-libc package sets. This was always bad because
having "cross" things is "not declarative": the naming doesn't reflect
what packages *need* but rather how we *provide* something. This is
ugly, and creates needless friction between cross and native building.

Now, almost all of these `*Cross` attributes are gone: just these are
kept:

- Glibc's and Musl's are kept, because those packages are widely used
  and I didn't want to risk changing the native builds of those at this
  time.

- generic `libcCross`, `theadsCross`, and friends, because these relate
  to the convolulted GCC bootstrap which still needs to be redone.

The BSD and obscure Linux or freestnanding libcs have conversely all
been made to use a new `stdenvNoLibc`, which is like the old
`crossLibcStdenv` except:

1. It usable for native and cross alike

2. It named according to what it *is* ("a standard environment without
   libc but with a C compiler"), rather than some non-compositional
   jargon ("the stdenv used for building libc when cross compiling",
   yuck).

I should have done this change long ago, but I was stymied because of
"infinite recursions". The problem was that in too many cases we are
overriding `stdenv` to *remove* things we don't need, and this risks
cyles since those more minimal stdenvs are used to build things in the
more maximal stdenvs.

The solution is to pass `stage.nix` `stdenvNoCC`, so we can override to
*build up* rather than *tear down*. For now, the full `stdenv` is also
passed, so I don't need to change the native bootstraps, but I can see
this changing as we make things more uniform and clean those up.

(adapted from commit 51f1ecaa59)
(adapted from commit 1743662e55)
2024-09-06 10:26:56 -04:00
github-actions[bot]
74cdd9c9b1
Merge master into staging-next 2024-09-05 00:13:11 +00:00
w
d7ec977f86 stdenv: Allow user to supply their bootstrapFiles set of tools 2024-08-30 02:31:18 +00:00
Ivan Trubach
5eee6cf40a xar: 1.6.1 -> 498
This change switches the xar package from unmaintained fork of the
original project to the Apple Open Source tarball. See also
https://repology.org/project/xar/versions

Since the package is essentially rewritten from scratch, we take an
opportunity and move it to pkgs/by-name/xa/xar (formatted with nixfmt).

We also remove Windows from the supported platforms because even before
this change pkgsCross.mingwW64.xar failed with
xar> configure: error: can not detect the size of your system's uid_t type
2024-08-25 18:10:08 +03:00
Randy Eckenrode
2c5001b1db
darwin.stdenv: format with nixfmt-rfc-style 2024-08-11 23:11:04 -04:00
Vladimír Čunát
d4720e9c1e
Merge branch 'staging-next' into staging
There was a nontrivial conflict in pkgs/stdenv/linux/bootstrap-tools*
(reorganizing code vs. modifying it)  I hope I really got it right.
2024-08-05 11:05:55 +02:00
github-actions[bot]
81cddc1677
Merge staging-next into staging 2024-08-03 00:02:50 +00:00
Philip Taron
1441f48d99
freshBootstrapTools: remove rec in favor of explicit attrset building 2024-08-02 16:11:03 -07:00
Philip Taron
91e1f1c9d6
freshBootstrapTools: nixfmt make-bootstrap-tools.nix 2024-08-02 16:11:02 -07:00
Philip Taron
d0d5a7a112
freshBootstrapTools: extract bootstrapFiles as a passthru on its core derivation 2024-08-02 16:11:02 -07:00
Philip Taron
d7c66f0996
freshBootstrapTools.build: extract as a package 2024-08-02 16:10:59 -07:00
Philip Taron
1cd5d6843a
freshBootstrapTools.test: extract as a package 2024-08-02 16:08:15 -07:00
Philip Taron
003725a97d
freshBootstrapTools.bootstrapTools: extract as a package 2024-08-02 16:08:15 -07:00
Philip Taron
217c61a1d7
freshBootstrapTools: remove top-level with statement 2024-08-02 16:08:15 -07:00
Emily
c6a4f2c6cd
Merge pull request #314167 from reckenrode/override-sdk-list-inputs-fix
overrideSDK: handle propagated lists of inputs
2024-08-02 22:55:05 +01:00
K900
4f29b5a16b Merge remote-tracking branch 'origin/staging-next' into staging 2024-07-31 08:57:17 +03:00
Randy Eckenrode
4b35b26dad
stdenv/darwin/make-bootstrap-tools.nix: add libcodedirectory.1.dylib
`libcodedirectory.1.dylib` is needed by ld64 and several tools from cctools such as `codesign_allocate`.
2024-07-30 15:26:40 -04:00
Emily
8a837af302
Merge pull request #326819 from risicle/ris-shadowstack
cc-wrapper: add support for `shadowstack` hardening flag
2024-07-28 19:07:52 +01:00
Randy Eckenrode
d5e2c40823
darwin.stdenv: remove darwin.ICU from the final overlay
Nothing in the stdenv needs it. Keeping it there pulls bootstrap tools into its build environment.
2024-07-22 20:54:22 -04:00
Randy Eckenrode
312e20a312
darwin.stdenv: fix scons Python override
This reduces the number of Python builds in the bootstrap to two: a minimal build and a normal build. Both have LTO disabled, which is required due to missing LLVM LTO libraries. This is necessary to correctly enable LTO builds in Python because it needs `llvm-ar` from `stdenv.cc.cc.libllvm`, which does not exist in the bootstrap.
2024-07-20 21:32:38 -04:00
Robert Scott
b207b6ef74 cc-wrapper: add support for shadowstack hardening flag 2024-07-14 21:25:47 +01:00
Randy Eckenrode
a49dbb2544
darwin.stdenv: switch to top-level cctools and ld64 2024-07-13 17:54:36 -04:00
Randy Eckenrode
9403fdc4a6
darwin.stdenv: consolidate stage 2 into one stage
Separate stages are no longer necessary because CF is not built from source and will not be built in the future.
2024-07-13 17:54:35 -04:00
Randy Eckenrode
05e5d7f73e
darwin.stdenv: clean up GNU binutils ban
- Only propagate binutils-unwrapped; and
- Clarify in the `throw` that it cannot be used in the Darwin bootstrap.
2024-07-13 17:54:35 -04:00
Randy Eckenrode
78da51cdb0
darwin.stdenv: adjust flags for llvm-strip in bootstrap tools 2024-07-13 17:54:35 -04:00
Randy Eckenrode
8559d6466b
darwin.stdenv: always use a response file
The bootstrap tools have been updated, so it is no longer necessary to suppress using a response file in the Darwin stdenv bootstrap.
2024-07-13 17:54:35 -04:00
Randy Eckenrode
65a37e7b14
darwin.stdenv: make sure curl cannot be used
Fetchers can use the `curl` binary from the bootstrap tools. Allowing packages in the Darwin bootstrap to link curl makes any curl update cause a full rebuild on Darwin, which is undesirable.
2024-07-13 17:54:35 -04:00
Tristan Ross
cfe063d174
overrideSDK: fix missing host platform inside of override 2024-07-08 17:21:55 -07:00
Tristan Ross
7a95a8948b
Merge pull request #324155 from paparodeo/x64-sdk11-no-rebuilds
treewide: change various flags to allow x64 darwin to default to sdk 11.0 when ready
2024-07-08 17:19:17 -07:00