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

20067 commits

Author SHA1 Message Date
Leandro Reina
70ffcc83d7 Fix format 2024-11-20 18:24:17 +01:00
Eelco Dolstra
fd2df5f02f Rename nonFlakeDir -> scriptDir 2024-11-20 18:23:20 +01:00
Eelco Dolstra
5533b0c735 Move shebang flake tests into a separate test 2024-11-20 18:08:31 +01:00
Leandro Reina
79d41062d0 Fix some errors, and add tests for them 2024-11-20 17:53:06 +01:00
Eelco Dolstra
ad7ad017ea EvalState::callPathFilter(): Remove unnecessary pathArg argument 2024-11-20 16:35:47 +01:00
Jörg Thalheim
c13c6066b7
Merge pull request #11922 from picnoir/pic/catch-gc-exception
gc: resume GC after a pathinuse error
2024-11-20 16:31:20 +01:00
John Ericson
a7e1f2d5a3
Merge pull request #11912 from DeterminateSystems/apply-rewrites
BasicDerivation: Add applyRewrites() method
2024-11-20 10:12:01 -05: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
Picnoir
ced8d311a5 gc: resume GC after a pathinuse error
First the motivation: I recently faced a bug that I assume is coming
from the topoSortPaths function where the GC was trying to delete a
path having some alive referrers. I resolved this by manually deleting
the faulty path referrers using nix-store --query --referrers. I sadly
did not manage to reproduce this bug.

This bug alone is not a big deal. However, this bug is
triggering a cascading failure: invalidatePathChecked is throwing a
PathInUse exception. This exception is not catched and fails the whole GC
run. From there, the machine (a builder machine) was unable to GC its
Nix store, which led to an almost full disk with no way to
automatically delete the dead Nix paths.

Instead, I think we should log the error for the specific store path
we're trying to delete, specifying we can't delete this path because
it still has referrers. Once we're done with logging that, the GC run
should continue to delete the dead store paths it can delete.
2024-11-20 15:42:31 +01:00
Eelco Dolstra
df9ccdf31b BasicDerivation: Add applyRewrites() method
This is the first part of rewriteDerivation() factored out into its
own method. It's not used anywhere else at the moment, but it's useful
on lazy-trees for rewriting virtual paths.
2024-11-20 09:45:31 +01:00
Gavin John
4fca22b0dc Update issue and pull request templates 2024-11-19 11:52:45 -08: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
8637f3de78
Merge pull request #11910 from DeterminateSystems/flake-init
nix flake init: Operate on a SourcePath
2024-11-19 19:12:10 +01:00
Robert Hensing
e948c8e033 Bump fetcher cache version
We're getting more reports in https://github.com/NixOS/nix/issues/10985

It appears that something hasn't gone right process-wise.
I find this mistake not to be worth investigating, but rather something
to pay attention to going forward.

Let's nip this in the bud.

Closes https://github.com/NixOS/nix/issues/10985
2024-11-19 19:01:43 +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
370dfcbeba
Merge pull request #11911 from DeterminateSystems/trivial
Trivial changes from lazy-trees
2024-11-19 18:16:11 +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
Eelco Dolstra
868b4d37ea nix flake init: Operate on a SourcePath
Cherry-picked from lazy-trees.
2024-11-19 16:59:38 +01:00
Eelco Dolstra
850281908c Clean up flakeref parsing
This factors out some commonality in calling fromURL() and handling
the "dir" parameter into a fromParsedURL() helper function.
2024-11-19 16:50:13 +01:00
Jörg Thalheim
dd4838974e document shallow clone options in git fetchers 2024-11-19 13:24:11 +01:00
Valentin Gagarin
3b76d01f3b
Merge pull request #11907 from Mic92/pull-request
docs/flake: document how to build a pull request
2024-11-19 12:08:33 +01:00
Jörg Thalheim
e224a35a77 docs/flake: document how to build a pull request
It's not so common knowledge that forges also expose pull requests as
git refs. But it's actually a cool way of quickly testing someones
contribution, so I found it worth specifically mentioning it.
2024-11-19 11:25:33 +01:00
Robert Hensing
6b0aceedc5
Merge pull request #11902 from roberth/fix-issue-11892
Fix issue #11892
2024-11-18 22:20:01 +01:00
Robert Hensing
c4b95dbdd1 Fix issue 11892
It seems that I copied the expression for baseDir thoughtlessly and
did not come back to it.

- `baseDir` was only used in the `fromArgs` branch.
- `fromArgs` is true when `packages` is true.
2024-11-18 21:04:04 +01:00
Eelco Dolstra
0498e2259a
Merge pull request #11901 from DeterminateSystems/fix-nix-develop-test
tests/functional/flakes/develop.sh: Don't hang
2024-11-18 18:57:14 +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
d8a80e13b8
Merge pull request #11899 from NixOS/meson-print-errorlogs
Add --print-errorlogs to mesonCheckFlags
2024-11-18 16:32:11 +01:00
Eelco Dolstra
428af8c66f tests/functional/flakes/develop.sh: Don't hang
The bash shell started by `nix develop` waited forever for stdin
input.

Fixes #11827.
2024-11-18 16:28:12 +01:00
Robert Hensing
d65fac0fc4 Add --print-errorlogs to mesonCheckFlags
This prints the error logs in the tests, including when they're run
with `checkPhase` in the dev shell.
2024-11-18 15:08:32 +01:00
Robert Hensing
d8d59298e5
Merge pull request #9854 from the-sun-will-rise-tomorrow/docker-user
docker: Allow building for non-root user
2024-11-18 14:55:51 +01:00
Leandro Reina
b48dacd50c Add docs 2024-11-18 13:38:43 +01:00
Valentin Gagarin
4387c5ae80
Merge pull request #11894 from myclevorname/nixfmt
doc/nix fmt: Mention nixfmt-rfc-style instead of nixfmt(-classic)
2024-11-18 09:06:08 +01:00
Brian Camacho
f67b63fa3a remove debug prints 2024-11-18 01:21:14 -05:00
Brian Camacho
b548e5c4c5 typo 2024-11-18 01:15:02 -05:00
John Ericson
68e15beedd
Merge pull request #11844 from roberth/papercut-nix-log
Make nix log command easy to copy
2024-11-17 19:06:16 -05:00
myclevorname
3f6855c31b
doc/nix fmt: Mention nixfmt-rfc-style instead of nixfmt(-classic) 2024-11-17 14:12:27 -05:00
Brian Camacho
6d0043902a Merge remote-tracking branch 'origin/master' into lfs 2024-11-17 12:16:15 -05:00
Brian Camacho
7bbc7305e8 typo 2024-11-17 02:48:14 -05:00
Brian Camacho
976941bd2f typo 2024-11-17 02:42:07 -05:00
Brian Camacho
3252ca0fdc unit tests 2024-11-17 02:40:15 -05:00
Brian Camacho
24453b79eb pass path.rel instead of path.abs to gitattr matcher 2024-11-17 02:39:47 -05:00
Brian Camacho
0878e8ff44 use libgit2 pathspec matching instead of reimpl 2024-11-17 02:37:55 -05:00
Eelco Dolstra
b4790366a0
Merge pull request #11884 from DeterminateSystems/nix-path-info-cout
nix path-info: Don't write to std::cout directly
2024-11-15 15:07:24 +01:00
Robert Hensing
c9433c0d18 .github/ci: Push docker only when test succeeds 2024-11-15 12:05:41 +01:00
Robert Hensing
2f3764acbb .github/ci: Add nix-docker test
We still have room to spare in vm_tests, as it's quicker than `nix flake check`
2024-11-15 12:05:41 +01:00
Eelco Dolstra
3e4a83f53b Use range-based for 2024-11-14 16:12:14 +01:00