Like most programming language, in a logic statement `A && B || C`,
bash will not evaluate B if A is false (failing in our case).
Using `A && (B || C)` to prevent that.
A build error in the Windows 32-bit Mono build thus caused skipping
all subsequent `ln` statements up until `|| /bin/true`, which is used
to link only the folders which are missing from the self-built mono
prefix.
The build error still needs to be fixed but it doesn't seem to prevent
using the resulting container to build 32-bit Windows binaries.
This can be reverted once a proper fix has been deployed in upstream
Mono. No ETA yet as we're busy and it's unlikely to happen if we don't
do it ourselves :)
Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
Specifying only a branch like '2019-08' is problematic if upstream commits
something between the builds of two containers.
We could make a tarball in the first container build and reuse that, but we
need the flexibility of Git for some patching in the Android and JavaScript
builds, so instead we allow specifying a git tree-ish as the third argument.
We can therefore also give a pretty version string to use for the image name
as second argument, e.g. 6.6.0.160 for bef1e6335812d32f8eab648c0228fc624b9f8357.
As we can't `git clone` a commit hash directly, we still need to provide both
branch name and then commit hash for this use case.
Cherry-pick the whole https://github.com/mono/mono/pull/16636
We were also attempting to patch the wrong folder previously (I had it
working in my local tests but committed the wrong patch when rebasing
to make the Git history pretty... :)).
To get WebAssembly templates to actually work, we need to use
Mono 6.6 (currently in preview), which doesn't have tags yet
but is in the `2019-08` branch. So I dehardcoded the `mono-`
prefix for the git tree-ish to allow using `./build.sh 2019-08`.
6.6 doesn't build with msbuild 16.0, so I'm upgrading to its
matching version 16.3. There are no DEB files for 16.3 on the
EOL'ed Ubuntu 14.04, but it seems that the 16.04 packages install
cleanly.
We also backport a patch from mono's master branch to fix wasm
support further, and enable parallel build jobs for make.
The osxcross installation process has been improved and now supports
more recent versions of Xcode than 7, so most of our custom code is
no longer needed.
The xcode packer could also be reworked to use osxcross' SDK packing
script.
Fixes#15.
The previous `['/bin/bash']` was not working, running the image
with `podman run -it <name>` would evaluate to:
```
> sh -c ['/bin/bash']
sh: [/bin/bash]: No such file or directory
```
We force using Emscripten 1.38.47 as there is a regression in 1.38.48
and 1.39.x which makes the generation of our .wasm file fail.
Up until now we used the desktop BCL (compiled with desktop Mono)
for both desktop and Android, but that does not work for WebAssembly
(and we suspect Android issues related to it).
So we now build the Android and WebAssembly BCLs in the relevant
containers, which are later copied in the templates directory to
include on export. We already have the desktop BCL from the regular
build.
The main reason is that upstream Mono tends to miss some
important files in its tarballs, so Git tags appears to be
a more reliable medium.
Also group RUN commands to reduce the number of intermediate
dependencies.
This saves us from pulling gtk2 and gtk3 as weak deps of
perl and git or whatnot... And we don't need to pull in all
the documentation on Ubuntu.
Also ensures that we properly run `dnf clean all` after each
installation.