threefoldtech / rmb-rs

RMB implementation in rust
Apache License 2.0
3 stars 1 forks source link

Printing git version blocks building release archives #126

Closed scottyeager closed 1 month ago

scottyeager commented 1 year ago

I tried building the source contained in one of the release archives (for example). It fails here in build.rs when running the git_version macro because in this case the directory is not actually a Git repo.

Suggest to adding some logic to skip this or ignore the error when building without Git.

xmonader commented 10 months ago

Is there a specific reason to not use the bundled binaries in the release? I'd still clone and switch to the proper tag to build (even in a CI/CD)

scottyeager commented 9 months ago

Not saying there's any particularly good reason to do this--just noting that the source archives won't build as is.

I see that the build instructions specify cloning with Git, so maybe the answer is just that it's a build requirement and users should check the docs. Still, would be nice to at least present a helpful error in case someone tries to download and build these archives in the future.

ashraffouda commented 1 month ago

maybe we handle that in docs later

xmonader commented 1 month ago

Also not sure if similar approach may help https://github.com/threefoldtech/rfs/blob/master/build.rs

fn main() {
    println!(
        "cargo:rustc-env=GIT_VERSION={}",
        git_version::git_version!(args = ["--tags", "--always", "--dirty=-modified"], fallback = "unknown")
    );
}
scottyeager commented 1 month ago

Also not sure if similar approach may help

This did the trick :+1: