Skip to content

Enable LDFLAGS to be read from environment #7505

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

Open
johanneslarsson opened this issue Apr 10, 2025 · 1 comment
Open

Enable LDFLAGS to be read from environment #7505

johanneslarsson opened this issue Apr 10, 2025 · 1 comment

Comments

@johanneslarsson
Copy link
Contributor

We've started to build opa ourself. But for our monitoring system to work we need to be able to set LDFLAGS as input to the build command.

What is the underlying problem you're trying to solve?

Currently we have to modify the Makefile after cloning the source.

sed -i '/$(TELEMETRY_FLAG) \\/c\ LDFLAGS := "$(LDFLAGS) $(TELEMETRY_FLAG) \\' Makefile
WASM_ENABLED=0 LDFLAGS="-linkmode=external" make build

Describe the ideal solution

WASM_ENABLED=0 LDFLAGS="-linkmode=external" make build

It's a oneliner change to enable LDFLAGS to be set and I could submit a merge request if you think its valuable?

@srenatus
Copy link
Contributor

srenatus commented Apr 10, 2025

It does change the contract slightly -- with the change, we better keep using LDFLAGS in the way we do to not break anyone's build scripts. I think we cannot guarantee that, but since you're building from source on your own, this might not be a problem. 🤔

I mean, noone is going to break your build on purpose, but if a future change introduces goreleaser, for example, things could have to be adapted again...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants