1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-12 21:46:01 +01:00
Commit graph

11680 commits

Author SHA1 Message Date
Théophane Hufschmitt
aa97c4f9f2 find-roots: Fix --help and invalid cli flags
- Make `--help` and `-h` valid cli flags that show the (short) help
- Prevent the program from segfaulting when an invalid option is passed
2022-04-13 10:25:20 +02:00
Théophane Hufschmitt
beac0b49e4 Correctly handle multiple traps in the tests 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
1cd308194f Remove the -all_load flag on darwin
Seems to be useless (🤞), and breaks `-lc++fs`
2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
e58c47cc1a Fix the std::filesystem linking on darwin 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
48b8de73f0 Typo 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
83365a79bc Also build the findroots library for darwin
Might fail at link time, but not building it will fail anyways, so…
2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
d4bbb1dec7 Escape the file paths before sending them
Make sure that a file-path containing a `\t` or a `\n` doesn’t mess with
everything
2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
cd7e22e4e0 Fix the external-gc-daemon test
Don’t run the auxiliary tests in a new shell, as that would trigger the
`EXIT` trap, causing the daemon to die early
2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
8de54ed4e1 Gate the external gc behind an xp feature flag 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
240f1614d8 Add a proper nix option for the external GC 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
f76bfbfbd6 Remove the dependency to which in the tests 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
d97b9f138c nix-find-roots: Support systemd socket activation 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
f6a30993f0 Rename the find-roots library
Give it a name more in line with the rest
2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
072f420260 Remove the old gc methods from LocalStore 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
2c47b08e17 Use the standalone gc lib in the default gc 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
fbec849281 Split the root finding in a separate library 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
bbde40af3e Make it easy to build a static nix-find-roots from this source tree
Just `nix build .#nix-find-roots` (or `nix-build -A nix-find-roots`)
2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
80bb58b186 Properly get the temp roots when using the external gc daemon 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
2575dd4f19 Add some tests for the external gc daemon 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
dadc4a42c6 Make the gc socket path configurable 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
1d5d30b12f Make the root-tracer directly listen on a socket
Complicates the code quite a bit (compared to letting systemd handle
that for us), but makes things much easier to test
2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
e1df6c220a Censor the gc roots that aren’t under stateDir 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
8f622ff71b Don’t fail when the store contains some invalid paths 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
f3b9d3fd88 Add a message if the external tracer isn’t available 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
9a3c3cb748 Make nix-collect-garbage use the trace socket 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
63159dd672 nix-find-roots: Fully disable on darwin
Until I can understand why it’s not working
2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
4d9ca6d09e Fallback to the old mechanism if the gc socket isn’t found 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
26c802d18c Communicate with the gc daemon via a socket 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
aadf585ea3 Fix build on darwin 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
35c7d5d2f1 gc: Only track sensible paths from maps file 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
3839eb15d6 Also check the NixOS specific files 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
61c35a810b gc: Use the trace helper 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
93739ce006 Dump the whole file when scaning its content
Dumping the fstream to a string just dumps a certain number of bits of
it, causing some references to be missed
2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
5d47c37cbc Track the runtime roots
Everything that’s potentially accessed by a running program (its own
path, its environment, mmapped files, etc..)
2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
2e7f1d24a1 gc: Also track the original roots
Will be required by `--print-roots` and friends
2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
c788718de1 Specialise for searching under $stateDir/{profiles,gcroots} 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
b4ab02ef13 Add an external executable to trace the gc roots back to the store 2022-04-13 10:24:53 +02:00
Théophane Hufschmitt
2253b9044c Merge branch 'client-side-profiles' 2022-04-13 10:24:50 +02:00
regnat
a3c17cfc73 Harden the user-envs-migration test
Make sure that an absent `.nix-profile` at the begining doesn’t crash it
2022-04-13 10:22:07 +02:00
regnat
303abee699 Test the migration of the user profiles 2022-04-13 10:22:07 +02:00
Théophane Hufschmitt
a2bcf35e0d Properly migrate the existing profiles
Make sure that the default profile (including all its generations) are
still available after we move it to the user’s home directory
2022-04-13 10:22:07 +02:00
regnat
be28cb9262 Migrate the old profiles to the new location
Make sure that we don’t just create the new profiles directory, but that
we also migrate every existing profile to it.
2022-04-13 10:13:43 +02:00
regnat
a3979e67f4 Move the default profiles to the user’s home
Rather than using `/nix/var/nix/{profiles,gcroots}/per-user/`, put the user
profiles and gcroots under `$XDG_DATA_DIR/nix/{profiles,gcroots}`.

This means that the daemon no longer needs to manage these paths itself
(they are fully handled client-side). In particular, it doesn’t have to
`chown` them anymore (removing one need for root).

This does change the layout of the gc-roots created by nix-env, and is
likely to break some stuff, so I’m not sure how to properly handle that.
2022-04-13 10:13:41 +02:00
Eelco Dolstra
5ed3a9db6a rl-2.7.md: Fix title
(cherry picked from commit f98d76ff1a)
2022-04-05 14:14:28 +02:00
Eelco Dolstra
c9afca59e8
Merge pull request #6297 from NixOS/backport-6296-to-2.7-maintenance
[Backport 2.7-maintenance] Don't hide repeated values while generating manifest.nix
2022-03-22 21:01:24 +01:00
Eelco Dolstra
0a26f9ae4a Don't hide repeated values while generating manifest.nix
Fixes #6243.

(cherry picked from commit a0259a21a4)
2022-03-22 13:09:47 +00:00
Eelco Dolstra
fc553fb632 printValue(): <REPEAT> -> «repeated»
This ensures that it doesn't get parsed as a valid Nix expression.

(cherry picked from commit 732296ddc0)
2022-03-22 13:09:47 +00:00
Eelco Dolstra
ffe155abd3 Mark official release 2022-03-07 20:11:22 +01:00
Eelco Dolstra
ad7c99ef20 Move rl-next.md to rl-2.7.md 2022-03-07 20:10:18 +01:00
Eelco Dolstra
504e3b2a8f Style 2022-03-07 20:07:43 +01:00