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

Reimplement git version generation ourselves #10336

Merged
merged 1 commit into from Mar 2, 2024

Conversation

faho
Copy link
Member

@faho faho commented Mar 1, 2024

This allows us to remove two dependency crates

This allows us to remove two dependency crates
@faho faho added this to the fish next-3.x milestone Mar 1, 2024
@zanchey
Copy link
Member

zanchey commented Mar 1, 2024

I haven't had a chance to test, but does this do any better with dirty/non-dirty trees? The CMake/sh version always picked up if the tree was dirty, but the git-version.rs approach only worked if a Rust source file had been modified.

@mqudsi
Copy link
Contributor

mqudsi commented Mar 2, 2024

@zanchey we would have to use rebuild_if_paths_changed and pass in all additional paths (share, mainly?) we want build.rs to be re-run if they change. This will mean slightly slower incremental builds after changing only fish files, but I think it shouldn't result in actual work for the compiler.

return var;
}

let path = PathBuf::from(build_dir).join("version");
Copy link
Contributor

Choose a reason for hiding this comment

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

I would like to (at some point) rename this file to FISH_BUILD_VERSION to make everything more consistent.

Copy link
Member Author

Choose a reason for hiding this comment

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

Tbh my preference would be to pass the version as an environment variable - this would also be much easier for sphinx to read when building manpages (which would allow us to build them before building the binaries, which makes it possible to embed them in a binary).

I haven't figured out how to get cmake to do that, tho

@mqudsi
Copy link
Contributor

mqudsi commented Mar 2, 2024

LGTM. I see no need for that dependency.

@faho
Copy link
Member Author

faho commented Mar 2, 2024

I haven't had a chance to test, but does this do any better with dirty/non-dirty trees?

This is basically the same thing as before. It's really mostly about not needing a dependency that we barely use, and partially about being able to adjust it just to our liking.

Alright, merging, it's simple enough to revert if there are any issues.

@faho faho merged commit 2a4e776 into fish-shell:master Mar 2, 2024
7 checks passed
@faho faho deleted the easier-version branch March 2, 2024 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants