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

No version info in homebrew package #3102

Closed
michaelsproul opened this issue Mar 19, 2022 · 3 comments
Closed

No version info in homebrew package #3102

michaelsproul opened this issue Mar 19, 2022 · 3 comments

Comments

@michaelsproul
Copy link
Member

michaelsproul commented Mar 19, 2022

The homebrew package builds without the full git sources, which leads to its version showing as Lighthouse unknown. We should work out a way to inject the version from homebrew, or switch homebrew to use git (I suspect they won't want to do this due to the increased size)

@ackintosh
Copy link
Member

How about using env!("CARGO_PKG_VERSION") as the fallback?

I will file a PR if it looks good to you. 😃

@realbigsean
Copy link
Member

I think this would result in us displaying the version of the lighthouse_version crate, which is 0.1.0 right now.. but maybe we should actually track this version with our lighthouse release version? Would just need to add it to the change_version.sh script

@ackintosh
Copy link
Member

I noticed that the change_version.sh script does the replacing below:

sed -i -e "s/$FROM/$TO/g" $VERSION_CRATE

the VERSION_CRATE variable points lighthouse_version/src/lib.rs:

VERSION_CRATE="../common/lighthouse_version/src/lib.rs"


Therefore we don't need to use env!("CARGO_PKG_VERSION"), just hard code the version number. 💡

pub const VERSION: &str = git_version!(
    args = [
        "--always",
        "--dirty=+",
        "--abbrev=7",
        // NOTE: using --match instead of --exclude for compatibility with old Git
        "--match=thiswillnevermatchlol"
    ],
    prefix = "Lighthouse/v2.2.1-",
-   fallback = "unknown"
+   fallback = "Lighthouse/v2.2.1" // Note: unlike `prefix`, the trailing hyphen was striped.
);

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

No branches or pull requests

3 participants