fishfolk / jumpy

Tactical 2D shooter in fishy pixels style. Made with Rust-lang 🦀 and Bevy 🪶
https://fishfolk.org/games/jumpy/
Other
1.64k stars 118 forks source link

Allow compilation without git binary #890

Closed orhun closed 8 months ago

orhun commented 8 months ago

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.