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

chore: Refactor and rebuild binary asset #187

Merged
merged 3 commits into from
Sep 25, 2024
Merged

Conversation

ctlong
Copy link
Member

@ctlong ctlong commented Sep 24, 2024

What is this change about?

  • Bumps binary asset's minimum go version to go1.22.0.
  • Replaces build_app.sh with a lighter-weight Makefile.
  • Turns off cgo to make the binary static.
  • Renames and regenerates the binary.

Please provide contextual information.

None.

Please check all that apply for this PR:

  • introduces a new test (see *Note below)
  • changes an existing test
  • introduces a breaking change (other users will need to make manual changes when this change is released)

Did you update the README as appropriate for this change?

  • YES
  • N/A

How should this change be described in release notes?

Rebuild binary asset.

What is the level of urgency for publishing this change?

  • Urgent - unblocks current or future work
  • Slightly Less than Urgent

Tag your pair, your PM, and/or team!

None

Replaces build_app.sh with Makefile to make the script more lightweight
and clear.

It seems like the goal of the build_app.sh script is to build a new app
using the GOOS, GOARCH, and Go version associated with the cf-d-c-t
image. While that is somewhat useful its limited because that image
doesn't necessarily reflect the cflinuxfs that the app will be pushed
to. I think that its goals can all be accomplished by specifying the
values as env vars in a Makefile and using the new forward/backward
compatibility in Go. This Makefile also does not depend upon docker and
runs much faster.

Also turned off cgo with `CGO_ENABLED=0` to make the binary static.
Trivially renames the executable. If `-o` is not specified in `go build`
then the package name is used for the executable, which in this case is
`binary`. Prefer that to renaming the executable.
@ctlong ctlong requested review from a team September 24, 2024 15:56
Copy link

@dimivel dimivel left a comment

Choose a reason for hiding this comment

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

LGTM

@davewalter davewalter merged commit 8c6ef94 into main Sep 25, 2024
6 checks passed
@davewalter davewalter deleted the chore/assets/binary branch September 25, 2024 14:49
@iaftab-alam iaftab-alam mentioned this pull request Sep 26, 2024
7 tasks
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