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

Consume LDFLAGS in Makefile #255

Merged
merged 2 commits into from
Sep 3, 2022
Merged

Conversation

agouin
Copy link
Contributor

@agouin agouin commented Sep 1, 2022

Context and purpose of the change

For static builds with CGO_ENABLED, we need to pass LDFLAGS='-linkmode external -extldflags "-static"'. This allows us to build a single statically linked binary for use in our heighliner docker images

Brief Changelog

Consume LDFLAGS env var and pass to go build -ldflags

Author's Checklist

This change is a trivial rework / code cleanup without any test coverage

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • reviewed state machine logic
  • reviewed API design and naming
  • manually tested (if applicable)
  • confirmed the author wrote unit tests for new logic
  • reviewed documentation exists and is accurate

Documentation and Release Note

  • Not documented because there are no changes to the documented build process. Documentation could be added later for static binary builds, but probably unnecessary.

@asalzmann
Copy link
Contributor

@agouin you should be good to merge now! the labeler action has a bug that prevents it from working properly on forks, so I removed the requirement from the branch

@riley-stride riley-stride merged commit 131e2a0 into Stride-Labs:main Sep 3, 2022
@agouin
Copy link
Contributor Author

agouin commented Sep 3, 2022

Thank you!

@agouin agouin deleted the andrew/ldflags branch September 3, 2022 00:07
riley-stride pushed a commit that referenced this pull request Sep 5, 2022
sontrinh16 pushed a commit to notional-labs/stride that referenced this pull request Mar 27, 2023
Co-authored-by: riley-stride <104941670+riley-stride@users.noreply.github.com>
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