-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Insufficient information in --version
to distinguish between release and development instances
#922
Comments
I wanted to do that originally but then decided that it is easier to just ask the developer to report it himself using |
I don't think relying on We could request the packager make the commit sha the package version instead, but that only fixes one case, and probably isn't totally clear to implement. I think as helix gets more popular more such edge cases will appear. |
@pickfire Looks like we could do this in build.rs without complicated proc macros, what was the problem with this again? I remember there was some issues: // build.rs
use std::process::Command;
fn main() {
// note: add error checking yourself.
let output = Command::new("git").args(&["rev-parse", "--short", "HEAD"]).output().unwrap();
let git_hash = String::from_utf8(output.stdout).unwrap();
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
}
// main.rs
fn main() {
println!("{}", env!("GIT_HASH"));
// output something like:
// 7480b50f3c75eeed88323ec6a718d7baac76290d
} |
(needs some error checking so we fallback to |
It's good practice to include the git sha in the |
I did what you did there. Also, note that we may want I find |
Reproduction steps
Build helix from source.
Invoke
helix --version
against the instance built from source, e.g.:${GITREPO_ROOT}/target/debug/hx --version helix 0.4.1
helix --version
against the instance installed from a release, e.g. (on Arch):Fix:
Make
--version
report more specific version information, perhaps:$(RELEASETAG)-$(BUILD_CANDIDATE)_$(10CHARSBUILDHASH)
e.g.
0.4.1-rc1-8442e653f5
for a development build instance, and:
0.4.1
for a released instance.The text was updated successfully, but these errors were encountered: