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

terraform: match upstream ldflags for version #127490

Closed
wants to merge 1 commit into from

Conversation

cho-m
Copy link
Member

@cho-m cho-m commented Apr 4, 2023

Closes #127453

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

See https://github.com/hashicorp/terraform/actions/runs/4568417937/jobs/8063451319#step:5:11

  go build -ldflags "-w -s -X 'github.com/hashicorp/terraform/version.Version=1.4.4' -X 'github.com/hashicorp/terraform/version.Prerelease='" -o dist/ .

and https://github.com/hashicorp/terraform/blob/v1.4.4/.github/scripts/get_product_version.sh#L28-L29

LDFLAGS="${LDFLAGS} -X 'github.com/hashicorp/terraform/version.Version=${BASE_VERSION}'"
LDFLAGS="${LDFLAGS} -X 'github.com/hashicorp/terraform/version.Prerelease=${PRERELEASE}'"

@github-actions github-actions bot added the go Go use is a significant feature of the PR or issue label Apr 4, 2023
]
end

system "go", "build", *std_go_args(ldflags: ldflags)
end

test do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's perhaps add a test to ensure that the right version number is returned – will also help us check if this worked as intended.

@SMillerDev
Copy link
Member

I don't think we should override it if upstream sets this already

@cho-m
Copy link
Member Author

cho-m commented Apr 4, 2023

I guess we can wait for upstream build system changes to finalize if they introduce hashicorp/terraform#32973 to align version number / pre-release info.

May need to check on how next upstream build flow looks to see if that goes in or we need to manually set github.com/hashicorp/terraform/version.Prerelease to remove -dev label on version number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Go use is a significant feature of the PR or issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

terraform formula installs incorrect version of binary
3 participants