1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-11 04:56:01 +01:00
Commit graph

20981 commits

Author SHA1 Message Date
Jörg Thalheim
6dcbac4278
Merge pull request #13040 from ilya-bobyr/fish-profile-set-MANPATH
nix-profile-daemon.fish: Set MANPATH
2025-04-17 10:24:19 +02:00
Jörg Thalheim
6fe0545bf3
Merge pull request #13041 from ilya-bobyr/fish-profile-do-not-test-USER
nix-profile.fish: Do not check $USER
2025-04-17 10:23:59 +02:00
Illia Bobyr
66ae8f4f44
nix-profile.fish: Do not check $USER
While it seems unlikely that `$USER` will be unset while `$HOME` is set,
as `$USER` is not used in the script and as `nix-profile-daemon.fish` is
not checking `$USER`, it seems better to remove this check.

`nix-profile.fish` and `nix-profile-daemon.fish` now become identical.
2025-04-16 17:16:51 -07:00
Illia Bobyr
470c521bcc
nix-profile-daemon.fish: Set MANPATH
There seems to be no good reason for `nix-profile.fish` to set
`$MANPATH` while it being unset when `nix-profile-daemon.fish` is used.
2025-04-16 17:14:47 -07:00
Illia Bobyr
fc8c11be48
nix-profile.fish: Add local state dir bin to $PATH
It seems reasonable to add both `$HOME/.profile/bin` and
`@localstatedir@/nix/profiles/default/bin` to `$PATH` for both user
local and daemon based nix execution.  Nix daemon execution mode does
not affect these path.
2025-04-16 17:11:56 -07:00
John Ericson
9792d6bbd9 Move DerivationBuilder to its own file/header
The building logic is now free of the scheduling logic!

(The interface between them is just what is in the new header. This
makes it much easier to audit, and shrink over time.)
2025-04-16 18:59:17 -04:00
John Ericson
6c2a7fdc49 Copy local-derivation-goal.cc to derivation-builder.{cc,hh}
This is done to prior to splitting, just like
05cc5a8587 for
68f4c728ec.
2025-04-16 18:59:17 -04:00
mergify[bot]
b509502bd5
Merge pull request #12663 from obsidiansystems/local-derivation-goal-encapsulation
Some checks are pending
CI / eval (push) Waiting to run
CI / tests ${{ matrix.scenario }} (darwin, macos-14, on macos) (push) Waiting to run
CI / tests ${{ matrix.scenario }} (linux, ubuntu-24.04, on ubuntu) (push) Waiting to run
CI / installer test ${{ matrix.scenario }} (darwin, macos-14, on macos) (push) Blocked by required conditions
CI / installer test ${{ matrix.scenario }} (linux, ubuntu-24.04, on ubuntu) (push) Blocked by required conditions
CI / Check Docker secrets present for installer tests (push) Waiting to run
CI / docker_push_image (push) Blocked by required conditions
CI / vm_tests (push) Waiting to run
CI / flake_regressions (push) Blocked by required conditions
Separate derivation building from the scheduler
2025-04-16 22:33:25 +00:00
John Ericson
d98c0dbe99 Start separating scheduling from building
We have a new `DerivationBuilder` struct, and `DerivationBuilderParams`
`DerivationBuilderCallbacks` supporting it.

`LocalDerivationGoal` doesn't subclass any of these, so we are ready to
now move them out to a new file!
2025-04-16 17:54:56 -04:00
John Ericson
f81c06accf Gut LocalDerivationGoal::tryLocalBuild
Now, most of it is in two new functions:
`LocalDerivationGoal::{,un}repareBuild`.

This might seems like a step backwards from coroutines --- now we have
more functions, and are stuck with class vars --- but I don't think it
needs to be.

There's a few options here:

- (Re)introduce coroutines for the isolated building logic. We could use the
  same coroutines types, or simpler ones specialized to this use-case.
  The `tryLocalBuild` caller can still use `Goal::Co`, and just will
  manually "pump" this inner coroutine.

- Return closures from each step. This is sort of like coroutines by
  hand, but it still allows us to stop writing down the local variables
  in each type.

  Being able to fully-use RAII again would be very nice!

- Keep top-level first-order functions like now, but make more
  functional. Instead of having one state object (`DerivationBuilder`)
  for all steps (setup, run, teardown), we can have separate structs for
  the live variables at each point we consume and return.

  This at least avoids "are these variables active at this time?"
  questions, but doesn't give us the full benefit of RAII as we must
  manually ensure FIFO create/destroy orders still.

One thing to note is that by keeping the `outputLock` unlocking in
`tryLocalBuild`, we are arguably uncovering a rebuild scheduling vs
building distinction, as the output locks are pretty squarely a
scheduling concern. It's nice that the builder doesn't need to know
about them at all.
2025-04-16 17:39:45 -04:00
John Ericson
ae7f411a18 Remove some unused includes
This is unreleated to the other commits in this PR.
2025-04-16 17:39:22 -04:00
John Ericson
e83ef7a477 Make appendLogTailErrorMsg as class method after all
The other parameters it took were somewhat implementation-specific.
2025-04-16 15:40:59 -04:00
mergify[bot]
8a7b8dce5f
Merge pull request #13033 from NixOS/mergify/bp/2.28-maintenance/pr-13032
Some checks failed
CI / eval (push) Has been cancelled
CI / tests ${{ matrix.scenario }} (darwin, macos-14, on macos) (push) Has been cancelled
CI / tests ${{ matrix.scenario }} (linux, ubuntu-24.04, on ubuntu) (push) Has been cancelled
CI / Check Docker secrets present for installer tests (push) Has been cancelled
CI / vm_tests (push) Has been cancelled
CI / installer test ${{ matrix.scenario }} (darwin, macos-14, on macos) (push) Has been cancelled
CI / installer test ${{ matrix.scenario }} (linux, ubuntu-24.04, on ubuntu) (push) Has been cancelled
CI / docker_push_image (push) Has been cancelled
CI / flake_regressions (push) Has been cancelled
Improve derivation "advanced attrs" test, fix almost-bug (backport #13032)
2025-04-15 19:06:26 +00:00
John Ericson
29ae14114e Remove stray assignment side affect in lambda
This was almost a bug! It wasn't simply because another assignment would
clobber it later.

(cherry picked from commit 32409dd7d7)
2025-04-15 14:25:16 -04:00
John Ericson
30d900b313 Derivation "advanced attrs" test: Ensure fields are set to distinct values
We had fields set to the same values before in our test data. This is
not a problem per-se, but does mean we wouldn't catch certain mixups.
Now, the fields are set to distinct values (where possible), which makes
the test more robust.

(cherry picked from commit a0b2b75f59)
2025-04-15 14:25:13 -04:00
Jörg Thalheim
89ba6dff66
Merge pull request #13032 from obsidiansystems/more-outputs-test
Some checks failed
CI / eval (push) Has been cancelled
CI / tests ${{ matrix.scenario }} (darwin, macos-14, on macos) (push) Has been cancelled
CI / tests ${{ matrix.scenario }} (linux, ubuntu-24.04, on ubuntu) (push) Has been cancelled
CI / Check Docker secrets present for installer tests (push) Has been cancelled
CI / vm_tests (push) Has been cancelled
CI / installer test ${{ matrix.scenario }} (darwin, macos-14, on macos) (push) Has been cancelled
CI / installer test ${{ matrix.scenario }} (linux, ubuntu-24.04, on ubuntu) (push) Has been cancelled
CI / docker_push_image (push) Has been cancelled
CI / flake_regressions (push) Has been cancelled
Improve derivation "advanced attrs" test, fix almost-bug
2025-04-15 19:08:35 +02:00
Jörg Thalheim
009ff8e5a7
Merge pull request #13013 from NaN-git/fix-ceil-floor
libexpr: fix UB in builtins.ceil and builtins.floor
2025-04-15 18:56:46 +02:00
Jörg Thalheim
cf6da9234c
Merge pull request #12410 from obsidiansystems/derivation-options-2
Scrap `ParsedDerivation` for parts
2025-04-15 18:36:11 +02:00
John Ericson
32409dd7d7 Remove stray assignment side affect in lambda
This was almost a bug! It wasn't simply because another assignment would
clobber it later.
2025-04-15 12:29:17 -04:00
John Ericson
a0b2b75f59 Derivation "advanced attrs" test: Ensure fields are set to distinct values
We had fields set to the same values before in our test data. This is
not a problem per-se, but does mean we wouldn't catch certain mixups.
Now, the fields are set to distinct values (where possible), which makes
the test more robust.
2025-04-15 12:29:14 -04:00
John Ericson
5f0ddd7467
Merge pull request #13028 from NixOS/mergify/bp/2.28-maintenance/pr-13022
Test derivation options with content-addressing too (backport #13022)
2025-04-15 12:11:55 -04:00
Eelco Dolstra
0c0dda3b29 Devirtualize double-copied paths
Borrowed from the original lazy-trees branch.
2025-04-15 17:44:56 +02:00
John Ericson
f19184191e Test derivation options with content-addressing too
Now, both the unit and functional tests relating to derivation options
are tested both ways -- with input addressing and content-addressing
derivations.

(cherry picked from commit 307dbe9914)
2025-04-15 11:25:07 -04:00
John Ericson
37bcd29e5f Use the same variable for content addressing in functional tests
`CONTENT_ADDRESSED` -> `NIX_TESTS_CA_BY_DEFAULT`

(cherry picked from commit 7acc229c8f)
2025-04-15 11:19:45 -04:00
Eelco Dolstra
5ecbf6b9dc
Merge pull request #13029 from NixOS/mergify/bp/2.28-maintenance/pr-13026
Fix issue #13018, `sourceInfo` strict in `outputs` (backport #13026)
2025-04-15 14:24:59 +02:00
Jörg Thalheim
f233a99cc8
Merge pull request #13027 from NixOS/mergify/bp/2.28-maintenance/pr-12603
libstore: curl retry: reset content-encoding and don't use string after move (backport #12603)
2025-04-15 14:00:13 +02:00
Robert Hensing
818fc68db6 fix: Evaluate flake parent source without evaluating its outputs
This requires that we refer to the `sourceInfo` instead of the
`result`. However, `sourceInfo` does not create a chain of basedir
resolution, so we add that back with `flakeDir`.

(cherry picked from commit 2109a5a206)
2025-04-15 11:52:46 +00:00
Robert Hensing
671364748c call-flake.nix: allNodes.${key} -> allNodes.${key}.result
(cherry picked from commit 9de9410f29)
2025-04-15 11:52:45 +00:00
Robert Hensing
9a969e29cf call-flake.nix: refactor: Bring mapAttrs into scope
(cherry picked from commit 674375b021)
2025-04-15 11:52:45 +00:00
Jörg Thalheim
99a16c5203
Merge pull request #13026 from roberth/issue-13018
Some checks are pending
CI / eval (push) Waiting to run
CI / tests ${{ matrix.scenario }} (darwin, macos-14, on macos) (push) Waiting to run
CI / tests ${{ matrix.scenario }} (linux, ubuntu-24.04, on ubuntu) (push) Waiting to run
CI / installer test ${{ matrix.scenario }} (darwin, macos-14, on macos) (push) Blocked by required conditions
CI / installer test ${{ matrix.scenario }} (linux, ubuntu-24.04, on ubuntu) (push) Blocked by required conditions
CI / Check Docker secrets present for installer tests (push) Waiting to run
CI / docker_push_image (push) Blocked by required conditions
CI / vm_tests (push) Waiting to run
CI / flake_regressions (push) Blocked by required conditions
Fix issue #13018, `sourceInfo` strict in `outputs`
2025-04-15 13:51:02 +02:00
Jörg Thalheim
22c928f9c0
Merge pull request #12992 from DeterminateSystems/input-cache
Rename FlakeCache to InputCache and move it to libfetchers
2025-04-15 13:32:39 +02:00
Jörg Thalheim
13a0853f04
Merge pull request #13024 from obsidiansystems/derivation-options-exportReferencesGraph
Move `exportReferencesGraph` to `DerivationOptions`
2025-04-15 13:28:00 +02:00
Jörg Thalheim
995d4f4aa7
Merge pull request #13022 from obsidiansystems/derivation-options
Test derivation options with content-addressing too
2025-04-15 13:27:09 +02:00
Robert Hensing
2109a5a206 fix: Evaluate flake parent source without evaluating its outputs
This requires that we refer to the `sourceInfo` instead of the
`result`. However, `sourceInfo` does not create a chain of basedir
resolution, so we add that back with `flakeDir`.
2025-04-15 13:22:53 +02:00
Robert Hensing
9de9410f29 call-flake.nix: allNodes.${key} -> allNodes.${key}.result 2025-04-15 13:22:53 +02:00
Robert Hensing
674375b021 call-flake.nix: refactor: Bring mapAttrs into scope 2025-04-15 13:22:53 +02:00
Philipp Otterbein
a603401cdd libstore: curl retry: reset content-encoding and don't use string after move
(cherry picked from commit b129fc8237)
2025-04-15 11:22:25 +00:00
John Ericson
d8be4f618f Scrap ParsedDerivation for parts
Only a much smaller `StructuredAttrs` remains, the rest is is now moved
to `DerivationOptions`.

This gets us quite close to `std::optional<StructuredAttrs>` and
`DerivationOptions` being included in `Derivation` as fields.
2025-04-14 16:14:41 -04:00
John Ericson
1e31b60043 Limit ParsedDerivation just to the derivation's environment
This moves us towards getting rid of `ParsedDerivation` and just having
`DerivationOptions`.

Co-Authored-By: HaeNoe <git@haenoe.party>
2025-04-14 15:46:55 -04:00
John Ericson
d285b80033 Move exportReferencesGraph to DerivationOptions
Tests are updated accordingly.
2025-04-14 14:24:36 -04:00
John Ericson
307dbe9914 Test derivation options with content-addressing too
Now, both the unit and functional tests relating to derivation options
are tested both ways -- with input addressing and content-addressing
derivations.
2025-04-14 13:43:46 -04:00
John Ericson
7acc229c8f Use the same variable for content addressing in functional tests
`CONTENT_ADDRESSED` -> `NIX_TESTS_CA_BY_DEFAULT`
2025-04-14 11:20:07 -04:00
Eelco Dolstra
3e895be4e4
Merge pull request #13021 from NixOS/mergify/bp/2.28-maintenance/pr-13019
Some checks are pending
CI / eval (push) Waiting to run
CI / tests ${{ matrix.scenario }} (darwin, macos-14, on macos) (push) Waiting to run
CI / tests ${{ matrix.scenario }} (linux, ubuntu-24.04, on ubuntu) (push) Waiting to run
CI / installer test ${{ matrix.scenario }} (darwin, macos-14, on macos) (push) Blocked by required conditions
CI / installer test ${{ matrix.scenario }} (linux, ubuntu-24.04, on ubuntu) (push) Blocked by required conditions
CI / Check Docker secrets present for installer tests (push) Waiting to run
CI / docker_push_image (push) Blocked by required conditions
CI / vm_tests (push) Waiting to run
CI / flake_regressions (push) Blocked by required conditions
Mention BLAKE3 in the Nix 2.27 release notes (backport #13019)
2025-04-14 16:13:07 +02:00
Eelco Dolstra
b1a1f4bd2f Mention BLAKE3 in the Nix 2.27 release notes
(cherry picked from commit c0ed07755a)
2025-04-14 13:47:57 +00:00
Eelco Dolstra
b3aa07009d
Merge pull request #13019 from NixOS/mention-blake3
Some checks are pending
CI / eval (push) Waiting to run
CI / tests ${{ matrix.scenario }} (darwin, macos-14, on macos) (push) Waiting to run
CI / tests ${{ matrix.scenario }} (linux, ubuntu-24.04, on ubuntu) (push) Waiting to run
CI / installer test ${{ matrix.scenario }} (darwin, macos-14, on macos) (push) Blocked by required conditions
CI / installer test ${{ matrix.scenario }} (linux, ubuntu-24.04, on ubuntu) (push) Blocked by required conditions
CI / Check Docker secrets present for installer tests (push) Waiting to run
CI / docker_push_image (push) Blocked by required conditions
CI / vm_tests (push) Waiting to run
CI / flake_regressions (push) Blocked by required conditions
Mention BLAKE3 in the Nix 2.27 release notes
2025-04-14 15:47:38 +02:00
Eelco Dolstra
c0ed07755a Mention BLAKE3 in the Nix 2.27 release notes 2025-04-14 15:18:29 +02:00
Eelco Dolstra
e099a5bc67 Move the InputCache to EvalState 2025-04-14 15:02:24 +02:00
Eelco Dolstra
4966217b6a Move the InputCache to EvalState 2025-04-14 14:29:14 +02:00
mergify[bot]
b1fe93fab7
Merge pull request #13015 from obsidiansystems/derivation-options
`ParsedDerivation`: don't take `drvPath`
2025-04-14 11:14:34 +00:00
Jörg Thalheim
f18180a045
Merge pull request #13011 from NixOS/mergify/bp/2.28-maintenance/pr-13009
Fix typo in string context docs (backport #13009)
2025-04-14 12:41:39 +02:00