Commit Graph

2711 Commits

Author SHA1 Message Date
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
toonn
c3c5870e96
Merge pull request #307880 from reckenrode/ld64
cctools: 973.0.1 -> 1010.6
2024-07-17 08:22:14 +02:00
Yueh-Shun Li
c65cf1b9c5
pkgs/stdenv/generic/setup.sh: fix unbound variables and pass ShellCheck checks (#298831)
* pkgs/stdenv/generic/setup.sh: supress ShellCheck error about Bash array indexing syntax

* pkgs/stdenv/generic/setup.sh: loop by per-line read

* pkgs/stdenv/generic/setup.sh: fix variable quoting

* pkgs/stdenv/generic/setup.sh: separate declaration and assignment
2024-07-14 19:17:55 +03:00
Randy Eckenrode
a49dbb2544
darwin.stdenv: switch to top-level cctools and ld64 2024-07-13 17:54:36 -04:00
Randy Eckenrode
10c87ee2c7
stdenv: set NIX_DONT_SET_RPATH_FOR_TARGET on Darwin 2024-07-13 17:54:35 -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
Martin Weinelt
176a56c40f
Merge remote-tracking branch 'origin/staging-next' into staging
Conflicts:
- pkgs/applications/misc/blender/default.nix
- pkgs/development/web/nodejs/nodejs.nix
2024-07-11 01:06:28 +02:00
John Ericson
000b58721f Merge remote-tracking branch 'upstream/master' into openbsd-static 2024-07-09 18:18:47 -04:00
John Ericson
676df1cf2d openbsd: Add static linking support
I've had better luck creating statically-linked binaries that work than
dynamically-linked ones, so this is needed quite practically.
2024-07-09 18:17:06 -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
Martin Weinelt
e7b1ee45cf
Merge remote-tracking branch 'origin/staging-next' into staging
Conflicts:
- pkgs/tools/misc/watchlog/default.nix
2024-07-06 01:52:35 +02:00
Randy Eckenrode
75504615ad
stdenv/darwin/make-bootstrap-tools.nix: use darwin.binutils-unwrapped
After https://github.com/NixOS/nixpkgs/pull/322388, darwin.cctools is just Apple’s cctools again. The replacement for what the bootstrap tools wants is darwin.binutils-unwrapped.
2024-07-04 10:45:08 -04:00
Ryan Hendrickson
40428630bc
Merge pull request #317106 from trofi/dashed-source
stdenv: handle $sourceRoot that starts with dash
2024-07-02 23:48:25 -04:00
Reno Dakota
3cb23cec23
treewide: fixes to allow x64 darwin to default to sdk 11
update code to not assume that x64 darwin must use sdk 10.12. After this
change it's possible to build a sdk 11 stdenv on darwin x64
2024-07-02 23:30:01 +00:00
Randy Eckenrode
c6e9b98725
darwin.stdenv: make sure GNU binutils cannot be used
GNU binutils is not preferred on Darwin, and newer versions have issues building. Make it an evaluation error to use it in the Darwin stdenv bootstrap.
2024-06-27 08:10:34 -04:00
Randy Eckenrode
2b21ece48b
darwin.stdenv: update for darwin.binutils cleanup
- Only link binaries that exist for stage 0 cctools and LLVM bintools;
- Drop cctools-llvm in favor of the updated darwin.binutils; and
- Update llvm-manages Python overrides (needed for newer versions of LLVM).
2024-06-27 08:10:34 -04:00
Randy Eckenrode
e1ab7a10d8
darwin.stdenv: run LLVM tests only once 2024-06-27 07:33:47 -04:00
Randy Eckenrode
bb96a168d7
darwin.stdenv: reduce number of times Python is built 2024-06-27 07:33:47 -04:00
K900
e2665b3080 stdenv: fix typo 2024-06-24 10:17:10 +03:00
Martin Weinelt
2096642430
Merge remote-tracking branch 'origin/staging-next' into staging
Conflicts:
- pkgs/os-specific/windows/mingw-w64/default.nix
2024-06-23 19:09:00 +02:00
K900
1374c58013
Merge pull request #320370 from eclairevoyant/fix-checkmeta-predicates
check-meta: fix instructions
2024-06-22 14:28:12 +03:00
éclairevoyant
dbef1af49e
check-meta: rename local binding 2024-06-22 05:16:10 -04:00
John Ericson
744d7e7477 *bsdCross: Remove these package sets
I realized what rhelmot did in 61202561d9
(specify what packages just need `stdenvNoLibc`) is definitely the right
approach for this, and adjusted NetBSD and OpenBSD to likewise use it.
With that change, we don't need these confusing and ugly `*bsdCross`
package sets at all!

We can get rid of a lot more libc-related `*Cross`, and I will do so
soon, but this is the first step.

(adapted from commit 51f1ecaa59)
2024-06-21 11:47:36 -04:00
Vladimír Čunát
879821772c
Revert #320852: Clean up cross bootstrapping
It rebuilt stdenv on *-darwin; we can't do that in nixpkgs master.
This reverts commit 2f20501c5f, reversing
changes made to fd469c24af.
2024-06-21 07:48:24 +02:00
Rick van Schijndel
43ce0f9ee0
Merge pull request #318256 from risicle/ris-stack-clash-protection
cc-wrapper: add stack clash protection hardening flag
2024-06-19 19:54:30 +02:00
Ryan Lahfa
193b2c7637
Merge pull request #310387 from Qyriad/diag/log-hooks2
stdenv: log hooks as they run (take II)
2024-06-19 14:22:10 +02:00
John Ericson
51f1ecaa59 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.

Finally, the BSDs also had to be cleaned up, since they have a few
pre-libc dependencies, demanding a systematic approach. I realized what
rhelmot did in 61202561d9 (specify what
packages just need `stdenvNoLibc`) is definitely the right approach for
this, and adjusted NetBSD and OpenBSD to likewise use it.
2024-06-18 17:04:16 -04:00
éclairevoyant
396629c7b6
check-meta: fix instructions
Corrections to 17718ac255
2024-06-16 18:18:42 -04:00
Sergei Trofimovich
193fd8a237 generic/setup.sh: handle $sourceRoot that starts with dash
Without the change `runPhase` fails on tarballs like
`diffoscope-269` that contain single top-level `-269` root as:

    diffoscope> unpacking source archive /nix/store/p620nidkm73vrp0z6kk5krmrm4vg7bxd-diffoscope-269.tar.bz2
    diffoscope> source root is -269
    diffoscope> setting SOURCE_DATE_EPOCH to timestamp 1717143039 of file ./-269/tests/utils/versions.py
    diffoscope> chmod: invalid mode: ‘-269’
    diffoscope> Try 'chmod --help' for more information.

Currently `diffoscope-269` has a `sourceRoot = "./-269";` workaround to
bypass the failure.
2024-06-10 23:56:46 +01:00
Franz Pletz
3db93c351d cc-wrapper: add stack clash protection hardening flag
Most Linux distributions are enabling this these days and it does
protect against real world vulnerabilities as demonstrated by
CVE-2018-16864 and CVE-2018-16865.

Fix #53753.

Information on llvm version support gleaned from
6609892a2d
68e07da3e5
092507a730

Information on gcc version support a lot harder to gather,
but both 32bit and 64bit arm do appear to be supported
based on the test suite.
2024-06-07 20:23:46 +01:00
Silvan Mosberger
a3fad6299c
Merge pull request #314553 from gefla/annotate-substitutestream
Annotate substituteStream deprecation warning
2024-06-03 15:50:33 +02:00
Arnout Engelen
d57327020e
Merge pull request #297987 from raboof/check-meta-fix-allow-predicate-instructions
check-meta: fix 'predicate' instructions
2024-05-30 18:43:35 +02:00
Gerd Flaig
1949b0d16b Annotate substituteStream deprecation warning
This adds the derivation name to the warning to make debugging easier.
2024-05-25 18:32:10 +02:00
Qyriad
7acc356606 stdenv: log hooks as they run (take II)
A second take at eb28e5e72e, which was reverted for the extra logging
during the internals of `nix-shell -p`. This commit does the same
logging, but to $NIX_LOG_FD instead, which is echoed during any normal
build, but not during the internals of `nix-shell -p`.

[1]: eb28e5e72e
2024-05-22 16:28:31 -06:00
github-actions[bot]
0471a8be05
Merge staging-next into staging 2024-05-03 00:03:09 +00:00
github-actions[bot]
3588aea450
Merge master into staging-next 2024-05-03 00:02:39 +00:00
Artturin
124c828155
Merge pull request #269461 from Artturin/addcrossreplace
config.replaceCrossStdenv: add
2024-05-03 01:25:05 +03:00
Randy Eckenrode
c88b49062a
libiconv: use libiconv-darwin 2024-04-27 18:09:53 -04:00
Randy Eckenrode
89c9b73ce7
darwin.stdenv: propagate atf and kyua
Avoid building these packages more than once. Even though they require
linking to dylibs, they’re only used for running tests.
2024-04-27 18:09:53 -04:00
Randy Eckenrode
ad38102a67
darwin.stdenv: avoid an infinite recursion
libiconv-darwin depends on Meson, which (indirectly) depends on
libiconv. When libiconv-darwin is set as libiconv, it will cause an
infinite recursion. Avoid the infinite recursion by using libiconvReal
in stage 1. Every stage after that can use libiconv-darwin.
2024-04-27 18:09:52 -04:00
David McFarland
c642665a04 stdenv: fix missing dependencies in __sandboxProfile and __impureHostDeps
Fixes: 7f3ca3e21a (stdenv: Fix handling of dependencies and hooks)
Fixes: #237458
2024-04-19 15:02:27 -03:00
Vladimír Čunát
8c0c955a09
Merge branch 'master' into staging-next 2024-04-19 07:52:28 +02:00
sternenseemann
7be562d046 wrapCC, wrapBintools: move expand-response-params bootstrapping out
The cc and bintools wrapper contained ad hoc bootstrapping logic for
expand-response-params (which was callPackage-ed in a let binding). This
lead to the strange situation that the bootstrapping logic related to
expand-response-params is split between the wrapper derivations (where
it is duplicated) and the actual stdenv bootstrapping.

To clean this up, the wrappers simply should take expand-response-params
as an ordinary input: They need an adjacent expand-response-params (i.e.
one that runs on their host platform), but don't care about the how.
Providing this is only problematic during stdenv bootstrapping where we
have to pull it from the previous stage at times.
2024-04-18 20:49:13 +02:00
sternenseemann
b2a568906a wrapCC, wrapBintools: use runtimeShell instead of stdenv shell
We don't need to artificially make sure that we can execute the wrapper
scripts on the build platform by using stdenv's shell (which comes from
buildPackages) since our cross infrastructure will get us the wrapper
from buildPackages. The upside of this change is that cross-compiled
wrappers (e.g. pkgsCross.aarch64-multiplatform.gcc) will actually work
when executed!

For bootstrapping this is also not a problem, since we have a long
build->build platform chain so runtimeShell is just as good as
stdenvNoCC.shell. We do fall back to old ways, though, by explicitly
using the bootstrap-tools shell in stage2, so the adjacent bash is only
used from stage4 onwards. This is unnecessary in principle (I'll try
removing this hack in the future), but ensures this change causes zero
rebuilds.
2024-04-18 20:49:13 +02:00
github-actions[bot]
ae22f8403a
Merge master into staging-next 2024-04-18 18:00:58 +00:00