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

19095 commits

Author SHA1 Message Date
Illia Bobyr
b36637c8f7
nix-profile{,-daemon}.fish: Do not source twice
In order for the script not be sourced multiple times by the same shell
instance, `__ETC_PROFILE_NIX_SOURCED` needs to be set with a `--global`
flag.

Both files are almost identical.  And style differences make it harder
to see what is actually different and keep them in sync, when it is
required.
2025-01-18 12:39:10 -08:00
Illia Bobyr
666d656593
nix-profile-daemon.fish: fmt
`nix-profile.fish` and part of `nix-profile-daemon.fish` use 4 space
indentation.  Which is also the indentation that the fish shell
documentation is using.

Reformatting a chunk of `nix-profile-daemon.fish` from 2 space
indentation to 4 space indentation for consistency.
2025-01-18 12:39:10 -08:00
mergify[bot]
bcb92a5fa0
Merge pull request #12133 from momeemt/#11991-logs_ignore_empty_lines
libmain: fix ignoring empty lines in the print-build-logs option
2025-01-18 13:52:25 +00:00
mergify[bot]
4f0e352ef2
Merge pull request #12283 from DeterminateSystems/type-safe-git-url
Git fetcher: Replace RepoInfo::url by a std::variant
2025-01-18 09:37:23 +00:00
Eelco Dolstra
f5548c17ed getSourcePath(): Return std::filesystem::path 2025-01-17 13:21:53 +01:00
Eelco Dolstra
9003343b53 Git fetcher: Replace RepoInfo::url by a std::variant
Previously the 'url' field was either a path or a URL, depending on
'isLocal'. This replaces both fields by a std::variant, which is more
type-safe.
2025-01-17 13:21:53 +01:00
Eelco Dolstra
43a170a554
Merge pull request #12277 from DeterminateSystems/warn-relative-git
Warn against the use of relative 'git+file:' flake inputs
2025-01-17 12:49:24 +01:00
Eelco Dolstra
3197c19a31 Add link to tracking issue 2025-01-17 12:34:38 +01:00
Eelco Dolstra
12aff40ad7
Merge pull request #12282 from DeterminateSystems/trivial-changes
Trivial changes from lazy-trees
2025-01-17 00:00:07 +01:00
Eelco Dolstra
f0271090b2 Drop unused 'settings' argument 2025-01-16 23:47:57 +01:00
Eelco Dolstra
5807b5cda0 Trivial changes from lazy-trees
Rename allowLookup -> useRegistries, rename lockRootPath ->
followsPrefix, drop an unnecessary getFlake() variant.
2025-01-16 23:44:18 +01:00
Eelco Dolstra
17b6557c03
Merge pull request #12275 from andrewhamon/ah/set-priority-nix-env-install
nix-env: add a --priority flag to --install
2025-01-16 22:04:35 +01:00
Andy Hamon
6ea339ce8a
Update src/nix-env/nix-env.cc
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2025-01-16 11:53:43 -08:00
Andy Hamon
3716ded8df nix-env: add a --priority flag to --install
nix-env can read priorities from a derivations meta attributes, but this
only works when installing a nix expression.

nix-env can also install bare store paths, however meta attributes are
not readable in that case. This means that a store path can not be
installed with a specific priority.

Some cases where it is advantageous to install a store path: a remote
host following a `nix copy`, or any time you want to save some
evaluation time and happen to already know the store path.

This PR addresses this shortcoming by adding a --priority flag to
nix-env --install.
2025-01-16 11:46:25 -08:00
Eelco Dolstra
f36cbee7fd
Merge pull request #12258 from abathur/fix_paths_in_sequoia_script
sequoia-nixbld-user-migration: nail down PATH
2025-01-16 17:42:20 +01:00
Eelco Dolstra
d388a691f3
Merge pull request #12276 from DeterminateSystems/remove-unneeded-quotes
Remove some unnecessary quotes around std::filesystem::path
2025-01-16 17:28:05 +01:00
Eelco Dolstra
12e14956e2 Warn against the use of relative 'git+file:' flake inputs 2025-01-16 17:23:31 +01:00
Eelco Dolstra
2ca0c62a8d Remove some unnecessary quotes around std::filesystem::path 2025-01-16 17:06:59 +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
db46d40b12 Update release note 2025-01-16 13:15:20 +01:00
Eelco Dolstra
8b1fb92a0c flakes.md: Fix indentation that broke the list 2025-01-16 11:31:22 +01:00
Eelco Dolstra
5d03ef9caf PathInputSchema::getAbsPath(): Return std::filesystem::path 2025-01-16 11:26:14 +01:00
Eelco Dolstra
521667eb89 Fix follow-paths test
Since ff8e2fe84e, 'path:' URLs on the
CLI are interpreted as relative to the current directory of the user,
not the path of the flake we're overriding.
2025-01-16 11:19:20 +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
mergify[bot]
9c239d4353
Merge pull request #12107 from bryango/feature
fetchers/git: make relative path absolute for local repo
2025-01-15 19:55:12 +00:00
Robert Hensing
7ad02b62e0 refactor: Remove redundant parameters 2025-01-15 20:01:00 +01:00
Robert Hensing
cab347b4eb refactor: Move ld=gold rule to mesonBuildLayer 2025-01-15 20:01:00 +01:00
Robert Hensing
3d078cd508 Add RossComputerGuy as -llvm maintainer 2025-01-15 20:00:40 +01:00
Robert Hensing
61467b72af
Merge pull request #12229 from RossComputerGuy/feat/llvm
Add LLVM to Flake
2025-01-15 19:35:19 +01:00
Travis A. Everett
6a874c2865 sequoia-nixbld-user-migration: nail down PATH
Fixes a user report of trouble with toybox grep and avoids
potential of same basic issue with other utils.
2025-01-15 08:59:14 -06:00
Eelco Dolstra
ff9d886f3c Use isAbsolute() 2025-01-14 17:42:26 +01:00
Eelco Dolstra
ff8e2fe84e Fix relative 'path:' flakerefs in the CLI
And handle relative 'git+file:' flakerefs while we're at it (these
crashed with an assertion failure).

Fixes #12248.
2025-01-14 17:30:13 +01:00
Eelco Dolstra
6cc5b48a29 Add release note 2025-01-14 14:51:49 +01:00
Eelco Dolstra
8aafc05885
Merge pull request #12253 from nix-windows/windows-create-writable-files
windows: create files if they don't exist, and with write permission
2025-01-14 13:52:08 +01:00
Brian McKenna
0be55f869b windows: create files if they don't exist, and with write permission 2025-01-14 16:46:31 +11:00
Jörg Thalheim
2cb0ddfe4e
Merge pull request #12245 from siddarthkay/fix-typo-in-error-message
scripts/install-multi-user: fix typo
2025-01-13 21:05:28 +01:00
Eelco Dolstra
cd0127f957 Merge remote-tracking branch 'origin/master' into relative-flakes 2025-01-13 14:13:56 +01:00
Eelco Dolstra
a78f998cc7
Merge pull request #12238 from apoelstra/2025-01--unsorted-gc
gc: replace ordered sets with unordered sets for in-memory caches
2025-01-13 13:33:12 +01:00
Siddarth Kumar
fd053fdcad
scripts/install-multi-user: fix typo 2025-01-13 14:12:41 +05:30
Jörg Thalheim
140aee33a3
Merge pull request #12235 from martinetd/add_multi_uaf
libutil: thread-pool: ensure threads finished on error
2025-01-13 09:01:43 +01:00
Robert Hensing
01f5cf2c02
Merge pull request #12237 from NixOS/reject-conflicts
Reject merge conflicts
2025-01-12 22:21:10 +01:00
Andrew Poelstra
4fac767b52
gc: replace ordered sets with unordered sets for in-memory caches
During garbage collection we cache several things -- a set of known-dead
paths, a set of known-alive paths, and a map of paths to their derivers.
Currently they use STL maps and sets, which are ordered structures that
typically are backed by binary trees. Since we are putting pseudorandom
paths into these and looking them up by exact key, we don't need the
ordering, and we're paying a nontrivial cost per insertion.

The existing maps require O(n log n) memory and have O(log n) insertion
and lookup time.

We could instead use unordered maps, which are typically backed by
hashmaps. These require O(n) memory and have O(1) insertion and lookup
time.

On my system this appears to result in a dramatic speedup -- prior to
this patch I was able to delete 400k paths out of 9.5 million over the
course of 34.5 hours. After this patch the same result took 89 minutes.

This result should NOT be taken at face value because the two runs
aren't really comparable; in particular the first started when I had 9.5
million store paths and the seconcd started with 7.8 million, so we are
deleting a different set of paths starting from a much cleaner
filesystem. But I do think it's indicative.

Related: https://github.com/NixOS/nix/issues/9581
2025-01-12 20:23:36 +00:00
Robert Hensing
29a1a21ce4 Reject merge conflicts
They're usually found by other checks, but docs would remain
susceptible.
2025-01-12 13:53:21 +01:00
Dominique Martinet
afac093b34 libutil: thread-pool: ensure threads finished on error
This fixes segfaults with nix copy when there was an error processing
addMultipleToStore.

Running with ASAN/TSAN pointed at an use-after-free with threads from
the pool accessing the graph declared in processGraph after the function
was exiting and destructing the variables.

It turns out that if there is an error before pool.process() is called,
for example while we are still enqueuing tasks, then pool.process()
isn't called and threads are still left to run.

By creating the pool last we ensure that it is stopped first before
running other destructors even if an exception happens early.

[ lix porting note: nix does not name threads so the patch has been
adapted to not pass thread name ]

Link: https://git.lix.systems/lix-project/lix/issues/618
Link: https://gerrit.lix.systems/c/lix/+/2355
2025-01-12 15:11:13 +09:00
mergify[bot]
a44ae8b5a9
Merge pull request #12152 from Mic92/dscl
scripts/install-darwin-multi-user: workaround dscl failing sometimes
2025-01-11 21:11:13 +00:00
mergify[bot]
84f116e3cf
Merge pull request #12167 from RossComputerGuy/fix/unsupported-type-docker
nix flake: clarify error message when file is an unknown type
2025-01-11 20:44:06 +00:00
mergify[bot]
d155e349fc
Merge pull request #12166 from DeterminateSystems/upgrade-nix-error-msg
nix upgrade-nix: Give a better error message if the profile is using 'nix profile'
2025-01-11 20:03:17 +00:00