Commit Graph

3504 Commits

Author SHA1 Message Date
Eman Resu
abae302132 stdenv.mkDerivation: move config lookups to global scope 2026-05-19 22:38:33 -04:00
Eman Resu
a351d833a2 stdenv.mkDerivation: move pos thunk inside another thunk 2026-05-19 21:16:57 -04:00
Eman Resu
a53a185737 stdenv.mkDerivation: inline call to toExtension 2026-05-19 21:14:17 -04:00
Stefan Frijters
fea908fde9 stdenv: do not leak outputName out of loop
This is an implementation detail leaking out into the bash environment
and it did manange to confuse me as potentially being a way to get the "default"
output name when structuredAttrs is enabled, because of the "outputName" derivation attribute.
2026-05-18 14:56:50 +02:00
Aliaksandr
a42becdd92 stdenv/generic: replace // optionalAttrs with nullable attr names
Convert 3 optionalAttrs in the stdenv derivation call to nullable
attribute names: allowedRequisites, contentAddressedByDefault, and
isDarwin sandbox/impureHostDeps.
2026-05-18 03:54:26 +03:00
Aliaksandr
d6d58a85e1 make-derivation: remove no longer valid comment
The comment claimed configureFlags is "sometimes a string, sometimes
null, and sometimes a list" — the normalization it referenced was
removed long ago; configureFlags is always a list now.
2026-05-18 03:54:18 +03:00
Michael Daniels
e4da0a7e03 Merge branch 'master' into staging-next 2026-05-17 20:04:53 -04:00
Eman Resu
04078604e8 stdenv.mkDerivation: warn on nested lists 2026-05-16 22:12:08 -04:00
nixpkgs-ci[bot]
e43fd15291 Merge master into staging-next 2026-05-16 18:20:34 +00:00
adisbladis
a24cd2fd27 stdenv/adapters: foldl -> foldl' 2026-05-16 15:51:29 +12:00
nixpkgs-ci[bot]
cdaa8f2aeb Merge master into staging-next 2026-05-11 16:10:22 +00:00
Michael Daniels
ab2fe22124 stdenv/check-meta: verify that licenses aren't derivations
Among other things, "zlib" is a license, and it's difficult to debug the eval
errors that occur when that derivation gets added to meta.licenses.
2026-05-11 08:12:01 -04:00
adisbladis
8e46c489d0 stdenv.mkDerivation: Optimise hardening flag handling 2026-05-10 16:16:46 +12:00
nixpkgs-ci[bot]
18bb448d8a Merge master into staging-next 2026-05-10 03:06:06 +00:00
Eman Resu
1aea84e9f7 stdenv.mkDerivation: inherit all builtins 2026-05-09 20:37:46 -04:00
Eman Resu
13fb2f08dc stdenv.mkDerivation: inherit all lib variables 2026-05-09 20:37:33 -04:00
nixpkgs-ci[bot]
97a25f9a22 Merge master into staging-next 2026-05-10 00:37:28 +00:00
Eman Resu
789a15ef68 stdenv.mkDerivation: move attrs removed for derivationArg to global scope 2026-05-09 20:37:22 -04:00
Eman Resu
9f278a55db stdenv.mkDerivation: store default builder args in global scope 2026-05-09 20:37:14 -04:00
Eman Resu
8de09cd1f8 stdenv.mkDerivation: move reference checking attrs to global scope 2026-05-09 20:37:11 -04:00
Eman Resu
57c99d5722 stdenv.mkDerivation: move list of attribute names out to global scope 2026-05-09 20:27:58 -04:00
Eman Resu
dfa34d9376 stdenv.mkDerivation: move attrNames out of happy path 2026-05-09 20:26:45 -04:00
Eman Resu
2113c381ea stdenv.mkDerivation: move errors variable out of happy path 2026-05-09 20:26:44 -04:00
Eman Resu
95a031c363 stdenv.mkDerivation: remove assertMsg usage
Saves function calls on the happy path.
2026-05-09 20:26:42 -04:00
Eman Resu
9c1453602e stdenv.mkDerivation: only create enabledHardeningOptions variable if necessary 2026-05-09 20:26:08 -04:00
Eman Resu
32dc7f6f02 stdenv.mkDerivation: inline hardeningDisable'
We can safely check `elem "all" hardeningDisable'` on the original list,
because calling `unique` and `concretizeFlagImplications` will never
change whether the list contains "all".
2026-05-09 20:26:08 -04:00
Eman Resu
faf7bd1d38 stdenv.mkDerivation: move concretizeFlagImplications to global scope 2026-05-09 20:26:08 -04:00
Emily
8bbdac1eaa stdenv.mkDerivation: follow-up performance improvements (#513858) 2026-05-09 23:51:36 +00:00
Eman Resu
152d862bb0 stdenv.mkDerivation: cache output checks to avoid reallocating 2026-05-09 19:25:03 -04:00
Eman Resu
fc43f076bb stdenv.mkDerivation: avoid listToAttrs if outputChecks will end up empty 2026-05-09 19:14:47 -04:00
Eman Resu
26b51ec16d stdenv.mkDerivation: avoid concat if separateDebugInfo' is false 2026-05-09 19:11:05 -04:00
Eman Resu
fde4f1c5a0 stdenv.mkDerivation: check meta.mainProgram from original meta
We define a meta variable in the same let block as the result of
the `commonMeta` call. Avoiding evaluating the result of that call
until we need to is preferable.
2026-05-09 18:25:32 -04:00
Eman Resu
ac796e9827 stdenv.mkDerivation: use or statement for default hardening flags
As suggested in PR review:
"It seems like when `!stdenvHasCC`, `stdenv.cc` is `null`. So this could
probably just be `defaultHardeningFlags =
stdenv.cc.defaultHardeningFlags or knownHardeningFlags;`?"
2026-05-09 16:40:36 -04:00
Eman Resu
ce35986f7f stdenv/mkDerivation: only run zipAttrsWith if we have to
If attrs.outputChecks.${name} is undefined, we'd be performing an
unnecessary no-op.
2026-05-09 15:50:15 -04:00
Eman Resu
ec66d5fc09 stdenv.mkDerivation: only run fold if an invalid type or list is passed 2026-05-09 15:50:15 -04:00
Eman Resu
7b8b8413ea stdenv.mkDerivation: avoid checking dependency list for empty lists 2026-05-09 15:50:14 -04:00
Eman Resu
ada7d723b1 stdenv/darwin: remove no-ops 2026-05-09 15:50:14 -04:00
jopejoe1
d3ab010c1f treewide: replace lib.trivial.release with hardcode version (hack)
This is not the actual version we want to hardcode here, but due to the upcomming branch-of we need this version to not beaffected by the release version, but it also needs to stay exatly the same as we do not want to rebuild `stdenv` anymore post branch-of.
2026-05-08 10:36:52 +02:00
nixpkgs-ci[bot]
f2fcfe6487 Merge staging-next into staging 2026-05-07 12:39:44 +00:00
adisbladis
01a2e3e6b5 stdenv/check-meta: avoid running platformMatch if we can help it (#517542) 2026-05-07 10:22:56 +00:00
Eman Resu
2059866080 stdenv/check-meta: avoid running platformMatch if we can help it 2026-05-07 01:19:14 -04:00
K900
cd9a5eeafb Merge remote-tracking branch 'origin/staging-next' into staging 2026-05-04 21:37:41 +03:00
Silvan Mosberger
c7bbefcc6c stdenv/meta: Propagate nonTeamMaintainers if possible
This fixes the problem where if `meta` for package A is inherited from
package B, both team and non-team maintainers would end up in
nonTeamMaintainers, because by default it would take the value from
meta.maintainers, which when accessed also contains team maintainers
for backwards compatibility reasons.
2026-05-04 09:55:40 +02:00
nixpkgs-ci[bot]
2021eaf5ce Merge staging-next into staging 2026-05-03 18:19:45 +00:00
Alyssa Ross
ff7579709b stdenv/check-meta: various performance cleanups (#514492) 2026-05-03 17:26:37 +00:00
Eman Resu
4da12f050a stdenv/check-meta: call containsLicenses early with list 2026-05-03 08:08:29 -04:00
Eman Resu
df268eb420 stdenv/check-meta: move negation outside loop, avoid primop if undefined 2026-05-03 08:08:26 -04:00
Eman Resu
0ae0cab0b8 stdenv.mkDerivation: fallback to knownHardeningFlags directly with stdenvNoCC 2026-05-02 17:27:49 -04:00
Eman Resu
0d2799e68b stdenv.mkDerivation: check that build inputs are empty individually
Allows short-circuiting and less concatenation. Thanks to the last
commit, this is now only meaningful if `hostPlatform != buildPlatform`.
2026-05-02 17:27:49 -04:00
Eman Resu
9e49230e6d stdenv.mkDerivation: check if host suffix is necessary
Rather than precomputing what the stdenv host suffix should be, we check
the condition first. This is even better than turning the concats into
multiple comparisons (although I'm going to do that as well), since if
hostPlatform == buildPlatform, we never have to evaluate any further.
2026-05-02 17:27:49 -04:00