Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bacon reacts to every inotify event, possibly seeing a broken project #163

Closed
saethlin opened this issue Nov 25, 2023 · 9 comments
Closed

Comments

@saethlin
Copy link

vim generates a number of inotify events when saving a file with :w. For example, these are the events from just one :w:

22:48:09.623 [DEBUG] bacon::app: notify event: Event { kind: Modify(Data(Any)), paths: ["/tmp/scratch/src/main.rs"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }
22:48:09.623 [INFO] bacon::app: ignorer.excludes_all(&we.paths) took 12.06µs
22:48:09.623 [WARN] bacon::app: exclusion check failed: An IO error occurred while opening the index
22:48:09.623 [DEBUG] bacon::app: notify event: Event { kind: Modify(Data(Any)), paths: ["/tmp/scratch/src/main.rs"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }
22:48:09.623 [INFO] bacon::app: ignorer.excludes_all(&we.paths) took 3.76µs
22:48:09.623 [WARN] bacon::app: exclusion check failed: An IO error occurred while opening the index
22:48:09.623 [DEBUG] bacon::app: notify event: Event { kind: Modify(Metadata(Any)), paths: ["/tmp/scratch/src/main.rs"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }
22:48:09.623 [INFO] bacon::app: ignorer.excludes_all(&we.paths) took 8.05µs
22:48:09.623 [WARN] bacon::app: exclusion check failed: An IO error occurred while opening the index
22:48:09.623 [DEBUG] bacon::app: notify event: Event { kind: Access(Close(Write)), paths: ["/tmp/scratch/src/main.rs"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }
22:48:09.623 [INFO] bacon::app: ignorer.excludes_all(&we.paths) took 3.94µs
22:48:09.623 [WARN] bacon::app: exclusion check failed: An IO error occurred while opening the index
22:48:09.624 [DEBUG] bacon::state: error sending task: no available capacity
22:48:09.624 [DEBUG] bacon::app: notify event: Event { kind: Modify(Metadata(Any)), paths: ["/tmp/scratch/src/main.rs"], attr:tracker: None, attr:flag: None, attr:info: None, attr:source: None }
22:48:09.624 [INFO] bacon::app: ignorer.excludes_all(&we.paths) took 7.569µs
22:48:09.624 [WARN] bacon::app: exclusion check failed: An IO error occurred while opening the index
22:48:09.687 [INFO] bacon::app: execution finished with status: Some(ExitStatus(unix_wait_status(0)))

If the compiler is run at the start of this cascade instead of the end, it can see a project with a missing source file. I see this happen routinely, but I can never seem to recreate it on demand.

@Canop
Copy link
Owner

Canop commented Nov 25, 2023

It looks like your vim has a weird save strategy. It's not supposed to remove files when writing them. Any idea why it does that ? Any special setting ?

@saethlin
Copy link
Author

I removed my vim config before reporting this. If you can't reproduce this, I can investigate further to see if there's something about my system elsewhere that's driving this, but I doubt it.

@Canop
Copy link
Owner

Canop commented Nov 25, 2023

If you can't reproduce this

No, I never observed this, and probably not many people did, because it would have been reported otherwise, as it seems to break compilation.

@GeeWee
Copy link

GeeWee commented Feb 19, 2024

I'm not sure if this is 100% related, but bacon often does rerun in the middle of editing a line, leading to compilation errors in my editor as well (RustRover). Often it doesn't seem to pick up the finish of the line, so I need to, add a space or similar to force it to rerun.

@Canop
Copy link
Owner

Canop commented Feb 19, 2024

I'm not sure if this is 100% related, but bacon often does rerun in the middle of editing a line, leading to compilation errors in my editor as well (RustRover)

You mean your editor automatically saves your Rust files when you're in the middle of a line ? You should configure it differently.

@GeeWee
Copy link

GeeWee commented Feb 19, 2024

Yes the Jetbrains family of editors saves continuously. After some googling and twiddling around, this is not something that can be disabled, even after tweaking all there is to tweak that I can find. My issue isn't necessarily that bacon runs continuously on each save ( that seems sensible enough, I imagine it can't tell them apart )

However, the problem for me is that bacon gets "stuck" if it compiles something with an error, and the error has been fixed before the compilation is done. E.g. see the following loom to demonstrate the problem (at around 15 seconds in)

I've tried to replicate the same problem with cargo-watch which seems to handle this case successfully (it also has a debounce parameter which removes most of the churn from repeated savings. See this loom as an example.

Totally open to the fact that this might be a separate issue than the original one - although I felt like they're reasonably similar in that it seems to be related to bacon running too early in the process, and not properly rerunning.

@Canop
Copy link
Owner

Canop commented Feb 19, 2024

not properly rerunning

This looks like a bug and isn't expected

@GeeWee
Copy link

GeeWee commented Feb 19, 2024

That's fair - I've split it into a different issue

@Canop
Copy link
Owner

Canop commented Oct 13, 2024

I think this is solved in bacon 3.

@Canop Canop closed this as completed Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants