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

When compiling mage statically, cannot pass ldflags #320

Closed
tukeJonny opened this issue Oct 26, 2020 · 2 comments · Fixed by #322
Closed

When compiling mage statically, cannot pass ldflags #320

tukeJonny opened this issue Oct 26, 2020 · 2 comments · Fixed by #322

Comments

@tukeJonny
Copy link
Contributor

tukeJonny commented Oct 26, 2020

Thanks

I'm one user who has used this project.
Thank you so much for always developing and maintaining compatibility!

Requirement (business use case)

Add additional information to mage static binary via -ldflags .

For example, a use case for -ldflags would be if you want to verify that the mage binary is an up-to-date magefile.go binary.

By using -ldflags to embed the hash value in the mage binary, you can compare it with the latest magefile.go's hash to see if it is the latest one.

It's also useful to include Git information.

Problem

Currently, when compiling mage statically, mage doesn't support ldflags flag.

Proposal

Add a new flag -ldflags for mage.

This flag can be used in case of passed -compile flag.

I want to add this flag around here.

Remark

I have a patch for this issue.
So, i can send a PR.
Thanks!

@tukeJonny
Copy link
Contributor Author

tukeJonny commented Nov 4, 2020

If this issue is acceptable, would you please review #322 ?

@natefinch
I'm sorry to bother you...
Does anyone can handle this issue?

@natefinch
Copy link
Member

Yeah this seems like a good addition. I'll do a proper review today or tomorrow.

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 a pull request may close this issue.

2 participants