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
Eelco Dolstra
fa614fac7f
Merge branch 'GuillaumeDesforges/issue6192' of https://github.com/GuillaumeDesforges/nix
2022-03-07 19:58:06 +01:00
Eelco Dolstra
0123b9aec8
Tweak release notes
2022-03-07 19:56:10 +01:00
Eelco Dolstra
30ddd37873
Merge branch 'cli-suggestions' of https://github.com/thufschmitt/nix
2022-03-07 19:47:45 +01:00
Guillaume Desforges
436c6e900f
Explicit error in flake init/new when not in store
2022-03-07 17:57:52 +01:00
regnat
dcf4f77fac
Merge or-suggestions.hh into suggestions.hh
...
No real need for keeping a separate header for such a simple class.
This requires changing a bit `OrSuggestions<T>::operator*` to not throw
an `Error` to prevent a cyclic dependency. But since this error is only
thrown on programmer error, we can replace the whole method by a direct
call to `std::get` which will raise its own assertion if needs be.
2022-03-07 17:49:02 +01:00
Eelco Dolstra
60a68a4fee
Merge pull request #6173 from hercules-ci/fix-mkString-for-empty-string-view
...
Fix `mkString` for empty `string_view`
2022-03-07 17:10:41 +01:00
Robert Hensing
da260f579d
dupStringWithLen -> makeImmutableString
...
Refactor the `size == 0` logic into a new helper function that
replaces dupStringWithLen.
The name had to change, because unlike a `dup`-function, it does
not always allocate a new string.
2022-03-07 16:09:12 +01:00
Robert Hensing
bbf55383e7
Value::mkPath: Avoid potential crash from null string_view
2022-03-07 16:09:12 +01:00
Robert Hensing
1b978596b5
Value::mkString: Avoid crash from null string_view
2022-03-07 16:09:12 +01:00
Eelco Dolstra
c28e2b1b29
Tweak release notes
2022-03-07 11:30:40 +01:00
regnat
313bbc07a8
Implement operator<< for Suggestions
...
That way there’s no need to explicitely convert it to a string when
printing it
2022-03-07 10:09:10 +01:00
regnat
fd45d85b41
Move OrSuggestions to its own header
...
Prevents a recursive inclusion
2022-03-07 10:09:10 +01:00
regnat
b44cebd1fd
Add a release-notes entry for the cli suggestions
2022-03-07 10:09:10 +01:00
regnat
91635206c0
Add some end-to-end tests for the suggestions
2022-03-07 10:09:10 +01:00