Commit graph

11086 commits

Author SHA1 Message Date
Eelco Dolstra
30aa45a373 Formatting 2024-09-11 20:35:04 +02:00
Eelco Dolstra
aa41de7d82 Merge remote-tracking branch 'origin/master' into no-flake-substitution 2024-09-11 17:10:55 +02:00
Eelco Dolstra
9a7c0d8933
Merge pull request #11473 from Artturin/keepfailedreadable
Fix making the build directory kept by `keep-failed` readable
2024-09-11 14:52:50 +02:00
Eelco Dolstra
894da59186
Merge pull request #11447 from DeterminateSystems/nix-flake-metadata-chroot-store
nix flake {metadata,archive}: Fix chroot stores
2024-09-11 14:51:56 +02:00
Noam Yorav-Raphael
38bfbb297c
Use envvars NIX_CACHE_HOME, NIX_CONFIG_HOME, NIX_DATA_HOME, NIX_STATE_HOME if defined (#11351) 2024-09-11 10:36:46 +00:00
tomberek
c60e1be62c
Merge pull request #11438 from zimbatm/nix-fmt-pwd
fix(nix fmt): remove the default "." argument
2024-09-10 23:44:16 -04:00
Artturin
ebebe626ff Fix making the build directory kept by keep-failed readable
Caused by 1d3696f0fb

Without this fix the kept build directory is readable only by root

```
$ sudo ls -ld /comp-temp/nix-build-openssh-static-x86_64-unknown-linux-musl-9.8p1.drv-5
drwx------ root root 60 B Wed Sep 11 00:09:48 2024  /comp-temp/nix-build-openssh-static-x86_64-unknown-linux-musl-9.8p1.drv-5/

$ sudo ls -ld /comp-temp/nix-build-openssh-static-x86_64-unknown-linux-musl-9.8p1.drv-5/build
drwxr-xr-x nixbld1 nixbld 80 B Wed Sep 11 00:09:58 2024  /comp-temp/nix-build-openssh-static-x86_64-unknown-linux-musl-9.8p1.drv-5/build/
```
2024-09-11 00:23:14 +03:00
zimbatm
c4766d7b8b fix(nix fmt): remove the default "." argument
When `nix fmt` is called without an argument, Nix appends the "." argument before calling the formatter. The comment in the code is:
> Format the current flake out of the box

This also happens when formatting sub-folders.

This means that the formatter is now unable to distinguish, as an interface, whether the "." argument is coming from the flake or the user's intent to format the current folder. This decision should be up to the formatter.

Treefmt, for example, will automatically look up the project's root and format all the files. This is the desired behaviour. But because the "." argument is passed, it cannot function as expected.
2024-09-10 22:18:56 +02:00
Jörg Thalheim
1ca1439b1f add missing filesystem include (x86_64-darwin fix) 2024-09-10 16:45:39 +02:00
Eelco Dolstra
9c0e968843
Merge commit from fork
Fix unsafe NAR unpacking
2024-09-10 12:42:55 +02:00
Eelco Dolstra
c5a4dfa660 nix flake {metadata,archive}: Fix chroot stores
Fixes

  $ nix flake metadata --store /tmp/nix nixpkgs
  error: path '/tmp/nix/nix/store/65xpqkz92d9j7k5ric4z8lzhiigxsfbg-source/flake.nix' is not in the Nix store

This has been broken since 598deb2b23.
2024-09-09 15:41:38 +02:00
Eelco Dolstra
5ca2f58798 Improve use-case-hack description slightly 2024-09-09 14:29:05 +02:00
Eelco Dolstra
4c7a6ffee7
Merge pull request #11380 from roberth/eco-friendly-progress-bar
progress-bar: Only write when truly updated
2024-09-09 13:58:42 +02:00
Eelco Dolstra
5e337ee60d
Merge pull request #11412 from parkerhoyes/daemon-cgroup
Move daemon process into sub-cgroup
2024-09-09 13:49:31 +02:00
Robert Hensing
c955563b64 fix: Avoid deadlock in ProgressBar::redraw() 2024-09-08 11:44:24 +02:00
Robert Hensing
e10ea78f93 refact: Inline ProgressBar::draw(state, newOutput), inline local output 2024-09-08 01:23:01 +02:00
Robert Hensing
047d9643b5 refact: Extract ProgressBar::redraw(newOutput) 2024-09-08 01:23:01 +02:00
Robert Hensing
9df5236c46 progress-bar: Only write when truly updated 2024-09-08 01:04:14 +02:00
Robert Hensing
791f943761
Merge pull request #11437 from fricklerhandwerk/default-nix-path-docs
docs: explain provenance of default `nix-path` values
2024-09-07 22:38:50 +01:00
Eelco Dolstra
9fcb588dd8 RestoreSink::createDirectory(): Use append()
On macOS, `mkdir("x/')` behaves differently than `mkdir("x")` if `x` is
a dangling symlink (the formed succeed while the latter fails). So make
sure we always strip the trailing slash.
2024-09-05 22:21:53 +02:00
Eelco Dolstra
3557587381 Detect NAR directory entries that collide with another path after case-hacking
The test was made by @puckipedia.
2024-09-05 19:26:10 +02:00
Eelco Dolstra
da1ad28912 Test that nix-store --restore fails if the output already exists
This restores the behaviour from before the std::filesystem
refactorings.
2024-09-05 16:48:43 +02:00
Jörg Thalheim
5a5a010120 Revert "fix: Error on malformed URI query parameter"
This reverts commit c9f45677b5.

This now triggers on simple cases like `nix build .#nix`.
Reverting for now.
2024-09-05 15:18:16 +02:00
Jörg Thalheim
a81083d080 Revert "Update src/libutil/url.cc"
This reverts commit 9b1cefe27e.
2024-09-05 15:18:16 +02:00
Valentin Gagarin
17655ecfef docs: explain provenance of default nix-path values
this should make it more obvious how things are related to each other, and also
hopefully expose the historical context without having to say on every
corner that these details are accounting for legacy decisions.
2024-09-05 04:35:06 +02:00
Eelco Dolstra
495d32e1b8 NAR parser: Fix check for duplicate / incorrectly sorted entries
"prevName" was always empty because it was declared in the wrong scope.
2024-09-04 21:43:59 +02:00
Parker Hoyes
bd6ae2f3b9 Use getCurrentCgroup() in getMaxCPU() 2024-09-04 19:10:31 +00:00
Parker Hoyes
03484641a1 Simplify getRootCgroup()
Static local initializers are atomic in C++.
2024-09-04 18:11:16 +00:00
Jeremy Kolb
8152c5c828
Remote nullptr
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2024-09-04 12:55:32 -04:00
Jeremy Kolb
46f6505865 Pull fut.get() out of the lock
This is https://gerrit.lix.systems/c/lix/+/1462 by @jade_

see: https://git.lix.systems/lix-project/lix/issues/366
see: https://gerrit.lix.systems/c/lix/+/1462
2024-09-04 10:14:51 -04:00
Parker Hoyes
46b3188045 Move daemon process into sub-cgroup
The daemon process is now moved into a new sub-cgroup called nix-daemon when the
daemon starts. This is necessary to abide by the no-processes-in-inner-nodes
rule, because the service cgroup becomes an inner node when the child cgroups
for the build are created (see LocalDerivationGoal::startBuilder()).

See #9675
2024-09-03 17:18:01 +00:00
Eelco Dolstra
784a8436a0
Merge pull request #11402 from DeterminateSystems/fix-max-substitution-jobs
Respect max-substitution-jobs again
2024-09-03 13:35:34 +02:00
Sandro
13100eaa4f
Fix link anchor 2024-09-02 23:25:44 +02:00
Eelco Dolstra
b7acd1c414 "unsigned" -> size_t
Slight cleanup.
2024-09-02 17:28:55 +02:00
Eelco Dolstra
a33cb8af56 Respect max-substitution-jobs again
This broke in #11005. Any number of PathSubstitutionGoals would
be woken up by a single build slot becoming available. If there
are a lot of substitution goals active, this could lead to us
running out of file descriptors (especially on macOS where the
default limit is 256).
2024-09-02 17:28:11 +02:00
Alyssa Ross
9cc550d652
Don't refer to public keys as secret keys in error
This constructor is used for public keys as well.
2024-08-31 16:00:11 +02:00
Robert Hensing
b89eca9aec
Merge pull request #11349 from bryanhonof/bryanhonof.check-query-for-equals
Warn on malformed URI query parameter
2024-08-28 21:56:00 +02:00
Bryan Honof
9b1cefe27e
Update src/libutil/url.cc
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2024-08-28 18:48:18 +02:00
Jan Hrcek
cb4b9be458
Fix few duplicate word occurrences (#11381) 2024-08-28 07:01:56 +00:00
John Ericson
c7ec33605e Meson misc things
Meson-ify a few things, scripts, completions, etc. Should make our Meson
build complete except for docs.

Co-Authored-By: Qyriad <qyriad@qyriad.me>
Co-Authored-By: eldritch horrors <pennae@lix.systems>
2024-08-27 10:19:55 -04:00
John Ericson
8bce63f30a More std::filesystem for nix-collect-garbage
Co-Authored-By: siddhantCodes <siddhantk232@gmail.com>
2024-08-26 17:29:23 -04:00
John Ericson
a97a08411c More support for std::filepath in libnixutil
We're not replacing `Path` in exposed definitions in many cases, but
just adding alternatives. This will allow us to "top down" change `Path`
to `std::fileysystem::path`, and then we can remove the `Path`-using
utilities which will become unused.

Also add some test files which we forgot to include in the libutil unit
tests `meson.build`.

Co-Authored-By: siddhantCodes <siddhantk232@gmail.com>
2024-08-26 17:23:56 -04:00
John Ericson
dbabfc92d4 Make sure we have an execvpe on Windows too
Necessary to fix a build (that was already broken in other ways) after
PR #11021.
2024-08-26 15:45:55 -04:00
Robert Hensing
88998fae74
Merge pull request #11304 from hercules-ci/repl-doc-functor
`:doc`: support `__functor`
2024-08-26 17:20:37 +02:00
tomberek
96a2ddab27
Merge pull request #10910 from hercules-ci/c-api-nix_clear_err
C API: `nix_clear_err`
2024-08-26 10:50:26 -04:00
tomberek
440de80d34
Merge pull request #11021 from hercules-ci/issue-11010
Fix SSH invocation when local SHELL misbehaves
2024-08-26 10:40:51 -04:00
Robert Hensing
77ddcbe12e
getDoc: Explain why we partially apply __functor 2024-08-26 16:15:13 +02:00
Robert Hensing
8bd835b7bc
Merge pull request #11278 from Mic92/close-fds
libutil: rename and optimize closeMostFDs
2024-08-26 15:51:34 +02:00
Jörg Thalheim
096bec8eb2 Revert "Merge pull request #11300 from noamraph/homeless-shelter-to-proc"
This reverts commit 43e82c9446, reversing
changes made to d79b9bdec0.

Since /proc/homeless-shelter returns a different errno than /homeless-shelter (ENOENT vs EACCES), we need to revert this change.
Software depends on this error code i.e. cargo and therefore breaks.
2024-08-25 09:08:17 +02:00
Bryan Honof
c9f45677b5
fix: Error on malformed URI query parameter
Signed-off-by: Bryan Honof <bryanhonof@gmail.com>
2024-08-23 22:04:37 +02:00