1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 08:31:16 +02:00
Commit graph

12190 commits

Author SHA1 Message Date
Thomas Bereknyei
753f00c351 fix: add comment about longest-possible match 2025-02-13 12:47:09 -05:00
Thomas Bereknyei
269efa01b3 fix: ensure access-token matches are complete 2025-02-13 12:45:37 -05:00
Leandro Reina
b2d352e6a3 Add inputs.self.lfs 2025-02-13 17:59:27 +01:00
Robert Hensing
693a38ae2e
Merge pull request #10153 from b-camacho/lfs
git-lfs support
2025-02-13 14:25:30 +01:00
Thomas Bereknyei
a9f4d73d3e feat: test and document access-token prefix support 2025-02-13 07:10:51 -05:00
Thomas Bereknyei
69c7b42d28 feat: access tokens per repo 2025-02-13 06:07:43 -05:00
Robert Hensing
eb91014928
Merge pull request #12443 from DeterminateSystems/prefetch-out-link
nix flake prefetch: Add --out-link option
2025-02-12 22:22:04 +01:00
Eelco Dolstra
a902b84374 Formatting 2025-02-12 21:51:41 +01:00
John Ericson
0abc264f7d
Merge pull request #6346 from Ericson2314/impure-derivations-ng
Get rid of `impureOutputHash`; fix possible bug
2025-02-12 15:22:31 -05:00
Eelco Dolstra
5c552b62fc lockFlake(): When refetching a locked flake, use the locked ref
Otherwise we may accidentally update a lock when we shouldn't.

Fixes #12445.
2025-02-12 14:53:04 +01:00
Eelco Dolstra
ca7e686f4d
Merge pull request #12439 from MaxHearnden/cloexec
Set FD_CLOEXEC on sockets created by curl
2025-02-12 12:49:55 +01:00
John Ericson
50912d02e2 Get rid of impureOutputHash
I do not believe there is any problem with computing
`hashDerivationModulo` the normal way with impure derivations.

Conversely, the way this used to work is very suspicious because two
almost-equal derivations that only differ in depending on different
impure derivations could have the same drv hash modulo. That is very
suspicious because there is no reason to think those two different
impure derivations will end up producing the same content-addressed
data!

Co-authored-by: Alain Zscheile <zseri.devel@ytrizja.de>
2025-02-12 01:35:07 -05:00
Jörg Thalheim
23259bde1a
Merge pull request #12255 from NaN-git/fix-7359
SinkToSource: avoid heap allocation
2025-02-12 13:00:36 +07:00
Eelco Dolstra
26b87e78b5 copyPathToStore(): Preserve symlinks
E.g. in a derivation attribute `foo = ./bar`, if ./bar is a symlink,
we should copy the symlink to the store, not its target. This restores
the behaviour of Nix <= 2.19.
2025-02-11 20:58:48 +01:00
Sandro Jäckel
dcbf4dcc09
Only try to chmod /nix/var/nix/profiles/per-user when necessary
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2025-02-11 18:21:50 +01:00
Eelco Dolstra
254b7afe66 nix flake prefetch: Add --out-link option
This makes `nix flake prefetch` more useful for scripting and prevents
the result from being GC'ed prematurely.
2025-02-10 17:52:26 +01:00
Aiden Fox Ivey
55c1e4454e
Update src/libstore/unix/build/local-derivation-goal.cc
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2025-02-10 11:37:37 -05:00
Eelco Dolstra
528b286cf7 Remove stray line 2025-02-10 17:14:55 +01:00
Eelco Dolstra
4b75edacd7 Restore NAR hash assertion 2025-02-10 17:13:17 +01:00
Eelco Dolstra
b813a764e0 Merge remote-tracking branch 'origin/master' into self-input-attrs 2025-02-10 17:01:19 +01:00
John Ericson
1f485b6c5e
Merge pull request #12430 from DeterminateSystems/relative-path-literals
Parser: Respect the accessor of the source file for relative paths
2025-02-10 10:28:44 -05:00
Eelco Dolstra
428a3e8cc8 Add TODO 2025-02-10 16:18:57 +01:00
Eelco Dolstra
d4ecf15dad smudgeLfs: Use default value
Eventually this should probably become a struct of options.
2025-02-10 16:11:53 +01:00
Eelco Dolstra
d78daaa416 getLfsEndpointUrl(): Use our RAII helpers 2025-02-10 15:59:32 +01:00
Eelco Dolstra
c210efa9ae Move git-lfs-fetch into its own source file 2025-02-10 15:55:25 +01:00
Eelco Dolstra
9db070d7a2 Misc code cleanups 2025-02-10 15:46:46 +01:00
Eelco Dolstra
c10dbdccac libfetchers: Drop no longer needed curl dependency 2025-02-10 15:19:28 +01:00
Eelco Dolstra
40e8c5f613 Fix possible deref of null git_config 2025-02-10 15:16:54 +01:00
Eelco Dolstra
1cb9a354fb Merge remote-tracking branch 'origin/master' into lfs 2025-02-10 14:46:01 +01:00
John Ericson
cafefed421 Rename to "content-address*ing* derivation"
"content-address*ed*" derivation is misleading because all derivations
are *themselves* content-addressed. What may or may not be
content-addressed is not derivation itself, but the *output* of the
derivation.

The outputs are not *part* of the derivation (for then the derivation
wouldn't be complete before we built it) but rather separate entities
produced by the derivation.

"content-adddress*ed*" is not correctly because it can only describe
what the derivation *is*, and that is not what we are trying to do.

"content-address*ing*" is correct because it describes what the
derivation *does* --- it produces content-addressed data.
2025-02-10 01:12:56 -05:00
John Ericson
e80d333777
Document Store Derivations and Deriving Paths (#12290)
This is a big step documenting the store layer on its own, separately from the evaluator (and `builtins.derivation`).

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2025-02-10 01:30:07 +00:00
MaxHearnden
12d2527276 Set FD_CLOEXEC on sockets created by curl
Curl creates sockets without setting FD_CLOEXEC/SOCK_CLOEXEC, this can
cause connections to remain open forever when using commands like `nix
shell`

This change sets the FD_CLOEXEC flag using a CURLOPT_SOCKOPTFUNCTION
callback.
2025-02-09 21:09:33 +00:00
Eelco Dolstra
7096acc74d Parser: Respect the accessor of the source file for relative paths
Previously we only returned paths in rootFS, which is wrong and only
worked because currently all our source trees are in rootFS.
2025-02-06 16:33:43 +01:00
Eelco Dolstra
6e2fcb7e29 Parser: Respect the accessor of the source file for relative paths 2025-02-06 16:31:42 +01:00
silvanshade
1f56ea4c72
Add BLAKE3 hashing algorithm
This uses the single-threaded C-based routines from libblake3.

This is not optimal performance-wise but should be a good starting point
for nix compatibility with BLAKE3 hashing until a more performant
implementation based on the multi-threaded BLAKE3 routines
(written in Rust) can be developed.
2025-02-05 17:49:15 -07:00
John Ericson
c98525235f Revert "Revert "Adapt scheduler to work with dynamic derivations""
This fixes dynamic derivations, reverting #9081.

I believe that this time around, #9052 is fixed. When I first rebased
this, tests were failing (which wasn't the case before). The cause of
those test failures were due to the crude job in which the outer goal
tried to exit with the inner goal's status.

Now, that error handling has been reworked to be more faithful. The exit
exit status and exception of the inner goal is returned by the outer
goal. The exception was what was causing the test failures, but I
believe it was not having the right error code (there is more than one
for failure) that caused #9081.

The only cost of doing things the "right way" was that I had to
introduce a hacky `preserveException` boolean. I don't like this, but,
then again, none of us like anything about how the scheduler works.
Issue #11927 is still there to clean everything up, subsuming the need
for any `preserveException` because I doubt we will be fishing
information out of state machines like this at all.

This reverts commit 8440afbed7.

Co-Authored-By: Eelco Dolstra <edolstra@gmail.com>
2025-02-05 17:26:32 -05:00
John Ericson
a562d0b6ce
Merge pull request #12386 from DeterminateSystems/git-fixes
Git fetcher: Don't create refs when fetching by revision
2025-02-05 15:18:58 -05:00
Eelco Dolstra
25fcc8d1ab Add inputs.self.submodules flake attribute
This allows a flake to specify that it needs Git submodules to be
enabled (or disabled, if we ever change the default) on the top-level
flake. This requires the input to be refetched, but since the first
fetch is lazy, this shouldn't be expensive.

Currently the only attribute allowed by `inputs.self` is `submodules`,
but more can be added in the future (e.g. a `lazy` attribute to opt in
to lazy tree behaviour).

Fixes #5312, #9842.
2025-02-04 21:16:33 +01:00
Eelco Dolstra
01598487b7 Add FIXME 2025-02-04 16:41:10 +01:00
Eelco Dolstra
c74ad6b32b Remove FlakeRef::fetchTree() 2025-02-04 16:26:22 +01:00
Eelco Dolstra
1ab97a70f5 fetchOrSubstituteTree(): Return an accessor
This prepares lazy access to flake.nix etc.
2025-02-04 16:14:34 +01:00
John Ericson
b3b741973e Inline inputsRealised 2025-02-03 13:15:49 -05:00
John Ericson
4b1753e661 Move repairClosure
This is necessary in order to inline `inputsRealised` in the next
commit by combing it with its adjacent function (i.e. with a small
diff).
2025-02-03 13:14:13 -05:00
John Ericson
2297cc0dab Inline getDerivation and loadDerivation 2025-02-03 13:13:04 -05:00
John Ericson
57463ab910 Inline closureRepaired 2025-02-03 13:13:04 -05:00
John Ericson
41274f3c3e Inline outputsSubstitutionTried 2025-02-03 13:13:04 -05:00
John Ericson
53946fe017 Narrow scope on some local variables 2025-02-03 13:13:04 -05:00
Leandro Reina
134530a534 Merge remote-tracking branch 'upstream/master' into lfs 2025-02-03 19:07:20 +01:00
mergify[bot]
24d11d22c3
Merge pull request #12286 from stevalkr/flakes_symlink_path
Fix flakes follow symlinks
2025-02-02 03:11:20 +00:00
mergify[bot]
340eae1f23
Merge pull request #12385 from DeterminateSystems/fix-git-workdir-path-display
Fix duplicate setPathDisplay()
2025-02-02 02:10:38 +00:00