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

circleci: fix build for ARM #79094

Closed
wants to merge 1 commit into from

Conversation

nandahkrishna
Copy link
Member

  • 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>?

This should hopefully get circleci built on ARM. I tried (for a few hours 😅) to remove GOPATH and get this built with our usual std_go_args, but it fails. Some observations:

  • packr doesn't seem to be compatible with the -trimpath flag, although I'm not too familiar with any of this.
  • Even without using -trimpath, removing GOPATH results in a binary that fails to work, with an error message indicating that data.yml couldn't be found (this is the resource that packr is used to handle).

I'm attaching a patch with one of my approaches, hopefully it helps someone more experienced debug the issue: circleci.patch.txt.

@nandahkrishna nandahkrishna added the CI-force-arm [DEPRECATED] Don't pass --skip-unbottled-arm to brew test-bot. label Jun 10, 2021
@BrewTestBot BrewTestBot added go Go use is a significant feature of the PR or issue no ARM bottle Formula has no ARM bottle labels Jun 10, 2021
Formula/circleci.rb Outdated Show resolved Hide resolved
@carlocab carlocab added the automerge-skip `brew pr-automerge` will skip this pull request label Jun 11, 2021
carlocab
carlocab previously approved these changes Jun 11, 2021
Copy link
Member

@carlocab carlocab left a comment

Choose a reason for hiding this comment

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

This seems fine to me, but adding automerge-skip in case someone else gets the chance to have a look.

@BrewTestBot BrewTestBot removed the automerge-skip `brew pr-automerge` will skip this pull request label Jun 11, 2021
@nandahkrishna nandahkrishna added the gopath deprecation Deprecate GOPATH in favor of Go Modules label Jun 11, 2021
@nandahkrishna
Copy link
Member Author

nandahkrishna commented Jun 11, 2021

Seems like packr wasn't walking the directories like it was supposed to when removing GOPATH. Even when building in the checked out repository, moving the resulting binary elsewhere caused problems. I seem to have got it to work using the --ignore-imports flag for packr2, which forces the behaviour we need. Using -trimpath also works now, my earlier statement was based on an issue with an older version of packr.

I'm going to try asking upstream if they can move away from using packr, as it doesn't seem to be actively maintained. The last commit was in Nov 2020 along with the latest release, and there's some discussion in gobuffalo/packr#252. Also, there's a note in the README pointing to an alternative to use instead.

@BrewTestBot
Copy link
Member

🤖 A scheduled task has triggered a merge.

@nandahkrishna nandahkrishna deleted the circleci-fix branch June 11, 2021 22:08
@github-actions github-actions bot added the outdated PR was locked due to age label Jul 12, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI-force-arm [DEPRECATED] Don't pass --skip-unbottled-arm to brew test-bot. go Go use is a significant feature of the PR or issue gopath deprecation Deprecate GOPATH in favor of Go Modules no ARM bottle Formula has no ARM bottle outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants