Skip to content

Commit 1aec865

Browse files
committed
mono: Update msbuild to 16.3, support for git branches
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.
1 parent f7a44c6 commit 1aec865

File tree

8 files changed

+86
-23
lines changed

8 files changed

+86
-23
lines changed

Dockerfile.android

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mand
1616
ENV ANDROID_HOME=/root/sdk/
1717
ENV ANDROID_NDK_ROOT=/root/sdk/ndk-bundle/
1818

19-
RUN git clone https://github.com/mono/mono --branch mono-${mono_version} --single-branch && \
19+
RUN git clone https://github.com/mono/mono --branch ${mono_version} --single-branch && \
2020
cd mono && git submodule update --init && cd .. && \
2121
export MONO_SOURCE_ROOT=/root/mono && \
22+
export make="make -j" && \
2223
git clone https://github.com/godotengine/godot-mono-builds && \
2324
cd godot-mono-builds && \
2425
git checkout bd129da22b8b9c96f3e8b07af348cc5fb61504bf && \

Dockerfile.javascript

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ RUN dnf -y install --setopt=install_weak_deps=False \
1111
./emsdk activate 1.38.47-upstream && \
1212
echo "source /root/emsdk/emsdk_env.sh" >> /root/.bashrc
1313

14-
RUN git clone https://github.com/mono/mono --branch mono-${mono_version} --single-branch && \
14+
RUN git clone https://github.com/mono/mono --branch ${mono_version} --single-branch && \
1515
cd mono && git submodule update --init && cd .. && \
1616
export MONO_SOURCE_ROOT=/root/mono && \
17+
export make="make -j" && \
1718
git clone https://github.com/godotengine/godot-mono-builds && \
1819
cd godot-mono-builds && \
1920
git checkout bd129da22b8b9c96f3e8b07af348cc5fb61504bf && \
2021
python3 patch_emscripten.py && \
22+
git am -3 /root/files/patches/mono-wasm-avoid-aligning-stack-bounds.patch && \
2123
python3 wasm.py configure --target=runtime && \
2224
python3 wasm.py make --target=runtime && \
2325
cd /root/mono && git clean -fdx && NOCONFIGURE=1 ./autogen.sh && \

Dockerfile.mono

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@ RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mand
66
dnf -y install --setopt=install_weak_deps=False \
77
autoconf automake cmake gcc gcc-c++ gettext libtool perl python && \
88
dnf clean all && \
9-
git clone https://github.com/mono/mono --branch mono-${mono_version} --single-branch && \
9+
git clone https://github.com/mono/mono --branch ${mono_version} --single-branch && \
1010
cd mono && git submodule update --init && \
1111
NOCONFIGURE=1 ./autogen.sh && \
1212
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib/mono --disable-boehm && \
1313
make -j && \
1414
make install && \
1515
cd .. && \
1616
cert-sync /etc/pki/tls/certs/ca-bundle.crt && \
17-
rpm -ivh --nodeps https://download.mono-project.com/repo/centos8-stable/m/msbuild/msbuild-16.0+xamarinxplat.2018.09.26.17.53-0.xamarin.5.epel8.noarch.rpm \
18-
https://download.mono-project.com/repo/centos8-stable/m/msbuild-libhostfxr/msbuild-libhostfxr-2.0.0.2017.07.06.00.01-0.xamarin.3.epel8.x86_64.rpm \
19-
https://download.mono-project.com/repo/centos8-stable/m/msbuild/msbuild-sdkresolver-16.0+xamarinxplat.2018.09.26.17.53-0.xamarin.5.epel8.noarch.rpm \
20-
https://download.mono-project.com/repo/centos8-stable/n/nuget/nuget-4.7.0.5148.bin-0.xamarin.2.epel8.noarch.rpm && \
17+
rpm -ivh --nodeps \
18+
https://download.mono-project.com/repo/centos8-stable/m/msbuild/msbuild-16.3+xamarinxplat.2019.08.08.00.55-0.xamarin.2.epel8.noarch.rpm \
19+
https://download.mono-project.com/repo/centos8-stable/m/msbuild-libhostfxr/msbuild-libhostfxr-3.0.0.2019.04.16.02.13-0.xamarin.4.epel8.x86_64.rpm \
20+
https://download.mono-project.com/repo/centos8-stable/m/msbuild/msbuild-sdkresolver-16.3+xamarinxplat.2019.08.08.00.55-0.xamarin.2.epel8.noarch.rpm \
21+
https://download.mono-project.com/repo/centos8-stable/n/nuget/nuget-5.2.0.6090.bin-0.xamarin.1.epel8.noarch.rpm && \
2122
rm -rf /root/mono
2223

2324
CMD /bin/bash

Dockerfile.osx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mand
1515
ENV OSXCROSS_ROOT=/root/osxcross
1616
ENV PATH="/root/osxcross/target/bin:${PATH}"
1717

18-
RUN git clone https://github.com/mono/mono --branch mono-${mono_version} --single-branch && \
18+
RUN git clone https://github.com/mono/mono --branch ${mono_version} --single-branch && \
1919
cd mono && git submodule update --init && \
2020
export CMAKE=/root/osxcross/target/bin/x86_64-apple-darwin18-cmake && \
2121
NOCONFIGURE=1 ./autogen.sh && \

Dockerfile.ubuntu-32

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,24 @@ RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mand
2020
ln -sf /usr/bin/gcc-8 /usr/bin/gcc && \
2121
ln -sf /usr/bin/g++-8 /usr/bin/g++
2222

23-
RUN git clone https://github.com/mono/mono --branch mono-${mono_version} --single-branch && \
23+
RUN git clone https://github.com/mono/mono --branch ${mono_version} --single-branch && \
2424
cd mono && git submodule update --init && \
2525
NOCONFIGURE=1 ./autogen.sh && \
2626
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib/mono --disable-boehm --host=i386-linux-gnu && \
2727
make -j && \
2828
make install && \
2929
cd .. && \
3030
cert-sync /etc/ssl/certs/ca-certificates.crt && \
31-
wget https://download.mono-project.com/repo/ubuntu/pool/main/m/msbuild/msbuild_16.0+xamarinxplat.2018.09.26.17.53-0xamarin3+ubuntu1404b1_all.deb && \
32-
wget https://download.mono-project.com/repo/ubuntu/pool/main/c/core-setup/msbuild-libhostfxr_2.0.0.2017.07.06.00.01-0xamarin21+ubuntu1404b1_i386.deb && \
33-
wget https://download.mono-project.com/repo/ubuntu/pool/main/m/msbuild/msbuild-sdkresolver_16.0+xamarinxplat.2018.09.26.17.53-0xamarin3+ubuntu1404b1_all.deb && \
34-
wget https://download.mono-project.com/repo/ubuntu/pool/main/n/nuget/nuget_4.7.0.5148.bin-0xamarin2+ubuntu1404b1_all.deb && \
31+
rm -rf /root/mono && \
32+
wget https://download.mono-project.com/repo/ubuntu/pool/main/m/msbuild/msbuild_16.3+xamarinxplat.2019.08.08.00.55-0xamarin2+ubuntu1604b1_all.deb && \
33+
wget https://download.mono-project.com/repo/ubuntu/pool/main/c/core-setup/msbuild-libhostfxr_3.0.0.2019.04.16.02.13-0xamarin3+ubuntu1604b1_i386.deb && \
34+
wget https://download.mono-project.com/repo/ubuntu/pool/main/m/msbuild/msbuild-sdkresolver_16.3+xamarinxplat.2019.08.08.00.55-0xamarin2+ubuntu1604b1_all.deb && \
35+
wget https://download.mono-project.com/repo/ubuntu/pool/main/n/nuget/nuget_5.2.0.6090.bin-0xamarin1+ubuntu1604b1_all.deb && \
3536
dpkg -i --force-all *.deb && \
3637
sed -i '/Depends.*mono/d' /var/lib/dpkg/status && \
3738
ln -s /usr/bin/mono /usr/bin/cli && \
3839
apt-get clean && \
3940
rm -rf /var/lib/apt/lists/ && \
40-
rm *.deb && \
41-
rm -rf /root/mono
41+
rm *.deb
4242

4343
CMD /bin/bash

Dockerfile.ubuntu-64

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,24 @@ RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mand
2020
ln -sf /usr/bin/gcc-8 /usr/bin/gcc && \
2121
ln -sf /usr/bin/g++-8 /usr/bin/g++
2222

23-
RUN git clone https://github.com/mono/mono --branch mono-${mono_version} --single-branch && \
23+
RUN git clone https://github.com/mono/mono --branch ${mono_version} --single-branch && \
2424
cd mono && git submodule update --init && \
2525
NOCONFIGURE=1 ./autogen.sh && \
2626
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib/mono --disable-boehm --host=x86_64-linux-gnu && \
2727
make -j && \
2828
make install && \
2929
cd .. && \
3030
cert-sync /etc/ssl/certs/ca-certificates.crt && \
31-
wget https://download.mono-project.com/repo/ubuntu/pool/main/m/msbuild/msbuild_16.0+xamarinxplat.2018.09.26.17.53-0xamarin3+ubuntu1404b1_all.deb && \
32-
wget https://download.mono-project.com/repo/ubuntu/pool/main/c/core-setup/msbuild-libhostfxr_2.0.0.2017.07.06.00.01-0xamarin21+ubuntu1404b1_amd64.deb && \
33-
wget https://download.mono-project.com/repo/ubuntu/pool/main/m/msbuild/msbuild-sdkresolver_16.0+xamarinxplat.2018.09.26.17.53-0xamarin3+ubuntu1404b1_all.deb && \
34-
wget https://download.mono-project.com/repo/ubuntu/pool/main/n/nuget/nuget_4.7.0.5148.bin-0xamarin2+ubuntu1404b1_all.deb && \
31+
rm -rf /root/mono && \
32+
wget https://download.mono-project.com/repo/ubuntu/pool/main/m/msbuild/msbuild_16.3+xamarinxplat.2019.08.08.00.55-0xamarin2+ubuntu1604b1_all.deb && \
33+
wget https://download.mono-project.com/repo/ubuntu/pool/main/c/core-setup/msbuild-libhostfxr_3.0.0.2019.04.16.02.13-0xamarin3+ubuntu1604b1_amd64.deb && \
34+
wget https://download.mono-project.com/repo/ubuntu/pool/main/m/msbuild/msbuild-sdkresolver_16.3+xamarinxplat.2019.08.08.00.55-0xamarin2+ubuntu1604b1_all.deb && \
35+
wget https://download.mono-project.com/repo/ubuntu/pool/main/n/nuget/nuget_5.2.0.6090.bin-0xamarin1+ubuntu1604b1_all.deb && \
3536
dpkg -i --force-all *.deb && \
3637
sed -i '/Depends.*mono/d' /var/lib/dpkg/status && \
3738
ln -s /usr/bin/mono /usr/bin/cli && \
3839
apt-get clean && \
3940
rm -rf /var/lib/apt/lists/ && \
40-
rm *.deb && \
41-
rm -rf /root/mono
41+
rm *.deb
4242

4343
CMD /bin/bash

Dockerfile.windows

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mand
1010
/root/files/mingw64-binutils-2.30-5.fc29.godot.x86_64.rpm \
1111
/root/files/mingw32-binutils-2.30-5.fc29.godot.x86_64.rpm
1212

13-
RUN git clone https://github.com/mono/mono --branch mono-${mono_version} --single-branch && \
13+
RUN git clone https://github.com/mono/mono --branch ${mono_version} --single-branch && \
1414
cd mono && git submodule update --init && \
1515
NOCONFIGURE=1 ./autogen.sh && \
1616
./configure --prefix=/root/dependencies/mono-64 --host=x86_64-w64-mingw32 --disable-boehm --disable-mcs-build --disable-executables && \
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
From aad54942583f8658ab6d7e7af5ffe3b76b3f35b3 Mon Sep 17 00:00:00 2001
2+
From: Zoltan Varga <vargaz@gmail.com>
3+
Date: Tue, 3 Sep 2019 13:27:24 -0400
4+
Subject: [PATCH] [wasm] Avoid aligning the stack bounds, they are not page
5+
aligned on wasm.
6+
7+
---
8+
mono/utils/mono-threads-wasm.c | 8 ++++----
9+
mono/utils/mono-threads.c | 2 ++
10+
2 files changed, 6 insertions(+), 4 deletions(-)
11+
12+
diff --git a/mono/utils/mono-threads-wasm.c b/mono/utils/mono-threads-wasm.c
13+
index 687e6c4c93e7..c61d800f4be2 100644
14+
--- a/mono/utils/mono-threads-wasm.c
15+
+++ b/mono/utils/mono-threads-wasm.c
16+
@@ -145,10 +145,10 @@ mono_threads_platform_yield (void)
17+
void
18+
mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize)
19+
{
20+
+ int tmp;
21+
#ifdef __EMSCRIPTEN_PTHREADS__
22+
pthread_attr_t attr;
23+
gint res;
24+
- int tmp;
25+
26+
*staddr = NULL;
27+
*stsize = (size_t)-1;
28+
@@ -173,13 +173,13 @@ mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize)
29+
*staddr = (guint8*)wasm_get_stack_base ();
30+
*stsize = wasm_get_stack_size ();
31+
}
32+
-
33+
- g_assert (&tmp > *staddr);
34+
- g_assert (&tmp < (char*)*staddr + *stsize);
35+
#else
36+
*staddr = (guint8*)wasm_get_stack_base ();
37+
*stsize = wasm_get_stack_size ();
38+
#endif
39+
+
40+
+ g_assert ((guint8*)&tmp > *staddr);
41+
+ g_assert ((guint8*)&tmp < (guint8*)*staddr + *stsize);
42+
}
43+
44+
gboolean
45+
diff --git a/mono/utils/mono-threads.c b/mono/utils/mono-threads.c
46+
index 546704ff9e8f..bf73e01c7970 100644
47+
--- a/mono/utils/mono-threads.c
48+
+++ b/mono/utils/mono-threads.c
49+
@@ -1569,8 +1569,10 @@ mono_thread_info_get_stack_bounds (guint8 **staddr, size_t *stsize)
50+
/* Sanity check the result */
51+
g_assert ((current > *staddr) && (current < *staddr + *stsize));
52+
53+
+#ifndef TARGET_WASM
54+
/* When running under emacs, sometimes staddr is not aligned to a page size */
55+
*staddr = (guint8*)((gssize)*staddr & ~(mono_pagesize () - 1));
56+
+#endif
57+
}
58+
59+
gboolean

0 commit comments

Comments
 (0)