Compare commits

..

16 Commits

Author SHA1 Message Date
Rémi Verschelde
c3a9d311bc Merge pull request #43 from akien-mga/mono-6.12.0.147
CI: Build with Mono 6.12.0.147
2021-07-06 20:41:50 +02:00
Rémi Verschelde
d75582bd3c Set actions/cache to v2, we don't need explicit manual bumps for 2.1.x 2021-07-06 17:47:28 +02:00
Rémi Verschelde
75a0b00364 Merge pull request #41 from godotengine/dependabot/github_actions/mymindstorm/setup-emsdk-10
Bump mymindstorm/setup-emsdk from 9 to 10
2021-07-06 17:45:14 +02:00
Rémi Verschelde
47e40daefe CI: Build with Mono 6.12.0.147 2021-07-06 16:57:49 +02:00
Ignacio Roldán Etcheverry
29683d76fc Merge pull request #40 from godotengine/dummy-xamarin-ios-dll
iOS BCL: Build dummy `Xamarin.iOS.dll` which is necessary
2021-06-02 23:34:07 +02:00
Ignacio Roldán Etcheverry
7937417c83 Merge pull request #39 from godotengine/ios-and-m1-stuff
Apple silicon: arm64 macOS and arm64 iOS simulator
2021-06-02 23:32:45 +02:00
dependabot[bot]
0cfb06c6e4 Bump mymindstorm/setup-emsdk from 9 to 10
Bumps [mymindstorm/setup-emsdk](https://github.com/mymindstorm/setup-emsdk) from 9 to 10.
- [Release notes](https://github.com/mymindstorm/setup-emsdk/releases)
- [Commits](https://github.com/mymindstorm/setup-emsdk/compare/v9...v10)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-27 06:00:10 +00:00
Ignacio Roldán Etchevery
0a2b5f8fab Apple silicon: arm64 macOS and arm64 iOS simulator 2021-05-22 02:36:45 +02:00
Ignacio Roldán Etchevery
61df21a190 iOS BCL: Build dummy Xamarin.iOS.dll which is necessary
Fixes godotengine/godot#42960
2021-05-22 02:21:43 +02:00
Rémi Verschelde
aa9e050543 CI: Build with Mono 6.12.0.144 + other env updates
Update env components to these versions:

- Python 3.9
- Pin NDK to 21.4.7075529 as done by Godot

Not updating Android API level to 30 yet as some feature work is needed in
Godot to support new requirements.

Mono 6.12.0.144 is still a Preview release, but contrarily to 6.12.0.122,
it has a successful Windows build. It also theoretically finalizes support
for Apple M1, so we can attempt using it to build Mono for that arch.
2021-05-11 16:02:22 +02:00
Rémi Verschelde
90c8c8d4c0 Merge pull request #34 from godotengine/dependabot/github_actions/actions/cache-v2.1.5
Bump actions/cache from v2.1.4 to v2.1.5
2021-05-11 12:47:25 +02:00
Rémi Verschelde
3eb55684e3 Merge pull request #35 from godotengine/dependabot/github_actions/mymindstorm/setup-emsdk-v9
Bump mymindstorm/setup-emsdk from v8 to v9
2021-05-11 12:45:36 +02:00
Rémi Verschelde
326d5482bf Merge pull request #33 from godotengine/dependabot/github_actions/actions/setup-python-v2.2.2
Bump actions/setup-python from v2.1.4 to v2.2.2
2021-05-11 12:45:28 +02:00
dependabot[bot]
92e46486d8 Bump mymindstorm/setup-emsdk from v8 to v9
Bumps [mymindstorm/setup-emsdk](https://github.com/mymindstorm/setup-emsdk) from v8 to v9.
- [Release notes](https://github.com/mymindstorm/setup-emsdk/releases)
- [Commits](https://github.com/mymindstorm/setup-emsdk/compare/v8...c0f39b967594b2b09f069eecfd219642f522b596)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-03 07:43:29 +00:00
dependabot[bot]
eb8d9aff08 Bump actions/cache from v2.1.4 to v2.1.5
Bumps [actions/cache](https://github.com/actions/cache) from v2.1.4 to v2.1.5.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2.1.4...1a9e2138d905efd099035b49d8b7a3888c653ca8)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-13 06:24:43 +00:00
dependabot[bot]
806260f507 Bump actions/setup-python from v2.1.4 to v2.2.2
Bumps [actions/setup-python](https://github.com/actions/setup-python) from v2.1.4 to v2.2.2.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2.1.4...dc73133d4da04e56a135ae2246682783cc7c7cb6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-13 06:24:40 +00:00
9 changed files with 111 additions and 44 deletions

View File

@@ -27,8 +27,8 @@ on:
env:
# Use SHA or tag instead of the branch for caching purposes.
MONO_TAG: mono-6.12.0.122
PYTHON_VERSION: 3.8
MONO_TAG: mono-6.12.0.147
PYTHON_VERSION: 3.9
# Should match the version that Mono supports.
EMSDK_VERSION: 1.39.9
ANDROID_CMAKE_VERSION: 3.10.2.4988404
@@ -36,6 +36,7 @@ env:
# platform/android/java/app/config.gradle
ANDROID_PLATFORM: android-29
ANDROID_API: 18
ANDROID_NDK_VERSION: 21.4.7075529
# platform/iphone/detect.py
IOS_VERSION_MIN: 10.0
@@ -64,7 +65,7 @@ jobs:
sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v2.1.4
uses: actions/cache@v2
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
@@ -83,7 +84,7 @@ jobs:
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v2.1.4
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -138,7 +139,7 @@ jobs:
sudo apt-get -y install mingw-w64 libz-mingw-w64-dev
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v2.1.4
uses: actions/cache@v2
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
@@ -157,7 +158,7 @@ jobs:
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v2.1.4
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -202,7 +203,7 @@ jobs:
brew install autoconf automake libtool pkg-config cmake python3
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v2.1.4
uses: actions/cache@v2
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
@@ -221,7 +222,7 @@ jobs:
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v2.1.4
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -256,7 +257,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
target: [arm64, x86_64]
target: [arm64, x86_64, arm64-sim]
steps:
- name: Set Environment Variables
run: |
@@ -266,7 +267,7 @@ jobs:
brew install autoconf automake libtool pkg-config cmake python3
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v2.1.4
uses: actions/cache@v2
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
@@ -285,7 +286,7 @@ jobs:
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v2.1.4
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -336,7 +337,7 @@ jobs:
brew install autoconf automake libtool pkg-config cmake python3
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v2.1.4
uses: actions/cache@v2
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
@@ -355,7 +356,7 @@ jobs:
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v2.1.4
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -428,13 +429,13 @@ jobs:
run: |
sudo snap install androidsdk
androidsdk "platforms;${ANDROID_PLATFORM}"
androidsdk "ndk-bundle"
androidsdk "ndk;${ANDROID_NDK_VERSION}"
androidsdk "cmake;${ANDROID_CMAKE_VERSION}"
echo "ANDROID_SDK_ROOT=$HOME/snap/androidsdk/current/" >> $GITHUB_ENV
echo "ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk-bundle" >> $GITHUB_ENV
echo "ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/$ANDROID_NDK_VERSION" >> $GITHUB_ENV
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v2.1.4
uses: actions/cache@v2
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
@@ -453,7 +454,7 @@ jobs:
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v2.1.4
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -557,14 +558,13 @@ jobs:
run: |
sudo apt-get -y install snapd
sudo snap install androidsdk
androidsdk "platforms;${ANDROID_PLATFORM}"
androidsdk "ndk-bundle"
androidsdk "ndk;${ANDROID_NDK_VERSION}"
androidsdk "cmake;${ANDROID_CMAKE_VERSION}"
echo "ANDROID_SDK_ROOT=$HOME/snap/androidsdk/current/" >> $GITHUB_ENV
echo "ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk-bundle" >> $GITHUB_ENV
echo "ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/$ANDROID_NDK_VERSION" >> $GITHUB_ENV
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v2.1.4
uses: actions/cache@v2
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
@@ -583,7 +583,7 @@ jobs:
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v2.1.4
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Download LLVM artifact
@@ -651,7 +651,7 @@ jobs:
sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v2.1.4
uses: actions/cache@v2
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
@@ -670,11 +670,11 @@ jobs:
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v2.1.4
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Setup Emscripten SDK
uses: mymindstorm/setup-emsdk@v8
uses: mymindstorm/setup-emsdk@v10
with:
version: ${{ env.EMSDK_VERSION }}
- name: Patch Mono
@@ -724,7 +724,7 @@ jobs:
steps:
- name: Cache LLVM
id: cache_llvm
uses: actions/cache@v2.1.4
uses: actions/cache@v2
with:
path: ~/mono-installs/llvm-${{ matrix.target }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-llvm-${{ matrix.target }}
@@ -747,7 +747,7 @@ jobs:
- name: Cache Mono Sources
if: steps.cache_llvm.outputs.cache-hit != 'true'
id: cache_mono_sources
uses: actions/cache@v2.1.4
uses: actions/cache@v2
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
@@ -769,7 +769,7 @@ jobs:
path: godot-mono-builds
- name: Setup Python
if: steps.cache_llvm.outputs.cache-hit != 'true'
uses: actions/setup-python@v2.1.4
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -811,7 +811,7 @@ jobs:
sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v2.1.4
uses: actions/cache@v2
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
@@ -830,7 +830,7 @@ jobs:
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v2.1.4
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
__pycache__/
*.pyc
.DS_Store

View File

@@ -9,7 +9,7 @@ This repository contains scripts for building the Mono runtime to use with Godot
The scripts are tested against specific versions of the toolchains used by Godot.
While they may work with other versions, you might have issues applying patches or compiling, so we recommend using the versions below.
- Mono: 6.12.0.122.
- Mono: 6.12.0.147.
- Emscripten: 1.39.9.
- Android: API level 29.

19
bcl.py
View File

@@ -178,6 +178,25 @@ def make_product(opts: BclOpts, product: str):
run_command('csc', android_env_csc_args)
# (custom 'Xamarin.iOS.dll')
if product == 'ios':
this_script_dir = os.path.dirname(os.path.realpath(__file__))
monotouch_profile_dir = '%s/%s' % (install_dir, 'monotouch')
refs = ['mscorlib.dll', 'System.Net.Http.dll']
mkdir_p(monotouch_profile_dir)
android_env_csc_args = [
path_join(this_script_dir, 'files', 'xi.cs'),
'-keyfile:' + path_join(this_script_dir, 'files', 'xi.snk'),
'-out:%s' % path_join(monotouch_profile_dir, 'Xamarin.iOS.dll'),
'-optimize', '-deterministic', '-publicsign', '-target:library',
'-nostdlib', '-noconfig', '-langversion:latest'
]
android_env_csc_args += ['-r:%s' % path_join(monotouch_profile_dir, r) for r in refs]
run_command('csc', android_env_csc_args)
def clean_product(opts: BclOpts, product: str):
clean_bcl(opts)

View File

@@ -15,7 +15,7 @@ import runtime
targets = {
'linux': ['x86', 'x86_64'],
'windows': ['x86', 'x86_64'],
'osx': ['x86_64']
'osx': ['arm64', 'x86_64']
}
target_arch = {
@@ -28,14 +28,24 @@ target_arch = {
'x86_64': 'x86_64'
},
'osx': {
'arm64': 'arm64',
'x86_64': 'x86_64'
}
}
host_triples = {
'linux': '%s-linux-gnu',
'windows': '%s-w64-mingw32',
'osx': '%s-apple-darwin',
'linux': {
'x86': 'i686-linux-gnu',
'x86_64': 'x86_64-linux-gnu'
},
'windows': {
'x86': 'i686-w64-mingw32',
'x86_64': 'x86_64-w64-mingw32'
},
'osx': {
'arm64': 'aarch64-apple-darwin20',
'x86_64': 'x86_64-apple-darwin'
}
}
llvm_table = {
@@ -70,7 +80,7 @@ def get_osxcross_sdk(osxcross_bin, arch):
def setup_desktop_template(env: dict, opts: DesktopOpts, product: str, target_platform: str, target: str):
host_triple = host_triples[target_platform] % target_arch[target_platform][target]
host_triple = host_triples[target_platform][target]
CONFIGURE_FLAGS = [
'--disable-boehm',
@@ -137,7 +147,20 @@ def setup_desktop_template(env: dict, opts: DesktopOpts, product: str, target_pl
# DTrace is not available when building with OSXCROSS
CONFIGURE_FLAGS += ['--enable-dtrace=no']
else:
env['_%s-%s_CC' % (product, target)] = 'cc'
osx_toolchain = '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain'
env['_%s-%s_CC' % (product, target)] = '%s/usr/bin/clang' % osx_toolchain
env['_%s-%s_CXX' % (product, target)] = '%s/usr/bin/clang++' % osx_toolchain
osx_sysroot = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk'
CFLAGS = [
'-isysroot', osx_sysroot,
'-arch', target_arch[target_platform][target]
]
env['_%s-%s_CFLAGS' % (product, target)] = CFLAGS
env['_%s-%s_CXXFLAGS' % (product, target)] = CFLAGS
env['_%s-%s_CONFIGURE_FLAGS' % (product, target)] = CONFIGURE_FLAGS

15
files/xi.cs Normal file
View File

@@ -0,0 +1,15 @@
using System.Net.Http;
[assembly:System.Reflection.AssemblyVersionAttribute ("0.0.0.0")]
[assembly:System.Runtime.CompilerServices.InternalsVisibleTo ("System.Net.Http, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
namespace ObjCRuntime
{
internal class RuntimeOptions
{
internal static HttpMessageHandler GetHttpMessageHandler()
{
return new HttpClientHandler();
}
}
}

BIN
files/xi.snk Normal file

Binary file not shown.

21
ios.py
View File

@@ -14,7 +14,7 @@ import runtime
this_script_dir = os.path.dirname(os.path.realpath(__file__))
device_targets = ['armv7', 'arm64']
sim_targets = ['i386', 'x86_64']
sim_targets = ['i386', 'x86_64', 'arm64-sim']
cross_targets = ['cross-armv7', 'cross-arm64']
@@ -26,6 +26,7 @@ class iOSTargetTable:
archs = {
'armv7': 'arm',
'arm64': 'arm64',
'arm64-sim': 'arm64',
'i386': 'i386',
'x86_64': 'x86_64'
}
@@ -33,6 +34,7 @@ class iOSTargetTable:
host_triples = {
'armv7': 'arm-apple-darwin11',
'arm64': 'aarch64-apple-darwin11',
'arm64-sim': 'aarch64-apple-darwin11',
'i386': 'i386-apple-darwin11',
'x86_64': 'x86_64-apple-darwin11'
}
@@ -40,6 +42,7 @@ class iOSTargetTable:
osxcross_tool_triples = {
'armv7': 'arm-apple-darwin11', # TODO: ?
'arm64': 'arm-apple-darwin11',
'arm64-sim': 'arm-apple-darwin11',
'i386': 'i386-apple-darwin11', # TODO: ?
'x86_64': 'x86_64-apple-darwin11'
}
@@ -185,7 +188,7 @@ def setup_ios_simulator_template(env: dict, opts: iOSOpts, target: str):
if not ios_sysroot_path:
raise RuntimeError('Cannot find iOS SDK; specify one manually with \'--ios-sdk\'.')
sysroot_flags = ['-isysroot', ios_sysroot_path, '-miphoneos-version-min=%s' % opts.ios_version_min]
sysroot_flags = ['-isysroot', ios_sysroot_path, '-mios-simulator-version-min=%s' % opts.ios_version_min]
arch = iOSTargetTable.archs[target]
host_triple = iOSTargetTable.host_triples[target]
@@ -306,8 +309,11 @@ class iOSCrossTable:
}
def setup_ios_cross_template(env: dict, opts: iOSOpts, target: str, host_arch: str):
def llvm_for(host_arch: str) -> str:
return 'llvmarm64' if host_arch == 'arm64' else 'llvm64'
def setup_ios_cross_template(env: dict, opts: iOSOpts, target: str, host_arch: str):
target_triple = iOSCrossTable.target_triples[target]
device_target = iOSCrossTable.device_targets[target]
offsets_dumper_abi = iOSCrossTable.offsets_dumper_abis[target]
@@ -411,7 +417,7 @@ def setup_ios_cross_template(env: dict, opts: iOSOpts, target: str, host_arch: s
env['_ios-%s_CONFIGURE_FLAGS' % target] = CONFIGURE_FLAGS
# Runtime cross template
runtime.setup_runtime_cross_template(env, opts, 'ios', target, host_triple, target_triple, device_target, 'llvm64', offsets_dumper_abi)
runtime.setup_runtime_cross_template(env, opts, 'ios', target, host_triple, target_triple, device_target, llvm_for(host_arch), offsets_dumper_abi)
def strip_libs(opts: iOSOpts, product: str, target: str):
@@ -427,8 +433,11 @@ def configure(opts: iOSOpts, product: str, target: str):
if is_cross(target):
import llvm
llvm.make(opts, 'llvm64')
setup_ios_cross_template(env, opts, target, host_arch='x86_64')
host_arch='x86_64'
llvm.make(opts, llvm_for(host_arch))
setup_ios_cross_template(env, opts, target, host_arch)
else:
if is_sim:
setup_ios_simulator_template(env, opts, target)

View File

@@ -11,7 +11,7 @@ from os_utils import *
# TODO: OSXCROSS
target_values = ['llvm32', 'llvm64', 'llvmwin32', 'llvmwin64']
target_values = ['llvm32', 'llvm64', 'llvmarm64', 'llvmwin32', 'llvmwin64']
mxe_targets = {
'llvmwin32': {'arch': 'i686', 'mxe': 'mxe-Win32'},
'llvmwin64': {'arch': 'x86_64', 'mxe': 'mxe-Win64'}