Skip to content

display which file triggered the re-run#439

Draft
marcospb19 wants to merge 1 commit intoCanop:mainfrom
marcospb19:display-what-file-changed-and-triggered-re-run
Draft

display which file triggered the re-run#439
marcospb19 wants to merge 1 commit intoCanop:mainfrom
marcospb19:display-what-file-changed-and-triggered-re-run

Conversation

@marcospb19
Copy link
Copy Markdown

A draft to address #438.

What it looks like (at the time of writing):
image

TODO:

  • Pressing F5 wrongly shows the last triggered path instead, instead of "computing..."

let padding_len = 2;

let should_be_shortened =
last_trigger_path.as_os_str().len() + prefix_len + padding_len > width;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

counting bytes isn't the right way to know if a string should be shortened. Even counting chars is wrong, as some may be double width. And you can't shorten a string at any arbitrary byte, or the UTF8 might be invalid.

But there are proper utilities in bacon do display strings while taking care of the available size. Look for calls to write_composite_fill in bacon (the last argument can be Center).

@Canop
Copy link
Copy Markdown
Owner

Canop commented Mar 19, 2026

I don't think this is the right approach to debug bacon. You may have much more to display and you can't always write this info in bacon itself.

You should use the log: launch bacon with BACON_LOG=debug bacon (or BACON_LOG=debug cargo run -- path/to/project if you're in the bacon project dir. Then display the log with tail -f bacon.log in another terminal. You'll see for example that the path triggering the recompute is logged, as well as some ignoring related info. And you can of course, to find the problem, add more debug! and info! in the code.

@marcospb19
Copy link
Copy Markdown
Author

You should use the log: ...

Sounds great, thanks! I couldn't find that in the docs, so I'll pass my eyes on it again later to see if I just missed it, or if I can make a PR to improve it.

@Canop
Copy link
Copy Markdown
Owner

Canop commented Mar 20, 2026

You're right, it's missing in the doc.

It should be in this page: https://dystroy.org/bacon/community/bacon-dev/

And it should be similar to what I've written for another program: https://dystroy.org/broot/community/#log

@Canop
Copy link
Copy Markdown
Owner

Canop commented Mar 21, 2026

Actually, logging is mentioned: http://localhost:8004/community/bacon-dev/#issues

Canop added a commit that referenced this pull request Mar 21, 2026
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

Successfully merging this pull request may close these issues.

2 participants