-
Notifications
You must be signed in to change notification settings - Fork 47
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
Cross compiling #36
Comments
Currently no, if you make a bundle from Linux it will only run in Linux (same for Mac). I could look into combining both Mac and Linux binaries into the bundle. There is another issue open on packaging this for multiple OSs, once I get that release process down this will easily be achievable. For the meantime I've updated the readme noting some of these caveats. |
Is this fixed now with goreleaser? See https://github.com/wagoodman/bashful/releases for all the releases. |
Needs a few more steps. When creating a bundle, a copy of bashful gets included in the binary generated. This means that if you bundle on Linux and run the bundle on Mac, it will fail since the bashful copy included was built for Linux. Simple fix would be to include both binaries in the bundle, which needs some thought. But that's gonna inflate the binary size by a factor of 2... Not really desirable. The last option is to make an os specific binary, which is fine, just boring :) . |
I didn't even know it's possible to include two binaries with different targeted OS's in one bundle. |
thats because I'm cheating: https://github.com/wagoodman/bashful/blob/master/main.go#L147 A 'bundle' in this case is just a shell script with a tar concatenated with it. The tar has bashful and other used files. The bash script knows how to separate itself from the tar, untar the tar, and run bashful. Kinda a weird solution but ends up being a powerfully simple way to 'just get a single "executable" ' from a collection of scripts. The fix here would be to update this self-extracting bash script to be platform aware and use the right copy of bashful in the process. |
That’s pretty cool. I didn’t know that’s possible. In the past, I have just used go releaser to create one file per distro. The only down side was a more complicated read me file for installing. Are there any other advantages to bundling everything in one tar? |
I have not managed to cross compile the bundle to a linux native from a macOS. Am I missing something? Is there a way to do it currently?
The text was updated successfully, but these errors were encountered: