4 ms·
Compiling Go code is super easy; but how easy it is to cross-compile from e.g. OS X to Linux? Or from Windows to Linux? And would there be an advantage over the
by jpetazzo 14y ago
Compiling Go code is super easy; but how easy it is to cross-compile from e.g. OS X to Linux? Or from Windows to Linux? And would there be an advantage over the current situation? (This is a genuinely naive question; I'm fairly new to Go!)
- shykes 14y agoSupport for cross-compiling is definitely awesome in Go. Here's a good walkthrough: http://dave.cheney.net/2012/09/08/an-introduction-to-cross-compilation-with-go http://dave.cheney.net/2012/09/08/an-introduction-to-cross-c... It's not out-of-the-box though. You still have to build Go itself once for each target, so kencochrane is right: it's still easier to rely on dotCloud to build server-side.
- NateDad 14y agoCross compiling is easy. Follow the steps here: http://dave.cheney.net/2012/09/08/an-introduction-to-cross-compilation-with-go http://dave.cheney.net/2012/09/08/an-introduction-to-cross-c... You can compile from any OS, for any OS. I compile for 32 and 64 bit versions of Windows, OSX, and Linux for my applications. It takes about 5 seconds for all the builds (running serially) to complete. [edit] Bah, beat by shykes. It's still not hard.
- deleted 14y ago[deleted]