Comments (4)
I would like to give my point of view to this issue:
It would be a nice feature if lorri could show an overview of all current used gc roots with the ability to select one or more and remove these gc roots.
For example:
$ lorri gc-roots --show
1: /home/user/projects/example1
2: /tmp/test-lorri1
3: /home/user/projects/deprecated-project
$ lorri gc-roots --delete 3
My use case is that I want to remove gc roots of testing environments or deprecated projects I used, so an "overview" command is definitely necessary in my opinion.
I would love to help with this kind of feature, once the cli design is set.
BTW: Very nice work with this project!
from lorri.
Since we’ve removed the .lorri
directory from the project and are moving to hashed project paths as gcroot names, the disconnect is gonna be even bigger.
How about adding a plumbing command for now, lorri rm-gc-roots_ [--for <nix file>]
(defaulting to .
) until we get a better overview of what users need in practice?
from lorri.
This is a good candidate for contribution. Implementing the plumbing command I mentioned above should be fairly easy.
Any takers? :)
from lorri.
For me personally it would be sufficient if lorri just kept a reference to the source next to the gcroot. Then I can use a normal bash script to produce a list of used and unused gcroots.
For that I guess adding something like this would be the way to go? (No idea whether that compiles, I don't really speak Rust)
--- a/src/project.rs
+++ b/src/project.rs
@@ -34,14 +34,20 @@ impl Project {
gc_root_dir: &Path,
cas: ContentAddressable,
) -> std::io::Result<Project> {
+ let nix_file_path = nix_file.as_path().as_os_str().as_bytes();
+
let hash = format!(
"{:x}",
- md5::compute(nix_file.as_path().as_os_str().as_bytes())
+ md5::compute(nix_file_path)
);
- let project_gc_root = gc_root_dir.join(&hash).join("gc_root");
+ let project_dir = gc_root_dir.join(&hash);
+ let project_gc_root = project_dir.join("gc_root");
std::fs::create_dir_all(&project_gc_root)?;
+ let mut file = File::create(project_dir.join("ref"))?;
+ file.write_all(nix_file_path)?;
+
Ok(Project {
nix_file,
gc_root_path: project_gc_root,
For each new gcroot this would create a file which contains the path to the shell.nix
that it was created with
$ cat ~/.cache/lorri/gc_roots/<hash>/gc_root/ref
/path/to/shell.nix
In principle ref
could also be a symlink to shell.nix
but I don't know whether there are any adversary interactions with being a gcroot.
from lorri.
Related Issues (20)
- lorri clobbers nix-shell environment
- Show and update lorri daemon status in shell
- No documentation about runtime garbage collection
- Lorri does not use bashInteractive like nix-shell
- Lorri misbehaves when the shell has `disallowedReferences`
- `lorri direnv` extremely slow with a large number of env vars
- shellHook fails when sourcing bash completions HOT 1
- lorri Crash Report
- lorri Crash Report HOT 1
- Start lorry from Emacs HOT 1
- Bash completions fail because XDG_DATA_DIRS is reset HOT 1
- lorri Crash Report HOT 1
- lorri + direnv reloads environment after every command HOT 1
- Lorri doesn't build on unstable HOT 2
- lorri internal stream-events does nothing
- Lorri fails to setup FHS user environment HOT 3
- Lorri incorrectly prepend NODE_PATH instead of overwriting
- Breaks kde-open5/xdg-open HOT 2
- MAINTENANCE NOTICE HOT 1
- lorri Crash Report
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lorri.