Commit Graph
3185 Commits
Author SHA1 Message Date
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
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
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
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
Jörg Thalheim eda331e53f libutil/windows: only define headers/code if we are actually on windows
all those includes otherwise break linters.
2024-12-17 22:00:34 +01:00
Jörg Thalheim b338140931 fix missing includes in various headers 2024-12-17 22:00:34 +01:00
Eelco Dolstra 08361f031d EvalState::realiseContext(): Allow access to the entire closure
Fixes #11030.
2024-12-16 16:16:36 +01:00
Jörg Thalheim d8117c8c0d libexpr: always initialize displacement
Otherwise the value is undefined in some cases.
2024-12-16 12:06:41 +01:00
mergify[bot] 44bc4c6365 Merge pull request #12023 from mightyiam/head-called-on-empty-list
Improve `builtins.{head,elemAt}` error messages
2024-12-14 15:46:28 +00:00
Eelco Dolstra 50ba85167c Merge pull request #12024 from NaN-git/null-char
fromJSON/fromTOML: throw if string contains null byte
2024-12-10 12:29:48 +01:00
Philipp Otterbein 3a9d64b8e3 fromJSON/fromTOML: throw if string contains null byte 2024-12-09 22:04:21 +01:00
Robert Hensing d0b4db924a rename: build-utils-meson -> nix-meson-build-support
Fix a footgun. In my case, I had a couple of build ("output")
directories sitting around.

    rm -rf build-*

Was confused for a bit why a meson.build file was missing.

Probably also helps with autocompletion.

I tried meson-build-support first, but I had to add something like
a nix- prefix, in order to make meson happy. They've reserved the
meson- prefix.
2024-12-09 16:54:42 +01:00
Eelco Dolstra 8490fba42d Improve error messages for head/elemAt 2024-12-09 16:15:23 +01:00
‮rekcäH nitraM‮ 49fa31fb4c Fix typo (#12015) 2024-12-05 19:10:59 +00:00
Ryan Hendrickson 8034589d7e parser-state: fix attribute merging 2024-11-27 21:41:47 +01:00
Sergei Zimmerman fafaec5ac3 fix(treewide): remove unnecessary copying in range for loops
This gets rid of unnecessary copies in range-based-for loops and
local variables, when they are used solely as `const &`.

Also added a fixme comment about a suspicious move out of const,
which might not be intended.
2024-11-26 00:06:29 +03:00
Sergei Zimmerman 756758d968 chore: get rid of dead code and unused variables where appropriate
Looks like some cruft has been left over from previous refactorings.
This removes dead variables, which should not have side effects in their
constructors. In cases where the variable initialization has a purpose
[[maybe_unused]] is inserted to silence compiler warnings.
2024-11-22 18:05:53 +03:00
Eelco Dolstra 0b00bf7c09 Merge remote-tracking branch 'origin/master' into relative-flakes 2024-11-22 14:44:32 +01:00
Jörg Thalheim 838d3c1ad0 Merge pull request #11933 from DeterminateSystems/no-narHash
fetchTree: Don't crash if narHash is missing
2024-11-22 08:07:50 +01:00
Eelco Dolstra 965ca18db8 Merge build-utils-meson/{diagnostics,threads} into build-utils-meson/common
This reduces the amount of boilerplate. More importantly, it provides
a place to add compiler flags (such as -O3) without having to add it
to every subproject (and the risk of forgetting to include it).
2024-11-21 20:34:54 +01:00
Eelco Dolstra f4f4b698f6 fetchTree: Don't crash if narHash is missing
Fixes

  nix: ../src/libexpr/primops/fetchTree.cc:37: void nix::emitTreeAttrs(EvalState&, const StorePath&, const fetchers::Input&, Value&, bool, bool): Assertion `narHash' failed.

on a lock file with an input that doesn't have a narHash. This can
happen when using a lock file created by the lazy-trees branch.

Cherry-picked from lazy-trees.
2024-11-21 16:53:34 +01:00
Jörg Thalheim 5256aa0f45 Merge pull request #11881 from xokdvium/dev/get-rid-of-nullptr-references-in-eval
fix(libexpr/eval-inline): get rid of references to nullptr env
2024-11-20 19:36:57 +01:00
Eelco Dolstra ad7ad017ea EvalState::callPathFilter(): Remove unnecessary pathArg argument 2024-11-20 16:35:47 +01:00
Sergei Zimmerman 1800853b2a fix(libexpr/eval-inline): get rid of references to nullptr env
When diagnosing infinite recursion references to nullptr `Env` can be formed.
This happens only with `ExprBlackHole` is evaluated, which always leads to
`InfiniteRecursionError`.

UBSAN log for one such case:

```
../src/libexpr/eval-inline.hh:94:31: runtime error: reference binding to null pointer of type 'Env'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/libexpr/eval-inline.hh:94:31 in
```
2024-11-20 17:54:58 +03:00
Robert Hensing 32becc87fe Merge pull request #11914 from roberth/evalstate-get-builtins
EvalState::getBuiltins
2024-11-19 19:33:37 +01:00
Robert Hensing ce6b5de78c Merge pull request #11913 from DeterminateSystems/source-path-in-lookup-path
resolveLookupPathPath(): Return a SourcePath instead of a string
2024-11-19 19:23:29 +01:00
Robert Hensing 5c258d7e25 refactor: Use EvalState::getBuiltins() 2024-11-19 18:45:53 +01:00
Robert Hensing 8a36d2d8a7 Add EvalState::getBuiltins 2024-11-19 18:23:05 +01:00
Eelco Dolstra af07f33d37 resolveLookupPathPath(): Return a SourcePath instead of a string
Cherry-picked from lazy-trees.
2024-11-19 18:03:31 +01:00
Robert Hensing a58e38dab7 Make EvalState::getBuiltin safe for missing attr 2024-11-19 17:30:58 +01:00
Eelco Dolstra f1b4f14055 Trivial changes from lazy-trees 2024-11-19 17:30:38 +01:00
Robert Hensing 61d075840f Merge pull request #11866 from DeterminateSystems/callFunction-span
callFunction: Use std::span
2024-11-18 18:37:12 +01:00
Eelco Dolstra 3e4a83f53b Use range-based for 2024-11-14 16:12:14 +01:00