-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
emit cargo metadata duiring build scripts to avoid outdated buildscript outputs #6743
emit cargo metadata duiring build scripts to avoid outdated buildscript outputs #6743
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh shoot, I had stumbled across this myself a long time ago and then totally forgot to make a PR! I think we also have to rerun if basically any file changes inside runtime/grammars/sources
, or the languages.toml
file too.
95635c6
to
ef25dd4
Compare
I looked into adding this. We are already rebuilding on I added the metadata for This probably needs a fresh review as a result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, that makes sense, thanks! This looks good to me.
.ok() | ||
.filter(|output| output.status.success()) | ||
.and_then(|x| String::from_utf8(x.stdout).ok()) | ||
else{ return; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does cargo fmt
work on build scripts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes but rustfmt currently ignores let .. else
(leaves it unchanged) altough that will hopefully be fixed in the not-so-distant future
…pt outputs (helix-editor#6743) * rebuild on revision change * rerun grammar build if grammars change
…pt outputs (helix-editor#6743) * rebuild on revision change * rerun grammar build if grammars change
…pt outputs (helix-editor#6743) * rebuild on revision change * rerun grammar build if grammars change
While triaging issues I often noticed that the revision reported by
helix --version
if often wrong. I finally found the reason for this: Thebuild.rs
script that extracts the HEAD branch by callinggit
is not automatically rerun so if you build helix then checkout/merge a branch/revision that doesn't touchhelix-loader
(which doesn't see that much activity compared to the rest of the editor) and rebuild then build script will not be rerun andhelix --version
will report the old (incorrect) revision.I made the build script emit an appropriate
cargo:rerun-if-changed=
so that it is rerun ifHEAD
changes to fix that.