<div dir="ltr">Amazing work! Thank you for doing this!<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 19, 2021 at 8:20 AM Philippe Valembois via scummvm-devel <<a href="mailto:scummvm-devel@lists.scummvm.org">scummvm-devel@lists.scummvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi everyone,<br>
<br>
For the last year I spent most of my time on modernizing our current<br>
Buildbot server.<br>
My work is available on my Github account:<br>
<a href="https://github.com/lephilousophe/dockerized-bb/" rel="noreferrer" target="_blank">https://github.com/lephilousophe/dockerized-bb/</a><br>
Obviously, I will migrate it to ScummVM organization when admins decide to.<br>
<br>
This repository includes a massive overhaul of the Buildbot<br>
architecture, the master configuration and the toolchains.<br>
As of today, I think the new Buildbot is quite ready and could replace<br>
the old one.<br>
For those interested, it is available for testing at<br>
<a href="https://al.scummvm.net/buildbot/" rel="noreferrer" target="_blank">https://al.scummvm.net/buildbot/</a><br>
<br>
I currently need porters to test the snapshots produced by this new<br>
Buildbot. It's difficult for me to ensure that every port still works<br>
as I don't own any console nor Apple products. :D<br>
I tested some platforms (Linux based ones with QEmu, emulators for<br>
others) but more intensive tests on real environments would be better.<br>
So, please grab your favorite environment, and report your test<br>
results. Hopefully we'll quickly fix any issues you may encounter.<br>
Drop me an email, this will let me keep track of which platform is<br>
working or which one has bugs.<br>
<br>
Hereafter is a mostly exhaustive introduction of the main changes.<br>
Porters can skip parts by looking at their specific platforms only.<br>
<br>
== Architecture ==<br>
<br>
The old Buildbot consists of a master process and a worker process<br>
running in the same environment.<br>
Therefore, an upgrade of the whole server to use a newer Debian could<br>
break all toolchains.<br>
<br>
The new Buildbot has a master process and spawns a Docker container<br>
which contains the worker and the toolchain used to build ScummVM.<br>
This means that toolchains are decoupled from the master and can be<br>
upgraded individually when time is convenient.<br>
<br>
== Master configuration ==<br>
<br>
Most of the changes are related to the migration to the latest<br>
buildbot version (version 3.0, ready for future!).<br>
In addition, I tried to split the configuration file into smaller<br>
files which can be browsed more easily. For example, the platforms are<br>
defined in a dedicated file and builds in another one.<br>
I took advantage of this migration to improve usability: I added a new<br>
IRC bot provided by Buildbot, and a brand new Discord webhook which<br>
tries to present failures and successes in a clean way. It should be<br>
easy to see if all builds are successful or not.<br>
Besides, after a successful nightly build, the package generated is<br>
linked directly in the build step. This let a developer grab specific<br>
nightly snapshots for bisecting tests.<br>
On a side note, snapshot list is now dynamically built and adding a<br>
platform doesn't require to run a script on the server anymore (that<br>
was mainly due to the fact the new Buildbot version doesn't allow to<br>
serve static files anymore).<br>
The cleaning step got the same treatment and is executed inside<br>
Buildbot after every nightly build. For now, only the 14 last<br>
snapshots are kept and snapshots older than 1 month are destroyed.<br>
<br>
== Toolchains ==<br>
<br>
The toolchains side is where I put the most effort. I tried to update<br>
them as much as I could. This implied sometimes upgrading components<br>
above what original (and abandoned) toolchains provided.<br>
<br>
A vast majority of platforms are split in two parts: a toolchain image<br>
and a worker image.<br>
Toolchain one is where all components got generated and could be used<br>
by anyone wanting to compile ScummVM on the platform using a shell<br>
(docker run -it toolchains/<toolchain>).<br>
Worker one is dedicated to Buildbot. It automatically spawns a<br>
buildbot worker ready to make use of the toolchain.<br>
<br>
Two objectives of the overhaul were to ease building and upgrade of a<br>
toolchain, and make them available to everyone.<br>
When it was possible, reproducibility was targeted.<br>
It's also possible to pull images from Docker hub:<br>
<a href="https://hub.docker.com/r/lephilousophe/scummvm" rel="noreferrer" target="_blank">https://hub.docker.com/r/lephilousophe/scummvm</a><br>
<br>
Please note that Apple based toolchains are not publicly available<br>
because the SDK isn't freely redistributable. If you want them, you<br>
will need to create an Apple developer account, download Xcode and<br>
build images.<br>
<br>
Toolchains, as of today, are all based on the current Debian release.<br>
Some toolchains source code had to be patched to let them compile with<br>
recent Debian tools.<br>
<br>
Each image is built using a Dockerfile preprocessed by GNU M4. The<br>
language is quite... outdated but it fits well and I think recipes are<br>
quite clear without too much repeat.<br>
<br>
Now I will try to list changes on every toolchain compared to current Buildbot.<br>
First the bad news, during this process I had to drop two platforms:<br>
<br>
- ios(< 7): I am not sure how this one was built and how easy it would<br>
be to update it. Plus, these iPhone are now quite old. If someone can<br>
explain to me how to create one, I could add it back.<br>
<br>
- n64: the port is unmaintained (last release 1.6.0) and the main<br>
library (libn64) isn't available anymore except on Web archive.<br>
<br>
Now, the new platforms:<br>
- macosx-arm64: this is the new architecture from Apple.<br>
There is still a bug with ldid which is supposed to fake sign package<br>
on Linux (equivalent of codesign on Apple which is not open source).<br>
Builds must be un-quarantined before launching them.<br>
<br>
- raspberrypi: this toolchain aims at supporting all RPi generations<br>
using Raspbian.<br>
<br>
- riscos: thanks to @ccawley2011 there is now a RiscOS platform on the buildbot.<br>
<br>
Finally, the updated platforms:<br>
- AmigaOS4:<br>
  - it's based on <a href="https://github.com/sba1/adtools" rel="noreferrer" target="_blank">https://github.com/sba1/adtools</a><br>
  - it has a GCC 9.1 (in place of 8.3)<br>
  - dependencies are downloaded directly from OS4Depot so they should<br>
get updates when the image is rebuilt<br>
  - ARexx is used to execute REXX scripts and some shims have been<br>
developed for AmigaOS specific commands (this let packaging work)<br>
<br>
- Android : nothing really changed as the current toolchain is quite up to date.<br>
<br>
- Caanoo :<br>
  - original toolchain from GamePark was available on binary form only<br>
on Web archive<br>
  - it has been recreated from scratch using Crosstool-NG<br>
  - a new GCC (8.3.0) is used with the original glibc and kernel headers<br>
  - versions of libraries present in toolchain have been matched so<br>
they are used by binary<br>
  - static libraries are built when they were missing<br>
<br>
- Nintendo :<br>
  - all Nintendo consoles use up-to-date DevkitPro binary builds<br>
  - it was just a matter of adding missing libraries<br>
<br>
- Dreamcast :<br>
  - I used the same GCC version as the one chosen by KallistiOS for<br>
testing (ie. GCC 9.3.0 instead of GCC 4.6.3)<br>
  - libronin (which seems abandoned) has been patched to support it<br>
<br>
- GCW0 :<br>
  - original toolchain is based on buildroot fork available on Github<br>
  - Crosstool-NG is used to get a newer GCC (8.3.0 instead of 4.9.1)<br>
  - all ScummVM dependencies have been migrated from buildroot to have<br>
a matching ABIs (like in Caanoo).<br>
<br>
- iPhone (ios7) :<br>
  - based on cctools-port from<br>
<a href="https://github.com/tpoechtrager/cctools-port" rel="noreferrer" target="_blank">https://github.com/tpoechtrager/cctools-port</a> is used<br>
  - LLVM 11 is used for compilation (instead of 3.7.1)<br>
  - Migration to arm64 (instead of armv7 as it isn’t supported on<br>
recent iOS anymore)<br>
<br>
- MacOSX (x86 and x86_64)<br>
  - based on OSXCross from <a href="https://github.com/tpoechtrager/osxcross/" rel="noreferrer" target="_blank">https://github.com/tpoechtrager/osxcross/</a><br>
  - LLVM 11 is used for compilation (instead of LLVM 7.0.1 and GCC 4.2)<br>
  - sadly, for x86, the libstdc++ used is the original one which<br>
misses several C++11 features. It seems we could build a newer<br>
libstdc++ to get C++11 support (TODO).<br>
<br>
- Windows x86 and x86_64<br>
  - based on MXE (<a href="https://mxe.cc/" rel="noreferrer" target="_blank">https://mxe.cc/</a>)<br>
  - GCC 5.5 is used but there seems to be experimental support for<br>
newer GCC (to be tested).<br>
  - versions of libraries are the one provided by MXE<br>
<br>
- GP2X<br>
  - old GamePark console<br>
  - uses unmaintained Open2x toolchain source from<br>
<a href="https://sourceforge.net/projects/open2x/" rel="noreferrer" target="_blank">https://sourceforge.net/projects/open2x/</a><br>
  - locked to this toolchain because the whole console Linux is based<br>
on now obsolete ARM OABI<br>
<br>
- OpenDingux<br>
  - based on original buildroot fork found at<br>
<a href="https://github.com/mthuurne/opendingux-buildroot" rel="noreferrer" target="_blank">https://github.com/mthuurne/opendingux-buildroot</a><br>
  - Crosstool-NG is used to get a newer GCC (8.3.0 instead of 4.4.2)<br>
  - all ScummVM dependencies have been migrated from buildroot to have<br>
a matching ABIs (like in Caanoo).<br>
<br>
- OpenPandora<br>
  - based on official toolchain bits at <a href="https://github.com/openpandora" rel="noreferrer" target="_blank">https://github.com/openpandora</a><br>
and Angstrom, Yocto, ...<br>
  - Crosstool-NG is used to get a newer GCC (8.3.0 instead of 4.3.3)<br>
  - all ScummVM dependencies have been migrated from toolchain to have<br>
a matching ABIs (like in Caanoo).<br>
<br>
- PS3<br>
  - using up to date toolchain from <a href="https://github.com/ps3dev" rel="noreferrer" target="_blank">https://github.com/ps3dev</a><br>
  - libSDL is from bgK's Github<br>
<br>
- PSP<br>
  - using up to date toolchain from <a href="https://github.com/pspdev" rel="noreferrer" target="_blank">https://github.com/pspdev</a><br>
<br>
- Vita<br>
  - using up to date toolchain from <a href="https://github.com/vitasdk" rel="noreferrer" target="_blank">https://github.com/vitasdk</a><br>
<br>
Obviously, the Debian platform is still present in x86, x86_64 and<br>
clang flavours. This is based on the latest Debian stable.<br>
Special flavours which compile using plugins have been added to spot<br>
specific failures.<br>
C++11 flavours have been dropped as we use it by default everywhere now.<br>
No toolchain image is specifically built, as it's easy to have a one<br>
(hello APT),<br>
<br>
If you think your platform could fit well on the buildbot, don't<br>
hesitate: we can bring it to Buildbot together. The main prerequisite<br>
is that we can cross-compile from Linux.<br>
<br>
As a side note, there is a check-versions script which helps to track<br>
all versions used in the toolchains. It searches for new versions of<br>
toolchains and libraries used in the Buildbot. That should make the<br>
task of updating more easy.<br>
<br>
Regards,<br>
Phil (@lephilousophe on Discord or IRC)<br>
_______________________________________________<br>
scummvm-devel mailing list<br>
<a href="mailto:scummvm-devel@lists.scummvm.org" target="_blank">scummvm-devel@lists.scummvm.org</a><br>
<a href="https://lists.scummvm.org/listinfo/scummvm-devel" rel="noreferrer" target="_blank">https://lists.scummvm.org/listinfo/scummvm-devel</a><br>
</blockquote></div>