4 ms·
I love that the author provides docker images for cross compilation. Cross compilation environments are such a pain to setup and maintain - having docker images
by nickcw 10y ago
I love that the author provides docker images for cross compilation. Cross compilation environments are such a pain to setup and maintain - having docker images with all that stuff in is a major step forward.
Next time I want to build a desktop app I'll have a go with this for definite.
- herge 10y agoDocker will only let you cross-compile to OSes with the same kernel, which is relatively limited. A full set of say vagrant files would be slower, but a lot more polyvalent (but even then it would not let you, say, compile a windows binary from linux).
- detaro 10y agoYou can cross-compile to completely different environments. It just can be tricky to set up, so prepared docker images with e.g. the toolchain to build a Windows executable on Linux are great to have, and what is provided here.
- cryptarch 10y agoI think it's a nice idea in theory to provide cross-compilation support by means of emulating all possible target architectures on the compiling machine. Then I remember that I'd be managing a custom heterogenous compute cluster just to compile some code.
- mentat 10y agoIt's not emulation, it's cross-compilation which has existed basically forever. You don't have to target the same instruction set as the one you're compiling on.
- cryptarch 10y agoI am well aware of that, I was referencing the concept of "cross-compilation" the GP seemed to have.
- mentat 10y agoI see what you mean now, using like qemu or something. So "emulated native compilation". It is an interesting concept. Sorry for misunderstanding you.
- cryptarch 10y agoIndeed, "virtualbox-the-crosscompiler" (probably from hell). QEMU would be a few orders of magnitude slower but I think it supports many more archs. No hard feelings :)
- seiferteric 10y agoAs long as they provide the correct kernel headers and library headers (libc etc) for your target, it should work fine in docker.
- lmb 10y agoGo doesn't really use libc all that much. Syscalls are also implemented in pure go + as, so there aren't really header files to provide. That makes for a great cross-compilation story.
- therecipe 10y agoauthor here; Using Docker saved me from creating the code to cross compile from windows->linux, darwin->linux/windows, ... And this alone was worth it, but being able to ship something that works out of the box is nice a nice bonus :) edit: I'm also planning to create macOS and iOS target images.