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

GenerateLDFlags function doesn't work on OSX #90

Closed
rappizs opened this issue Aug 14, 2023 · 5 comments · Fixed by #91
Closed

GenerateLDFlags function doesn't work on OSX #90

rappizs opened this issue Aug 14, 2023 · 5 comments · Fixed by #91

Comments

@rappizs
Copy link

rappizs commented Aug 14, 2023

The getBuildDateTime helper function, which is called by mage.GenerateLDFlags, doesn't work under OSX. The date command is a little bit different on OSX than on Linux and doesn't support the -d flag, therefore on OSX we get this error when trying to use mage.GenerateLDFlags: date: illegal option -- d

The exact problem is here:

date, err := shx.Output("date", "-u", "-d", sourceDateEpoch, "+%Y-%m-%dT%H:%M:%SZ")

@saschagrunert
Copy link
Member

Hm, we can probably generate the date from native golang libraries other than relying on GNU date.

@rappizs
Copy link
Author

rappizs commented Aug 14, 2023

Already created a fix for it using GNU date: rappizs@e925304, but I agree that maybe some native go solution would be better.

@saschagrunert
Copy link
Member

Yeah, like this: #91

@rappizs
Copy link
Author

rappizs commented Aug 14, 2023

Awesome, thanks for the quick fix @saschagrunert!

@justaugustus
Copy link
Member

Thanks @saschagrunert!

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.

3 participants