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
Multiarch docker build, outsource most docker commands to docker-helper script #26
Conversation
…docker-helpers/ folder Docker file now builds: - linux-amd64 - linux-i686 - linux-arm64 - linux-armhf - windows-amd64 - windows-i686 - vm
ec6c75d
to
e76695c
Compare
|
After some thoughts I also enabled Also some of those arm devices only have proprietary OpenGL drivers for the 32-bit variant, so the ones who wants to run the proprietary driver instead of the open source one for whatever reasons are expected to run 32-bit arm. |
3b1df19
to
3a31d6a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approach of putting several helper scripts in one file is unfortunate as it breaks caching. For example if you want to change something about build-external-dependencies, then you have to go and re-download everything from the package manager again because every step depends on the script. It would be better if each step is a different script.
If you implement the comment to put all APT steps together and put the not-very-complex git clone step back in the Dockerfile, then you would need just two helper scripts.
1eca52a
to
3943d87
Compare
|
Ok, so I did a huuuge rewrite. Now every binaries are built in docker, including macOS. The macOS build is done using Darling which is a kind of Wine but for implementing macOS compatibility layer above Linux. I was hoping to do everything in a single simple Docker file like before but right now it doesn't look like easily possible. Darling provides ready to use binaries… for Ubuntu focal and later, but we build everything else on Debian buster. Then, running Darling doesn't work in docker without giving to docker some privileges that are usually not given. Unfortunately the options to give those privileges at After that the tasks to build the release binaries are simply run (no caching), as I don't really see the need for it. Everything before building the release targets are cached, including installing Xcode and Homebrew in Darling, and building Linux external dependencies (that are built right after the repositories are cloned). A single folder from the host is shared across the various docker images, meaning they all write the release targets in the same folder. Then a simple docker tasks can optionally be called to merge the unizip from those build targets. Unfortunately I haven't got Darling-in-docker not running as non-root (yet?) because just setting Due to the extra complexity, Docker isn't meant to be called directly by users, I added the I updated the README with some documentation, basically one can just do that: ./docker-build --reference=af7e8ccf --targets=all --unizipAnd get an Built files are written in |
581d41e
to
acfe650
Compare
|
I'm concerned by the Linux supremacy here, so to speak. Before, I could run the Docker build on my Windows machine (with the "Docker Desktop" distribution; it uses the WSL infrastructure but you invoke it from the Windows command shells). Now the only permissible way to invoke it is through a driver script which assumes a Linux host. And regarding the Mac build, I can no longer produce and test a realistic release on a Mac machine, because MacOS is no longer the build environment used for the release. P.S. does anyone else remember Unvanquished/Unvanquished#2200? 😆 |
I can rewrite the On the specific topic of Windows compatibility for running the docker files, this just brings some questions to me:
|
|
Wait, isn't running Linux containers in Docker requiring WSL2 anyway? |
acfe650
to
dc06c50
Compare
I don't think so
No idea
I described the situation in #26 (comment) |
I don't get this. It is still possible to build the mac release on macOS using the |
|
If you want to run |
dc06c50
to
4faca25
Compare
|
I rewrote the I also had to force Homebrew to use an older version of itself to still be compatible with the Xcode cli installable with |
2f5a039
to
74dbfd0
Compare
|
@slipher would you be able to test this on Windows? This would be a good start: python3 docker-build --reference 85dee939 --targets linux-amd64It should produce Edit: Building everything can be done this way: python3 docker-build --reference 85dee939 --targets all --unizipIf docker is not in path, one can do: python3 docker-build --docker <docker path> # … |
|
Honestly maybe it doesn't matter whether it runs on Windows because if I wanted to test something e.g. with a Linux static build, I would dig out the old version of the Docker script rather than trying to use this. I could still try it on Windows if you really want. |
06c0fce
to
4b035aa
Compare
|
I kept the old Docker script so this PR only adds an alternative way of doing things without breaking the old way. |
Multiarch docker build, outsource most docker commands to some scripts in
docker/folder.Docker file now builds:
linux-amd64linux-i686linux-arm64linux-armhfwindows-amd64windows-i686macos-amd64vm