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

Allow compilation without git binary #890

Closed
orhun opened this issue Dec 23, 2023 · 0 comments · Fixed by #891
Closed

Allow compilation without git binary #890

orhun opened this issue Dec 23, 2023 · 0 comments · Fixed by #891

Comments

@orhun
Copy link
Member

orhun commented Dec 23, 2023

Description

#887 made the compilation hardly depend on the git binary. This blocks me from updating the Arch Linux package (since I'm not using the git repo for building, but the source archives):

error: git describe exited with status 128: fatal: not a git repository (or any of the parent directories): .git
   --> src/ui/main_menu.rs:100:57
    |
100 |                         egui::TextEdit::singleline(&mut git_version::git_version!())
    |                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the macro `git_version::git_version` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `jumpy` (bin "jumpy") due to previous error

This can be verified from the git-version documentation:

These macros do not depend on libgit, but simply uses the git binary directly. So you must have git installed somewhere in your PATH.

To Reproduce

Build from source without Git.

Expected Behavior

Successful build.

Additional Context

I recommend using shadow-rs to conditionally embed the build info instead (in build.rs). e.g. use the git version if the git is installed, use the actual version otherwise.

Log Messages

Shared above.

github-merge-queue bot pushed a commit that referenced this issue Dec 23, 2023
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 a pull request may close this issue.

1 participant