-
Notifications
You must be signed in to change notification settings - Fork 249
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
running mage with GOOS=foo influences the GOOS of the compiled magefile #169
Comments
This is currently the only blocker for me to change most of my projects to magefile. Otherwise this is an absolutely awesome project! thanks! |
Ahh thanks for letting me know. I'll prioritize this, then. Glad you like it! :) |
Oh, note that you can always specify the environment variable for commands that you run explicitly, so like
But it would be nice to isolate mage compilation itself. |
Yup i found that already :) but for our build system i need to pass GOOS/GOARCH for all the OSes/Arches we build for (which is almost all legit combos :P) |
So, I just had to do this for one of my own projects, and my solution was to use a different name for the variables:
Not that I won't fix this, but this could be a fix in the meantime. |
this fixes #169 - mage now ignores GOOS and GOARCH in the environment when building its own binaries. The exception is if you use -goos or -goarch when running -compile.
* GOOS and GOARCH fixes this fixes #169 - mage now ignores GOOS and GOARCH in the environment when building its own binaries. The exception is if you use -goos or -goarch when running -compile.
iF you have a target that builds your code and you decide you want to run it with GOOS=windows ... Mage will try to compile the magefile with GOOS=windows, and if you're not on windows, it'll break.
i.e.
GOOS=windows mage build
will compile the magefile itself with GOOS=windows ... and then try to run it and fail if you're not on windows.
We need to isolate mage's own compilation from the standard environment variables, with the possibility of something like MAGEFILE_GOOS for when you want to produce a magefile binary of a specific os/arch.
The text was updated successfully, but these errors were encountered: