-
-
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
Version is not always updated when re-building from source #10855
Comments
I'm not sure this matters very much. This should only happen on local cached builds, and if we "fixed" this so the commit hash was always accurate, then it would cause a ton of unnecessary compile times, since helix-loader sits at the top of the crate dependency tree, so everything underneath it has to get rebuilt too |
That's fair. My thinking was that "local cached builds" would be common for those who regularly stay up to date with It's also a bit confusing as a user, I spent a while installing and uninstalling helix, thinking |
we already instruct cargo to rebuild if the HEAD commit changes but I think there is a bug in the logic |
Fixes helix-editor#10855. The loader build.rs tries to determine when HEAD changes, so it can re-run and update the embedded version. It was shelling out to do this, and capturing a trailing newline, so it always thought HEAD did not exist. I confirmed that if I update helix-term, helix-loader rebuilds and updates the commit hash: ``` [rcorre@midgar helix]$ git rev-parse --short HEAD e24eed2c [rcorre@midgar helix]$ hx --version helix 24.3 (e24eed2c) [rcorre@midgar helix]$ hx helix-term/src/main.rs [rcorre@midgar helix]$ git cma "test changing helix-term" [fix-version cbb68bab] test changing helix-term 1 file changed, 1 insertion(+) [rcorre@midgar helix]$ cargo install --path helix-term --locked Installing helix-term v24.3.0 (/home/rcorre/src/helix/helix-term) Updating crates.io index Compiling helix-loader v24.3.0 (/home/rcorre/src/helix/helix-loader) Compiling helix-term v24.3.0 (/home/rcorre/src/helix/helix-term) ... snip ... [rcorre@midgar helix]$ git rev-parse --short HEAD cbb68bab [rcorre@midgar helix]$ hx --version helix 24.3 (cbb68bab) ```
Summary
I'm building helix from source, and noticed that the version reported by
--version
does not quite match the commit I'm building from.I do see some files for helix-loader referencing that hash:
I believe what's happening is that
helix-loader
is what defines the version thathelix-term
imports, so if you pull changes that don't includehelix-loader
and rebuild, the version remains unchanged.Reproduction Steps
I tried this:
hx
I expected this to happen:
Instead, this happened:
Helix log
~/.cache/helix/helix.log
Platform
Linux
Terminal Emulator
N/A
Installation Method
source
Helix Version
1796735
The text was updated successfully, but these errors were encountered: