Compare commits

..

No commits in common. "085893c2ef89d8dd28228339ed9e909a3f13bd8b" and "355c7e6403679f265f85413fb44eba297c5919be" have entirely different histories.

4 changed files with 9 additions and 4 deletions

View file

@ -5,7 +5,7 @@
name = "sysroot-cleaner" name = "sysroot-cleaner"
authors = ["Matteo Settenvini <matteo.settenvini@montecristosoftware.eu>"] authors = ["Matteo Settenvini <matteo.settenvini@montecristosoftware.eu>"]
version = "0.1.0" version = "0.1.0"
edition = "2024" edition = "2021"
license = "EUPL-1.2" license = "EUPL-1.2"
readme = "README.md" readme = "README.md"

View file

@ -3,6 +3,6 @@
[toolchain] [toolchain]
channel = "1.85" channel = "1.84"
profile = "default" profile = "default"
components = ["rustfmt"] components = ["rustfmt"]

View file

@ -82,14 +82,14 @@ impl Runner {
async fn paths_producer(tasks: &mut JoinSet<Result<(), Error>>) -> mpsc::Receiver<Decision> { async fn paths_producer(tasks: &mut JoinSet<Result<(), Error>>) -> mpsc::Receiver<Decision> {
let (input_tx, input_rx) = mpsc::channel(CHANNEL_SIZE); let (input_tx, input_rx) = mpsc::channel(CHANNEL_SIZE);
let walker = WalkDir::new(".").follow_links(false).same_file_system(true); let walker = WalkDir::new(".").follow_links(false);
tasks.spawn(async move { tasks.spawn(async move {
for entry in walker { for entry in walker {
match entry { match entry {
Ok(e) if !Self::is_dir(&e) => { Ok(e) if !Self::is_dir(&e) => {
input_tx input_tx
.send(Decision { .send(Decision {
path: e.into_path().strip_prefix(".")?.to_path_buf(), path: e.into_path(),
action: Action::Undecided, action: Action::Undecided,
}) })
.await?; .await?;

View file

@ -77,6 +77,7 @@ impl Cleaner for DsoCleaner {
if decision.action == Action::Keep { if decision.action == Action::Keep {
let ino = nix::sys::stat::lstat(&decision.path)?.st_ino; let ino = nix::sys::stat::lstat(&decision.path)?.st_ino;
inodes_to_keep.insert(ino); inodes_to_keep.insert(ino);
dbg!(&decision.path, ino);
} }
// If something was marked as "keep" or "remove" before, // If something was marked as "keep" or "remove" before,
@ -110,6 +111,10 @@ impl Cleaner for DsoCleaner {
}; };
for path in paths { for path in paths {
if path.display().to_string().contains("libjsonrpccpp-server") {
dbg!(inode, &path, action);
}
output.send(Decision { path, action }).await?; output.send(Decision { path, action }).await?;
} }
} }