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

make: fix git hash variable assignments for old make versions #291

Merged
merged 1 commit into from
Jun 5, 2020

Conversation

michi-covalent
Copy link
Collaborator

Antediluvian versions of GNU make, such as the one shipped by default on
MacOS (GNU Make 3.81, the last GPLv2 version released back in 2006) do
not understand the != operator which executes and assigns the results
to a variable. This results in the GIT_BRANCH and GIT_HASH variables not
being assigned on MacOS. This commit addresses this issue by using the
$(shell ...) construct instead.

Signed-off-by: Robin Hahling robin.hahling@gw-computing.net

Antediluvian versions of GNU make, such as the one shipped by default on
MacOS (GNU Make 3.81, the last GPLv2 version released back in 2006) do
not understand the `!=` operator which executes and assigns the results
to a variable. This results in the GIT_BRANCH and GIT_HASH variables not
being assigned on MacOS. This commit addresses this issue by using the
`$(shell ...)` construct instead.

Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
@michi-covalent
Copy link
Collaborator Author

tested on mac:

% make
go build  -ldflags "-w -s -X 'github.com/cilium/hubble/pkg.GitBranch=pr/michi/backportgogo' -X 'github.com/cilium/hubble/pkg.GitHash=848ff00' -X 'github.com/cilium/hubble/pkg.Version=0.6.1-dev'" -o hubble
% ./hubble version
hubble v0.6.1-dev@pr/michi/backportgogo-848ff00 compiled with go1.14 on darwin/amd64

@glibsm glibsm merged commit ef3d0b5 into v0.6 Jun 5, 2020
@glibsm glibsm deleted the pr/michi/backportgogo branch June 5, 2020 19:18
@michi-covalent michi-covalent added the release-note/bug This PR fixes an issue in a previous release of Hubble. label Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/bug This PR fixes an issue in a previous release of Hubble.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants