Commit Graph
3216 Commits
Author SHA1 Message Date
Sergei Zimmerman af2ddfdb3b libexpr: Fix use-after-free of StaticEnv::up
It's not very clear what the ownership model is here, but one thing
is certain: `.up` can't be destroyed before the StaticEnv that refers
to it is.

Changing a non-owning pointer to taking shared ownership of the parent
`StaticEnv` prevents the `.up` from being freed.

I'm not a huge fan of the inverted ownership, where child `StaticEnv`
takes a refcount of the parent, but this seems like the least intrusive
way to fix the use-after-free.

This shouldn't cause any shared_ptr cycles to appear (hopefully).
2025-02-21 14:36:39 +00:00
John Ericson de22f58dfc Introduce EvalStore::storePath
This abstracts over a common case. Good for brevity, and enabling
further experiments.
2025-02-19 21:24:26 -05:00
Eelco Dolstra ec7dc56f4e Remove unused variable 2025-02-20 01:09:18 +01:00
Eelco Dolstra 8dc2b2715b In pure eval mode, restrict rootFS to just the Nix store
Note that in pure mode, we don't need to use the union FS even when
using a chroot store, since the user shouldn't have access to the
physical /nix/store.
2025-02-19 23:13:11 +01:00
Eelco Dolstra 584ddd1b4d UnionSourceAccessor: Don't filter out underlying files of the wrong type
https://github.com/NixOS/nix/pull/12512#discussion_r1961567140
2025-02-19 13:34:42 +01:00
Eelco Dolstra 99e78c37f7 Use UnionSourceAccessor to mount the chroot store on top of the real store directory 2025-02-19 12:54:09 +01:00
Eelco Dolstra 774b924398 Add a storeFS accessor for paths resulting from IFD
Hopefully fixes #11503.
2025-02-19 12:47:28 +01:00
Eelco Dolstra e5e0ce2334 Remove redundant call to canonPath()
The CanonPath constructor already does that.
2025-02-19 12:47:28 +01:00
Robert Hensing 3556f6bf4c Write just ./.version on all components
This way it's easier to get right. See previous commit.
2025-02-18 11:41:35 +01:00
Robert Hensing c5fcb1bd50 Fix a few warnings 2025-02-17 19:29:01 +01:00
Eelco Dolstra df08e1e204 resolveLookupPathPath(): Fix caching of negative lookups
This avoids spamming in case the missing search path entry does not
exist (#12480).
2025-02-17 11:50:54 +01:00
Eelco Dolstra 8ac49ea5de getDefaultNixPath(): Don't add symlinks if the target doesn't exist 2025-02-17 11:36:47 +01:00
Robert Hensing 693a38ae2e Merge pull request #10153 from b-camacho/lfs
git-lfs support
2025-02-13 14:25:30 +01: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
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 1cb9a354fb Merge remote-tracking branch 'origin/master' into lfs 2025-02-10 14:46:01 +01:00
John EricsonandRobert Hensing 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
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
Leandro Reina 134530a534 Merge remote-tracking branch 'upstream/master' into lfs 2025-02-03 19:07:20 +01:00
mergify[bot] b842103307 Merge pull request #12376 from DeterminateSystems/fetch-using-nar-hash
Allow fetching using NAR hash without --allow-dirty-locks
2025-02-02 02:10:35 +00:00
mergify[bot] d5c00cfab1 Merge pull request #12387 from nix-windows/big-objs
Add mbig-obj flag to allow cross-compiling libexpr to mingw32
2025-02-02 01:32:15 +00:00
Eelco Dolstra 9e240ecced Remove isConsideredLocked() 2025-01-31 17:03:27 +01:00
Eelco Dolstra 5dec1dc086 fetchGit/fetchTree: Allow fetching using only a NAR hash
Fixes #12027.
2025-01-31 17:03:27 +01:00
Eelco Dolstra 5f6658b9c9 fetchTree: Distinguish between fetchGit and fetchTree consistently 2025-01-31 15:10:29 +01:00
Brian McKenna 26539a087f Add mbig-obj flag to allow cross-compiling libexpr to mingw32 2025-01-31 22:53:42 +11:00
Leandro Reina 6a3b4afc0a Merge remote-tracking branch 'upstream/master' into lfs 2025-01-27 14:44:41 +01:00
Robert Hensing 7465fbe926 refactor: Extract EvalState::realiseString 2025-01-27 12:32:46 +01:00
Robert Hensing 96e550efc5 Format .nix files
... with nixfmt (rfc style)
2025-01-24 17:04:02 +01:00
Eelco Dolstra 00d9e7e1f4 EvalState::resolveLookupPathPath(): Call resolveSymlinks() before pathExists()
Fixes #12339.
2025-01-24 12:15:07 +01:00
Eelco Dolstra 7dfff58292 Rename InputPath -> InputAttrPath
Fixes #12098.
2025-01-23 16:34:35 +01:00
Leandro Reina 40a3007b7c Merge remote-tracking branch 'upstream/master' into lfs 2025-01-21 14:16:42 +01:00
Eelco Dolstra 043df13f72 Merge pull request #10089 from edolstra/relative-flakes
Improve support for relative path inputs
2025-01-16 14:21:27 +01:00
Eelco Dolstra 550fe889ee Merge remote-tracking branch 'origin/master' into relative-flakes 2025-01-16 11:05:10 +01:00
John Ericson 0c101679b4 Merge pull request #12261 from NixOS/packaging
Packaging cleanups, add RossComputerGuy as `-llvm` maintainer
2025-01-15 17:25:15 -05:00
John Ericson e02026adae Merge pull request #12254 from DeterminateSystems/fix-relative-path-on-cli
Fix relative 'path:' flakerefs in the CLI
2025-01-15 15:19:56 -05:00
mergify[bot] c45dfeeef3 Merge pull request #12220 from DeterminateSystems/allow-dirty-locks
Add setting 'allow-dirty-locks'
2025-01-15 20:18:28 +00:00
Robert Hensing cab347b4eb refactor: Move ld=gold rule to mesonBuildLayer 2025-01-15 20:01:00 +01:00
Eelco Dolstra ff9d886f3c Use isAbsolute() 2025-01-14 17:42:26 +01:00
Eelco Dolstra cd0127f957 Merge remote-tracking branch 'origin/master' into relative-flakes 2025-01-13 14:13:56 +01:00
Tristan Ross 47cf93ba80 Add LLVM to Flake 2025-01-10 18:08:27 -08:00
Leandro Reina b08b7bee4e Merge remote-tracking branch 'upstream/master' into lfs 2025-01-10 18:33:03 +01:00
Eelco Dolstra e161393299 Add setting 'allow-dirty-locks'
This allows writing lock files with dirty inputs, so long as they have
a NAR hash. (Currently they always have a NAR hash, but with lazy
trees that may not always be the case.)

Generally dirty locks are bad for reproducibility (we can detect if
the dirty input has changed, but we have no way to fetch it except
substitution). Hence we don't allow them by default.

Fixes #11181.
2025-01-10 17:55:30 +01:00
Philipp Otterbein a44e9dd1ea correctly parse strings with null bytes and throw error 2025-01-04 16:14:06 +01:00
Connor Baker 359a0840e2 packaging: use optimization level 3 and LTO by default 2025-01-01 21:59:37 -08:00
Philipp Otterbein 4a2310a3a0 toJSON: re-throw serialization exception 2024-12-31 20:33:28 +01:00
Philipp Otterbein 1e2cace5f1 fix documentation of substring 2024-12-28 23:40:25 +01:00
Parker Jones cf69c99f3e Make readFileType doc string consistent
The primitive `readFileType p` has a list of acceptable types, and so does `readDir path`

This edit makes the formatting of the list consistent between themselves, and other parts of the documentation.
2024-12-27 01:11:36 -05:00
Eelco Dolstra 8534c4222c Merge remote-tracking branch 'origin/master' into relative-flakes 2024-12-18 21:09:27 +01:00
Leandro Reina 7756b2286d Merge remote-tracking branch 'upstream/master' into lfs 2024-12-18 18:18:45 +01:00
mergify[bot] 3f3feae33e Merge pull request #12071 from Mic92/clang-tidy
Prepare nix to run with clang-tidy
2024-12-17 21:53:35 +00:00