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

fall back to environment variables when building without git #4446

Merged
merged 2 commits into from
Dec 16, 2018

Conversation

slanning
Copy link
Contributor

In our RPM build process, for whatever reason
it builds packages from a .git-less source.
This leads to the buildGit* variables not being set
and the corresponding BuildGit* in /debug/vars being empty.
We can export BUILD_GIT_* environment variables
during the build, though; this would fall back to those
in case the git commands come up empty.

Signed-off-by: Scott Lanning [email protected]

@slanning slanning requested a review from sougou as a code owner December 12, 2018 15:42
@sjmudd
Copy link
Contributor

sjmudd commented Dec 13, 2018

It might be worth adding a comment to build_version_flags.sh along the lines of

# Normal builds run directly against the git repo but when packaging (for example with rpms) usually
# a tar ball is used (using git archive of the required commit) which will prevent the git metadata
# being available.  Should this be the case then allow environment variables to be used to source
# this information instead.

as otherwise the reasoning may get lost and searching for this PR requires more effort.

Things have changed a lot since rpm was invented but the desire to have pristine sources as part of the src rpm is good as it ensure reproducibility. It would be possible to make the rpm build scripts clone directly from the git repo, and build locally and some people do that but this does mean you don't have full sources. I think there's an open argument these days about which process is better.

Scott Lanning added 2 commits December 13, 2018 13:05
In our RPM build process, for whatever reason
it builds packages from a .git-less source.
This leads to the buildGit* variables not being set
and the corresponding BuildGit* in /debug/vars being empty.
We can export BUILD_GIT_* environment variables
during the build, though; this would fall back to those
in case the git commands come up empty.

Signed-off-by: Scott Lanning <[email protected]>
suggested by Simon Mudd

Signed-off-by: Scott Lanning <[email protected]>
@slanning slanning force-pushed the build-git-vars-without-git branch from 05b4ed6 to 60ed1bf Compare December 13, 2018 12:06
@sougou sougou merged commit f4b5377 into vitessio:master Dec 16, 2018
@slanning slanning deleted the build-git-vars-without-git branch December 17, 2018 13:53
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.

3 participants