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

fix: update build script for using vergen without a git repo #59

Merged
merged 1 commit into from
Jan 4, 2022

Conversation

orhun
Copy link
Contributor

@orhun orhun commented Jan 4, 2022

Hey! Recently I tried to build rathole from the source tarball and got this error:

   Compiling rathole v0.3.1 (/build/rathole/src/rathole-0.3.1)
error: failed to run custom build command for `rathole v0.3.1 (/build/rathole/src/rathole-0.3.1)`

Caused by:
  process didn't exit successfully: `/build/rathole/src/rathole-0.3.1/target/release/build/rathole-b8f03abef0c5fe3e/build-script-build` (exit status: 1)
  --- stderr
  Error: could not find repository from '/build/rathole/src/rathole-0.3.1'; class=Repository (6); code=NotFound (-3)
warning: build failed, waiting for other jobs to finish...
error: build failed

This PR fixes this issue by running vergen twice if it fails, with disabling the "git" feature. This won't be an issue since option_env! is used for these git-related variables.

References:

A fallback mechanism has been added to build script for letting
vergen generate cargo instructions even if not run in a git
repository. In such cases, a default vergen configuration is
used along with disabled "git" feature thus not generating any
git-related environment variables.

Signed-off-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
@rapiz1
Copy link
Owner

rapiz1 commented Jan 4, 2022 via email

@rapiz1 rapiz1 merged commit bb26e2c into rapiz1:main Jan 4, 2022
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 this pull request may close these issues.

2 participants