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

Fix logic to update version when HEAD changes. #10896

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

rcorre
Copy link
Contributor

@rcorre rcorre commented Jun 6, 2024

Fixes #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)

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)
```
Copy link
Member

@pascalkuthe pascalkuthe left a comment

Choose a reason for hiding this comment

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

I found the same thing so I can confirm this fixes the issue.

@archseer archseer merged commit 886d307 into helix-editor:master Jun 6, 2024
6 checks passed
Vulpesx pushed a commit to Vulpesx/helix that referenced this pull request Jun 7, 2024
@rcorre rcorre deleted the fix-version branch June 8, 2024 15:06
AOx0 pushed a commit to AOx0/helix that referenced this pull request Jun 15, 2024
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 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

Successfully merging this pull request may close these issues.

Version is not always updated when re-building from source
3 participants