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

18388 commits

Author SHA1 Message Date
mergify[bot]
daf526f19d
Merge pull request #12188 from NixOS/mergify/bp/2.24-maintenance/pr-11853
fix(libmain/common-args): do not exceed maximum allowed verbosity (backport #11853)
2025-01-10 19:34:54 +00:00
mergify[bot]
d6217bc691
Merge pull request #12187 from NixOS/mergify/bp/2.24-maintenance/pr-11981
docker: Fix command "nix profile install", Don't require --impure (fix for 2.25) (backport #11981)
2025-01-10 19:34:51 +00:00
mergify[bot]
22c24a87a1
Merge pull request #12176 from NixOS/mergify/bp/2.24-maintenance/pr-12114
fix documentation of substring (backport #12114)
2025-01-10 17:21:50 +00:00
Eelco Dolstra
f2bb7e043b
Merge pull request #12185 from NixOS/mergify/bp/2.24-maintenance/pr-12016
Disable suid and atime on the /nix mount point on Darwin (backport #12016)
2025-01-10 15:16:44 +01:00
Eelco Dolstra
9a7196ce62
Merge pull request #12180 from NixOS/mergify/bp/2.24-maintenance/pr-12091
libstore: fixup unformatted uri when S3 getObject fails (backport #12091)
2025-01-10 15:11:08 +01:00
Eelco Dolstra
7a2b1cbd71
Merge pull request #12173 from NixOS/mergify/bp/2.24-maintenance/pr-12127
toJSON: re-throw serialization exception (backport #12127)
2025-01-10 13:32:42 +01:00
mergify[bot]
534473e90b
Merge pull request #12170 from NixOS/mergify/bp/2.24-maintenance/pr-12155
Document `--max-freed` for `nix-collect-garbage` (backport #12155)
2025-01-10 11:05:01 +00:00
0x5a4
ce5c0c64af fix: bash mangles flake ref completion
(cherry picked from commit 088fa815d3)
2025-01-10 10:42:07 +00:00
Eelco Dolstra
931eb85f50 Add FIXME
(cherry picked from commit fac756fed4)
2025-01-10 10:36:06 +00:00
Eelco Dolstra
a9020404cf select() -> poll() for Windows compat
(cherry picked from commit 270c8469d7)
2025-01-10 10:36:06 +00:00
Eelco Dolstra
77a71c518f Update src/libutil/serialise.hh
Co-authored-by: John Ericson <git@JohnEricson.me>
(cherry picked from commit ce7cf4a2d3)
2025-01-10 10:36:06 +00:00
Eelco Dolstra
36f3fb72e9 withFramedSink(): Don't use a thread to monitor the other side
Since withFramedSink() is now used a lot more than in the past (for
every addToStore() variant), we were creating a lot of threads, e.g.

  nix flake show --no-eval-cache --all-systems github:NixOS/nix/afdd12be5e19c0001ff3297dea544301108d298

would create 46418 threads. While threads on Linux are cheap, this is
still substantial overhead.

So instead, just poll from FramedSink before every write whether there
are pending messages from the daemon. This could slightly increase the
latency on log messages from the daemon, but not on exceptions (which
were only synchronously checked from FramedSink anyway).

This speeds up the command above from 19.2s to 17.5s on my machine (a
9% speedup).

(cherry picked from commit 39daa4a0d3)
2025-01-10 10:36:05 +00:00
Jan Hrcek
5099768970 Fix few duplicate word occurrences (#11381)
(cherry picked from commit cb4b9be458)
2025-01-10 10:29:59 +00:00
Jeremy Kerfs
6f5684f6d1 add removal of ~root/.cache/nix to uninstall instructions (#11407)
(cherry picked from commit 4decd6f8b3)
2025-01-10 10:29:55 +00:00
Seggy Umboh
d6488efeae Fix diskutil deleteVolume command in Uninstall guide (#11371)
Co-authored-by: Valentin Gagarin <valentin@gagarin.work>
(cherry picked from commit 8e63dc4455)
2025-01-10 10:28:54 +00:00
Jeremy Kolb
bc8611a29b Remote nullptr
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
(cherry picked from commit 8152c5c828)
2025-01-10 10:26:53 +00:00
Jeremy Kolb
1a21eb43af 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
(cherry picked from commit 46f6505865)
2025-01-10 10:26:53 +00:00
Eelco Dolstra
bcf34e89c0 nix derivation add: Remove reference to "installable"
It doesn't operate on an installable, so don't mention it.

(cherry picked from commit 65f138f669)
2025-01-10 10:23:49 +00:00
Jordan Justen
0060a4ba5b doc, src: Fix various spelling typos
Signed-off-by: Jordan Justen <jljusten@gmail.com>
(cherry picked from commit 3b6cf350e7)
2025-01-10 10:22:51 +00:00
Robert Hensing
24e63b14e5 doc/nix fmt: Do not document behavior we do not control
This leads to confusion about what the command does.
E.g. https://github.com/NixOS/nix/issues/9359

- Move the description up

- Remove details about the individual formatters

(cherry picked from commit 8c4842de8c)
2025-01-10 10:22:50 +00:00
quatquatt
93e8e5b347 docs: Provide an example of updating multiple inputs with nix flake update
docs: Provide an example of updating multiple inputs with `nix flake update`
(cherry picked from commit 9e335ee3b9)
2025-01-10 10:22:45 +00:00
Jörg Thalheim
792099081c add description + example for nix flake archive
Update src/nix/flake-archive.md

Update src/nix/flake-archive.md

(cherry picked from commit f0a4f19087)
2025-01-10 10:21:45 +00:00
Noam Yorav-Raphael
971748ace9 nix-profile.sh.in: fix envvar condition
(cherry picked from commit 97fffd8765)

# Conflicts:
#	scripts/nix-profile.sh.in
2025-01-10 10:20:46 +00:00
Kevin Cox
0e421e7a35 Improve documentation of nix flake lock
The previous documentation was inaccurate, stating that it would not update existing inputs. However these inputs will be updated if they are outdated (for example the version of an existing input has been changed). The new text properly reflects this behaviour.

(cherry picked from commit d2f627dda9)
2025-01-10 10:18:03 +00:00
Robert Hensing
9ee4a85a99 doc/manual: Fix some broken fragments
(cherry picked from commit 071ddbed57)

# Conflicts:
#	doc/manual/src/language/operators.md
2025-01-10 10:17:08 +00:00
Geoffrey Thomas
24542a7b96 libstore: Make our sandbox pivot_root directory accessible to ourself
If you have the Nix store mounted from a nonlocal filesystem whose
exporter is not running as root, making the directory mode 000 makes it
inaccessible to that remote unprivileged user and therefore breaks the
build. (Specifically, I am running into this with a virtiofs mount using
Apple Virtualization.framework as a non-root user, but I expect the
same thing would happen with virtiofs in qemu on Linux as a non-root
user or with various userspace network file servers.)

Make the directory mode 500 (dr-x------) to make the sandbox work in
this use case, which explicitly conveys our intention to read and search
the directory.  The code only works because root can already bypass
directory checks, so this does not actually grant more permissions to
the directory owner / does not make the sandbox less secure.

(cherry picked from commit 5a794d9366)
2025-01-10 10:16:07 +00:00
Eman Resu
6304fa5cd1 docs: clarify syntax for escaping dollar curlies
(cherry picked from commit defff01a51)

# Conflicts:
#	doc/manual/source/language/string-literals.md
2025-01-10 10:14:55 +00:00
Robert Hensing
9c54fac5ff doc: Explain why tryEval does not return the message
(cherry picked from commit 90d257b771)
2025-01-10 10:12:37 +00:00
Sergei Zimmerman
e863e6ab83 fix(libstore-tests): remove use-after-free bug for StringSource
Unfortunately `StringSource` class is very easy was very easy to misuse
because the ctor took a plain `std::string_view` which has a bad habit
of being implicitly convertible from an rvalue `std::string`. This lead
to unintentional use-after-free bugs.

This patch makes `StringSource` much harder to misuse by disabling the ctor
from a `std::string &&` (but `const std::string &` is ok).

Fix affected tests from libstore-tests.
Reformat those tests with clangd's range formatting since the diff is tiny
and it seems appropriate.

(cherry picked from commit 5bc8957c73)
2025-01-10 10:08:26 +00:00
Sergei Zimmerman
dea80c4fec fix(libmain/common-args): do not exceed maximum allowed verbosity
This patch gets rid of UB when verbosity exceeds the maximum logging value of `lvlVomit = 7` and
reaches invalid values (e.g. 8). This is actually triggered in functional tests.
There are too many occurrences to list, but here's one from the UBSAN log:

../src/libstore/gc.cc:610:5: runtime error: load of value 8, which is not a valid value for type 'Verbosity'

(cherry picked from commit b9f8c4af40)
2025-01-10 10:04:39 +00:00
h0nIg
26866eef0c docker: Fix command "nix profile install", Don't require --impure
(cherry picked from commit 61950c3375)
2025-01-10 09:58:36 +00:00
Graham Christensen
56332fda1c Disable suid and atime on the /nix mount point on Darwin
The Determinate Nix Installer has set nosuid and noatime in https://github.com/DeterminateSystems/nix-installer/pull/1338, and figured this perf and security improvement is worthy of upstreaming.

The /nix volume shouldn't have setuid binaries anyway, and filesystems seem to generally be noatime on macOS.
Further, the garbage collector doesn't use atime.

(cherry picked from commit 4137ead7a1)
2025-01-10 09:56:35 +00:00
Cole Helbling
4a7c7f12f5 libstore: fixup unformatted uri when S3 getObject fails
(cherry picked from commit b978fa8450)
2025-01-10 09:48:23 +00:00
Cole Helbling
fed54f3550 tests/nixos/s3-binary-cache-store: disable default substituter so it runs faster
Since networking is disabled in these VMs, trying to talk to the default
cache.nixos.org slows the test down (since it can't resolve it).

(cherry picked from commit f0c1262d23)
2025-01-10 09:48:23 +00:00
Cole Helbling
6c1dfab347 tests/nixos/s3-binary-cache-store: test that "object does not exist" error message is properly formatted
(cherry picked from commit 535724fd79)
2025-01-10 09:48:22 +00:00
Philipp Otterbein
4b4b6377b2 fix documentation of substring
(cherry picked from commit 1e2cace5f1)
2025-01-10 09:44:14 +00:00
Philipp Otterbein
9936cb21ab toJSON: re-throw serialization exception
(cherry picked from commit 4a2310a3a0)
2025-01-10 09:42:14 +00:00
Domagoj Mišković
7c8276b799 Document --max-freed for nix-collect-garbage (#12155)
* Update nix-collect-garbage.md

Referencing issue at: https://github.com/NixOS/nix/issues/12132

Copied the description of `--max-freed` option from 442a2623e4/doc/manual/source/command-ref/nix-store/gc.md (L39-L44)

(cherry picked from commit 5230d3ecc4)
2025-01-10 09:34:09 +00:00
mergify[bot]
e0c8b0fc4f
Merge pull request #12150 from NixOS/mergify/bp/2.24-maintenance/pr-12143
mergify: fix installer test name (backport #12143)
2025-01-07 19:42:11 +00:00
Jörg Thalheim
55dc2a9c9a mergify: fix installer test name
(cherry picked from commit 438a20427f)
2025-01-07 19:18:05 +00:00
Jörg Thalheim
112d0a7d85
Merge pull request #12144 from NixOS/mergify/bp/2.24-maintenance/pr-12046
CLI symlink fixes (backport #12046)
2025-01-07 08:06:58 +01:00
Jörg Thalheim
b59b317e47
Merge pull request #12136 from NixOS/mergify/bp/2.24-maintenance/pr-11876
Filter OSC 8 correctly (backport #11876)
2025-01-07 07:22:37 +01:00
Jörg Thalheim
1eda38420f
Merge pull request #11743 from NixOS/mergify/bp/2.24-maintenance/pr-11729
nix/tests: run test help.sh only if nix is built with documentation (backport #11729)
2025-01-07 07:21:51 +01:00
Robert Hensing
caeec0404e test: Avoid regressing accidental use of weakly_canonical instead of makeParentCanonical
I'd messed up a rebase in my previous iteration, causing `weakly_canonical` to reappear,
but not trigger a test failure.

These two functions behave similarly when the argument is a path that points to a broken
symlink. `weakly_canonical` would not resolve it because the target doesn't exist, and
`makeParentCanonical` would not resolve it, because it never resolves the final path
element.
This new test case now also tests a valid symlink, "differentiating" the two.

(cherry picked from commit 4c74d679b6)
2025-01-07 07:20:55 +01:00
Jörg Thalheim
f145dde10b makeParentCanonical: test case where parent is empty
(cherry picked from commit 5a5a86949a)

# Conflicts:
#	src/libutil-tests/file-system.cc
2025-01-07 07:20:55 +01:00
Robert Hensing
73dd3db039 test: Add hydraJobs.tests.functional_symlinked-home
(cherry picked from commit 628c11d237)
2025-01-07 07:20:55 +01:00
Robert Hensing
e31d071793 fix: Resolve CLI parent symlinks before adding to store
Fixes https://github.com/NixOS/nix/issues/11941

(cherry picked from commit ddbbf53767)
2025-01-07 07:20:55 +01:00
Robert Hensing
42104d650a refactor: Don't re-construct SourcePath unnecessarily
(cherry picked from commit c0b64f3377)
2025-01-07 07:20:55 +01:00
Robert Hensing
129f8aaab2 doc: Document nix-store --add-fixed symlink behavior
Tested with

    nix run nix/2.3-maintenance#nix-store -- --add some_symlink
    nix run nix/2.3-maintenance#nix-store -- --add-fixed sha256 --recursive some_symlink

(cherry picked from commit 91e91f62fa)
2025-01-07 07:20:55 +01:00
Robert Hensing
b9c30a9c87 fix: Handle symlinks and FIFOs in nix hash where possible
Fixes https://github.com/NixOS/nix/issues/11756
Fixes https://github.com/NixOS/nix/issues/11681

(cherry picked from commit 36563c69a4)
2025-01-07 07:20:55 +01:00