-
Notifications
You must be signed in to change notification settings - Fork 751
cli: lazily emit cargo:rerun-if-changed to avoid spurious rebuilds #7273
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
Conversation
Hmm test suite passed for me on the initial run, but now that I have this merged into another branch I see the
|
Maybe another option to hardcoding |
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.
cc @thoughtpolice as I have no expertise on the nix part.
7d7a4c9
to
fd5daa0
Compare
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.
The changes in build.rs
look good. I can't review the nix change, so I'll leave it to someone else.
fd5daa0
to
396fd95
Compare
Maybe @thoughtpolice or @emilazy can help? |
396fd95
to
6052d9e
Compare
Ended up adding an allowance for version strings ending with a |
67310d1
to
10693ae
Compare
The build script has a hierarchy of where the current git hash is detected from: check $NIX_JJ_GIT_HASH, if that fails, ask jj, if that fails, ask git. If the build script is satisfied from a query higher up the priority chain, there's no reason to instruct cargo to rereun and rebuild (and relink) everything: for example if $NIX_JJ_GIT_HASH is set, there's no need to check heads from either jj or git. Although the build script takes effort to specify `jj log --ignore-working-copy`, it would previously still get invalidated if jj performed a snapshot (even if $NIX_JJ_GIT_HASH was set). This can be fairly annoying when iterating on the test suite where each commit would rebuild the CLI and by extension all of its tests.
10693ae
to
207381f
Compare
I've dropped the Nix specific changes from this PR, I'm just as happy hard-coding With that said, @yuja do you feel comfortable approving the rest of the |
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.
I don't know how nix sets -?irty
suffix, the other changes look good, thanks.
207381f
to
6dbbb0a
Compare
Checklist
If applicable:
CHANGELOG.md
README.md
,docs/
,demos/
)cli/src/config-schema.json
)