Skip to content

Cross Compile Beats using mage #415

Answered by natefinch
serak asked this question in Q&A
Discussion options

You must be logged in to vote

Ahh, you hit a really weird edge case in the UX.

Compile requires a name to give the output binary. When you run that command line, the stdlib flags package thinks that you want the output binary to be called -goos=aix ... and thus doesn't treat that as a separate flag getting set. So, mage doesn't know you set -goos=aix at all.

so it should be mage -compile=beats_magefile -goos=aix -goarch=ppc64

It took me a while to understand this, because I, too, forgot that compile needs a filename, and the fact that the flags package will take the next string regardless of the fact that it starts with a dash is a little unintuitive.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by serak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants