Compare commits

..

41 Commits

Author SHA1 Message Date
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
Rémi Verschelde
df330ce0be CI: Build with Mono 6.12.0.122 (stable)
Upgrades us to the current stable release.
Further work is done in Preview on Apple Silicon support but we'll look into this
after the Godot 3.3 release.
2021-03-27 11:57:02 +01:00
Rémi Verschelde
d462909236 Merge pull request #32 from godotengine/dependabot/github_actions/actions/cache-v2.1.4
Bump actions/cache from v1.2.0 to v2.1.4
2021-03-26 13:39:35 +01:00
Rémi Verschelde
05775a4758 Merge pull request #31 from godotengine/dependabot/github_actions/mymindstorm/setup-emsdk-v8
Bump mymindstorm/setup-emsdk from v7 to v8
2021-03-26 13:39:12 +01:00
dependabot[bot]
7e681d3553 Bump actions/cache from v1.2.0 to v2.1.4
Bumps [actions/cache](https://github.com/actions/cache) from v1.2.0 to v2.1.4.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v1.2.0...26968a09c0ea4f3e233fdddbafd1166051a095f6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-05 06:31:00 +00:00
dependabot[bot]
3f52d14ef8 Bump mymindstorm/setup-emsdk from v7 to v8
Bumps [mymindstorm/setup-emsdk](https://github.com/mymindstorm/setup-emsdk) from v7 to v8.
- [Release notes](https://github.com/mymindstorm/setup-emsdk/releases)
- [Commits](https://github.com/mymindstorm/setup-emsdk/compare/v7...d38289e54786ef9965c3dcd51c396cb0c4bae40f)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-01 07:57:59 +00:00
Rémi Verschelde
bda87f2d2b Merge pull request #29 from akien-mga/wasm-apply-m2n_trampolines_hook
WASM: Apply m2n_trampolines_hook patch added in 0e31293
2021-01-06 19:49:49 +01:00
Rémi Verschelde
f83e263970 Merge pull request #28 from akien-mga/mono-6.12.0.114-android-18
CI: Bump Mono to 6.12.0.114 and fix Android 32-bit min API
2021-01-06 16:40:37 +01:00
Rémi Verschelde
7028c15e29 WASM: Apply m2n_trampolines_hook patch added in 0e31293 2021-01-06 16:40:04 +01:00
Rémi Verschelde
241a00d3f3 CI: Bump Mono to 6.12.0.114 and fix Android 32-bit min API
Following up on #22, we should target API level 18 like the Godot source does,
which is used by armv7/x86 builds. 64-bit builds do require API level 21 as a
minimum, but our build scripts handle upgrading this value already.
2020-12-30 08:41:33 +01:00
Ignacio Etcheverry
9d75cff174 WASM/BCL: Build WebAssembly.Framework.sln and include in BCL 2020-12-14 20:51:58 +01:00
Rémi Verschelde
61e36a93b6 Merge pull request #22 from akien-mga/android-min-api-18
Android: Fix support for API 18-20 for 32-bit
2020-12-07 11:12:05 +01:00
Rémi Verschelde
c2d2922f42 Merge pull request #20 from godotengine/dependabot/github_actions/actions/setup-python-v2.1.4
Bump actions/setup-python from v1 to v2.1.4
2020-12-07 10:06:03 +01:00
Rémi Verschelde
8daa270631 Android: Fix support for API 18-20 for 32-bit
Fixes https://github.com/godotengine/godot/issues/44159.
2020-12-07 10:05:30 +01:00
Ignacio Roldán Etcheverry
767b8e2ada Merge pull request #21 from godotengine/mono-patch-hook-wasm-m2n
WASM: Add patch to let Godot provide its own m2n trampolines
2020-12-05 01:05:42 +01:00
Ignacio Etcheverry
0e312939bd WASM: Add patch to let Godot provide its own m2n trampolines
Mono on WASM relies on trampolines for a fixed pre-defined set of
method signatures in order for the interpreter to call native
functions.
As a workaround for this limitation, Godot has been passing long,
ulong, float and double as pointers in internal calls.
This patch should allow Godot to provide its own trampolines, which
can be generated automatically at compile time thanks to templates.

This patch is made against the Mono tag mono-6.12.0.111. The
following commit is expected to break this patch:
mono/mono@174aeaa31c
It will need to be updated once we upgrade the a newer Mono
version in the official Godot builds.
2020-12-04 23:36:32 +01:00
dependabot[bot]
f12b3e4071 Bump actions/setup-python from v1 to v2.1.4
Bumps [actions/setup-python](https://github.com/actions/setup-python) from v1 to v2.1.4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v1...41b7212b1668f5de9d65e9c82aa777e6bbedb3a8)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-20 15:30:05 +00:00
Rémi Verschelde
0be1cc2e9b Merge pull request #14 from jlosito/dependabot-configs
Allow dependabot to check GitHub actions daily
2020-11-20 16:29:38 +01:00
Ignacio Roldán Etcheverry
7cae902cee Merge pull request #10 from tdaffin/easier-build
Make it a little easier to get a successful working build
2020-11-17 15:18:01 +01:00
Rémi Verschelde
d8956230a3 Merge pull request #18 from akien-mga/readme-versions
README: Document known good versions
2020-11-17 14:29:55 +01:00
John Losito
fbc5214dd5 Allow dependabot to check GitHub actions daily 2020-11-17 09:35:34 +01:00
Rémi Verschelde
958bf8d33d README: Document known good versions
Same as in CI configuration.

Fixes #9.
2020-11-17 09:34:23 +01:00
Rémi Verschelde
42b90fe9a6 Merge pull request #15 from akien-mga/ci-mono-6.12-emsdk-1.39.7
CI: Build with Mono 6.12.0.111 and Emscripten 1.39.7
2020-11-16 20:21:28 +01:00
Rémi Verschelde
6a98b5d325 CI: Address deprecation warning for set-env 2020-11-16 17:17:19 +01:00
Rémi Verschelde
1b5f2bb8d9 CI: Build with Mono 6.12.0.111 and Emscripten 1.39.9
This is what we'll be using for official builds for 3.2.4+.

Co-authored-by: Ignacio Etcheverry <ignalfonsore@gmail.com>
2020-11-16 17:17:03 +01:00
Tom Daffin
913582e1df Code review changes 2020-11-07 06:35:08 -07:00
Rémi Verschelde
b4c77dcfb6 Merge pull request #16 from akien-mga/fix-emsdk-setup
CI: Bump mymindstorm/setup-emsdk to v7
2020-10-20 10:12:24 +02:00
Rémi Verschelde
1e2d41160b CI: Bump mymindstorm/setup-emsdk to v7
Might fix CI builds.
2020-10-20 09:00:59 +02:00
Rémi Verschelde
d73d810ba1 Merge pull request #13 from akien-mga/android-python3-make-standalone-toolchain
Android: Force using python3 for `make_standalone_toolchain.py`
2020-10-20 08:26:22 +02:00
Rémi Verschelde
a3ce68fbb0 Merge pull request #12 from akien-mga/python3-shebang
Use `/usr/bin/env python3` shebang
2020-10-20 08:26:14 +02:00
Rémi Verschelde
d40cfcf47c Android: Force using python3 for make_standalone_toolchain.py
This allows using the script on a system without Python 2 installed.
(`make_standalone_toolchain.py` uses `/usr/bin/env python` as shebang.)
2020-10-13 15:07:09 +02:00
Rémi Verschelde
210f65f97a Use /usr/bin/env python3 shebang 2020-10-13 14:55:12 +02:00
Tom Daffin
d2f48f2b45 Make it a little easier to get a successful working build 2020-09-19 11:48:57 -06:00
Ignacio Roldán Etcheverry
331653f9c3 Merge pull request #7 from aaronfranke/formatting
Add a formatting script for GitHub Actions and add GitHub metadata
2020-07-04 23:03:15 +02:00
Aaron Franke
db32366ec9 Add a formatting script for GitHub Actions and add GitHub metadata 2020-07-03 23:12:01 -04:00
23 changed files with 378 additions and 82 deletions

2
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,2 @@
patreon: godotengine
custom: https://godotengine.org/donate

30
.github/ISSUE_TEMPLATE/bug-report.md vendored Normal file
View File

@@ -0,0 +1,30 @@
---
name: Bug Report
about: Report a bug with this repo.
title: ''
labels: bug
assignees: neikeq
---
<!--
Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot-csharp-visualstudio/issues?q=is%3Aissue
Only submit an issue if it is reproducible with the latest stable Godot version.
-->
**OS/device including version:**
<!-- Specify GPU model and drivers if graphics-related. -->
**Issue description:**
<!-- What happened, what was expected, and what went wrong. -->
**Screenshots of issue:**
<!--
This section is optional.
Drag in an image, or post an image with a link in the form of:
![Alt Text Here](https://pbs.twimg.com/media/DW5AJnZVAAM1805?format=jpg)
-->

View File

@@ -0,0 +1,13 @@
---
name: Feature / Enhancement Request
about: Adding new features or improving existing ones.
title: ''
labels: enhancement
assignees: neikeq
---
<!--
Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot-csharp-visualstudio/issues?q=is%3Aissue
-->

6
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

View File

@@ -26,13 +26,18 @@ on:
# Use ubuntu-latest for the WASM runtime ("machine `wasm32' not recognized" on ubuntu-16.04)
env:
# Use SHA instead of the branch for caching purposes
MONO_TAG: mono-6.8.0.123
PYTHON_VERSION: 3.8
EMSDK_VERSION: 1.38.47-upstream
# Use SHA or tag instead of the branch for caching purposes.
MONO_TAG: mono-6.12.0.144
PYTHON_VERSION: 3.9
# Should match the version that Mono supports.
EMSDK_VERSION: 1.39.9
ANDROID_CMAKE_VERSION: 3.10.2.4988404
# These should be synced with the Godot repo.
# platform/android/java/app/config.gradle
ANDROID_PLATFORM: android-29
ANDROID_CMAKE_VERSION: 3.6.4111459
ANDROID_API: 21
ANDROID_API: 18
ANDROID_NDK_VERSION: 21.4.7075529
# platform/iphone/detect.py
IOS_VERSION_MIN: 10.0
jobs:
@@ -45,7 +50,7 @@ jobs:
steps:
- name: Set Environment Variables
run: |
echo "::set-env name=MONO_SOURCE_ROOT::$GITHUB_WORKSPACE/mono_sources"
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Install Dependencies (x86)
if: matrix.target == 'x86'
run: |
@@ -60,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@v1.2.0
uses: actions/cache@v2.1.5
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
@@ -79,7 +84,7 @@ jobs:
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v1
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -118,7 +123,7 @@ jobs:
steps:
- name: Set Environment Variables
run: |
echo "::set-env name=MONO_SOURCE_ROOT::$GITHUB_WORKSPACE/mono_sources"
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Install Dependencies (x86)
if: matrix.target == 'x86'
run: |
@@ -134,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@v1.2.0
uses: actions/cache@v2.1.5
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
@@ -153,7 +158,7 @@ jobs:
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v1
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -192,13 +197,13 @@ jobs:
steps:
- name: Set Environment Variables
run: |
echo "::set-env name=MONO_SOURCE_ROOT::$GITHUB_WORKSPACE/mono_sources"
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Install Dependencies
run: |
brew install autoconf automake libtool pkg-config cmake python3
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v1.2.0
uses: actions/cache@v2.1.5
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
@@ -217,7 +222,7 @@ jobs:
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v1
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -256,13 +261,13 @@ jobs:
steps:
- name: Set Environment Variables
run: |
echo "::set-env name=MONO_SOURCE_ROOT::$GITHUB_WORKSPACE/mono_sources"
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Install Dependencies
run: |
brew install autoconf automake libtool pkg-config cmake python3
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v1.2.0
uses: actions/cache@v2.1.5
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
@@ -281,7 +286,7 @@ jobs:
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v1
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -326,13 +331,13 @@ jobs:
steps:
- name: Set Environment Variables
run: |
echo "::set-env name=MONO_SOURCE_ROOT::$GITHUB_WORKSPACE/mono_sources"
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Install Dependencies
run: |
brew install autoconf automake libtool pkg-config cmake python3
- name: Cache Mono Sources
id: cache_mono_sources
uses: actions/cache@v1.2.0
uses: actions/cache@v2.1.5
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
@@ -351,7 +356,7 @@ jobs:
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v1
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -414,7 +419,7 @@ jobs:
steps:
- name: Set Environment Variables
run: |
echo "::set-env name=MONO_SOURCE_ROOT::$GITHUB_WORKSPACE/mono_sources"
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Install Dependencies
run: |
sudo apt-get -y update
@@ -424,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 "::set-env name=ANDROID_SDK_ROOT::$HOME/snap/androidsdk/current/"
echo "::set-env name=ANDROID_NDK_ROOT::$ANDROID_SDK_ROOT/ndk-bundle"
echo "ANDROID_SDK_ROOT=$HOME/snap/androidsdk/current/" >> $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@v1.2.0
uses: actions/cache@v2.1.5
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
@@ -449,7 +454,7 @@ jobs:
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v1
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -540,7 +545,7 @@ jobs:
steps:
- name: Set Environment Variables
run: |
echo "::set-env name=MONO_SOURCE_ROOT::$GITHUB_WORKSPACE/mono_sources"
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Install Dependencies
run: |
sudo apt-get -y update
@@ -553,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 "::set-env name=ANDROID_SDK_ROOT::$HOME/snap/androidsdk/current/"
echo "::set-env name=ANDROID_NDK_ROOT::$ANDROID_SDK_ROOT/ndk-bundle"
echo "ANDROID_SDK_ROOT=$HOME/snap/androidsdk/current/" >> $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@v1.2.0
uses: actions/cache@v2.1.5
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
@@ -579,7 +583,7 @@ jobs:
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v1
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Download LLVM artifact
@@ -640,14 +644,14 @@ jobs:
steps:
- name: Set Environment Variables
run: |
echo "::set-env name=MONO_SOURCE_ROOT::$GITHUB_WORKSPACE/mono_sources"
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Install Dependencies
run: |
sudo apt-get -y update
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@v1.2.0
uses: actions/cache@v2.1.5
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
@@ -666,11 +670,11 @@ jobs:
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v1
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Setup Emscripten SDK
uses: mymindstorm/setup-emsdk@v2
uses: mymindstorm/setup-emsdk@v9
with:
version: ${{ env.EMSDK_VERSION }}
- name: Patch Mono
@@ -720,13 +724,13 @@ jobs:
steps:
- name: Cache LLVM
id: cache_llvm
uses: actions/cache@v1.2.0
uses: actions/cache@v2.1.5
with:
path: ~/mono-installs/llvm-${{ matrix.target }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-llvm-${{ matrix.target }}
- name: Set Environment Variables
run: |
echo "::set-env name=MONO_SOURCE_ROOT::$GITHUB_WORKSPACE/mono_sources"
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Install Dependencies (Linux)
if: steps.cache_llvm.outputs.cache-hit != 'true' && runner.os == 'Linux'
run: |
@@ -743,7 +747,7 @@ jobs:
- name: Cache Mono Sources
if: steps.cache_llvm.outputs.cache-hit != 'true'
id: cache_mono_sources
uses: actions/cache@v1.2.0
uses: actions/cache@v2.1.5
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
@@ -765,7 +769,7 @@ jobs:
path: godot-mono-builds
- name: Setup Python
if: steps.cache_llvm.outputs.cache-hit != 'true'
uses: actions/setup-python@v1
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono
@@ -800,14 +804,14 @@ jobs:
steps:
- name: Set Environment Variables
run: |
echo "::set-env name=MONO_SOURCE_ROOT::$GITHUB_WORKSPACE/mono_sources"
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Install Dependencies
run: |
sudo apt-get -y update
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@v1.2.0
uses: actions/cache@v2.1.5
with:
path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
@@ -826,7 +830,7 @@ jobs:
with:
path: godot-mono-builds
- name: Setup Python
uses: actions/setup-python@v1
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono

15
.github/workflows/static_checks.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: Continuous integration
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Lint repo
run: |
sudo apt-get update -qq
sudo apt-get install -qq dos2unix recode
bash ./format.sh

View File

@@ -2,7 +2,16 @@
[![Build](https://github.com/godotengine/godot-mono-builds/workflows/Build/badge.svg)](https://github.com/godotengine/godot-mono-builds/actions)
This repository contains scripts for building the Mono runtime to use with Godot Engine
This repository contains scripts for building the Mono runtime to use with Godot Engine.
## Supported versions
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.144.
- Emscripten: 1.39.9.
- Android: API level 29.
## Command-line options
@@ -10,9 +19,9 @@ This repository contains scripts for building the Mono runtime to use with Godot
These scripts are based on the Mono [sdks](https://github.com/mono/mono/tree/master/sdks) makefiles, with some changes to work well with Godot. Some platforms or targets depend on files from the `sdks` directory in the Mono source repository. This directory may be missing from tarballs. If that's the case, cloning the git repository may be needed. [This table](https://www.mono-project.com/docs/about-mono/versioning/#mono-source-versioning) can be used to determine the branch for a specific version of Mono.
Some patches need to be applied to the Mono sources before building. This can be done by running `python ./patch_mono.py`.
Some patches need to be applied to the Mono sources before building. This can be done by running `python3 ./patch_mono.py`.
Run `python SCRIPT.py --help` for the full list of command line options.
Run `python3 SCRIPT.py --help` for the full list of command line options.
By default, the scripts will install the resulting files to `$HOME/mono-installs`.
A custom output directory can be specified with the `--install-dir` option.
@@ -30,6 +39,19 @@ export MONO_SOURCE_ROOT=$HOME/git/mono
- OSXCROSS is supported expect for building the Mono cross-compilers.
- Building on Windows is not supported. It's possible to use Cygwin or WSL (Windows Subsystem for Linux) but this hasn't been tested.
## Compiling Godot for Desktop with this Runtime
In order to compile mono into Godot for deskop you will need to first build for desktop (see 'Desktop' below), and then Base Class Libraries (see 'Base Class library' below).
Then run the 'copy-bcl' action of the same desktop script you ran configure and make on, specifying the same target platforms you used before. This will copy the bcl runtime into the runtime directories that the subsequent Godot build (using `copy_mono_root=yes`) expects to find them in.
e.g.
`./linux.py copy-bcl --target=x86 --target=x86_64`
Then you'll need to compile Godot using `copy_mono_root=yes`
e.g.
`scons -j6 target=release_debug tools=yes module_mono_enabled=yes copy_mono_root=yes mono_prefix="$HOME/mono-installs/desktop-linux-x86_64-release"`
## Desktop
```bash

View File

@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python3
import os
import os.path
@@ -415,9 +415,9 @@ def make_standalone_toolchain(opts: AndroidOpts, target: str, api: str):
if os.path.isdir(path_join(install_dir, 'bin')):
return # Looks like it's already there, so no need to re-create it
command = path_join(opts.android_ndk_root, 'build', 'tools', 'make_standalone_toolchain.py')
args = ['--verbose', '--force', '--api=' + api, '--arch=' + AndroidTargetTable.archs[target],
args = [command, '--verbose', '--force', '--api=' + api, '--arch=' + AndroidTargetTable.archs[target],
'--install-dir=' + install_dir]
run_command(command, args=args, name='make_standalone_toolchain')
run_command('python3', args=args, name='make_standalone_toolchain')
def strip_libs(opts: AndroidOpts, product: str, target: str, api: str):
@@ -522,7 +522,9 @@ def main(raw_args):
parser.add_argument('--toolchains-prefix', default=path_join(home, 'android-toolchains'), help=default_help)
parser.add_argument('--android-sdk', default=android_sdk_default, help=default_help)
parser.add_argument('--android-ndk', default=android_ndk_default, help=default_help)
parser.add_argument('--android-api-version', default='21', help=default_help)
# Default API version should be in sync with Godot's platform/android/detect.py.
# Note that `get_api_version_or_min` will upgrade it to 21 for arm64v8 and x86_64.
parser.add_argument('--android-api-version', default='18', help=default_help)
parser.add_argument('--android-cmake-version', default='autodetect', help=default_help)
cmd_utils.add_runtime_arguments(parser, default_help)

43
bcl.py
View File

@@ -1,5 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python
#!/usr/bin/env python3
import os
import os.path
@@ -27,6 +26,19 @@ test_profiles_table = {
'wasm': ['wasm']
}
def get_install_dir(opts: BaseOpts, product: str):
return path_join(opts.install_dir, '%s-bcl' % product)
def get_profile_dir(profile: str, product: str):
if product == 'desktop-win32':
return profile + '-win32'
else:
return profile
def get_profile_install_dirs(opts: BaseOpts, product: str):
install_dir = get_install_dir(opts, product)
profiles = profiles_table[product]
return [path_join(install_dir, get_profile_dir(profile, product)) for profile in profiles]
def configure_bcl(opts: BclOpts):
stamp_file = path_join(opts.configure_dir, '.stamp-bcl-configure')
@@ -92,7 +104,7 @@ def make_product(opts: BclOpts, product: str):
profiles = profiles_table[product]
test_profiles = test_profiles_table[product]
install_dir = path_join(opts.install_dir, '%s-bcl' % product)
install_dir = get_install_dir(opts, product)
mkdir_p(install_dir)
@@ -113,7 +125,7 @@ def make_product(opts: BclOpts, product: str):
# Copy the bcl profiles to the output directory
from distutils.dir_util import copy_tree
for profile in profiles:
profile_dir = profile + '-win32' if product == 'desktop-win32' else profile
profile_dir = get_profile_dir(profile, product)
copy_tree('%s/mcs/class/lib/%s' % (opts.mono_source_root, profile_dir), '%s/%s' % (install_dir, profile_dir))
# Remove unneeded files
@@ -127,6 +139,27 @@ def make_product(opts: BclOpts, product: str):
file_pattern_recursive = '%s/**/%s' % (install_dir, file_pattern)
[rm_rf(x) for x in glob.iglob(file_pattern_recursive, recursive=True)]
# WebAssembly.Framework.sln
if product == 'wasm':
wasm_fx_output_dir = '%s/sdks/wasm/framework/netstandard2.0' % opts.mono_source_root
wasm_fx_sln_file = '%s/sdks/wasm/framework/src/WebAssembly.Framework.sln' % opts.mono_source_root
output_dir = path_join(install_dir, 'wasm')
from msbuild_helper import build_solution
build_solution(wasm_fx_sln_file, 'Release')
import shutil
from glob import glob
fglob = glob(path_join(wasm_fx_output_dir, '*.dll'))
if not opts.remove_pdb:
fglob.extend(glob(path_join(wasm_fx_output_dir, '*.pdb')))
for file in fglob:
if os.path.isfile(file):
shutil.copy(file, output_dir)
# godot_android_ext profile (custom 'Mono.Android.dll')
if product == 'android':
this_script_dir = os.path.dirname(os.path.realpath(__file__))
@@ -149,7 +182,7 @@ def make_product(opts: BclOpts, product: str):
def clean_product(opts: BclOpts, product: str):
clean_bcl(opts)
install_dir = path_join(opts.install_dir, '%s-bcl' % product)
install_dir = get_install_dir(opts, product)
rm_rf(install_dir)

View File

@@ -198,6 +198,14 @@ def make(opts: DesktopOpts, product: str, target_platform: str, target: str):
if opts.strip_libs:
strip_libs(opts, product, target_platform, target)
def copy_bcl(opts: DesktopOpts, product: str, target_platform: str, target: str):
from distutils.dir_util import copy_tree
from bcl import get_profile_install_dirs
dest_dir = path_join(opts.install_dir, '%s-%s-%s' % (product, target, opts.configuration), 'lib/mono/4.5')
for src_dir in get_profile_install_dirs(opts, 'desktop'):
if not os.path.isdir(src_dir):
raise BuildError('BCL source directory does not exist: %s. The BCL must be built prior to this.' % src_dir)
copy_tree(src_dir, dest_dir)
def clean(opts: DesktopOpts, product: str, target_platform: str, target: str):
rm_rf(
@@ -215,13 +223,14 @@ def run_main(raw_args, target_platform):
actions = OrderedDict()
actions['configure'] = configure
actions['make'] = make
actions['copy-bcl'] = copy_bcl
actions['clean'] = clean
parser = cmd_utils.build_arg_parser(description='Builds the Mono runtime for the Desktop')
default_help = 'default: %(default)s'
parser.add_argument('action', choices=['configure', 'make', 'clean'])
parser.add_argument('action', choices=['configure', 'make', 'copy-bcl', 'clean'])
parser.add_argument('--target', choices=targets[target_platform], action='append', required=True)
parser.add_argument('--with-llvm', action='store_true', default=False, help=default_help)

View File

@@ -6,8 +6,8 @@ index 3cb127bad59..30ff5edc307 100644
*/
#include <config.h>
-#if defined(HOST_WATCHOS) && (__WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_3_0)
+#if (defined(HOST_WATCHOS) && (__WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_3_0)) \
-#if (defined(HOST_WATCHOS) && (__WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_3_0)) || defined(HOST_MACCAT)
+#if (defined(HOST_WATCHOS) && (__WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_3_0)) || defined(HOST_MACCAT) \
+ || (defined(HOST_IOS) && (__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 100000))
/* emitted by clang:
* > /Users/lewurm/work/mono-watch4/mono/utils/mono-log-darwin.c:35:2: error: 'asl_log' is \

View File

@@ -0,0 +1,52 @@
diff --git a/mono/mini/aot-runtime-wasm.c b/mono/mini/aot-runtime-wasm.c
index ccc5a26510c..2f7001be00b 100644
--- a/mono/mini/aot-runtime-wasm.c
+++ b/mono/mini/aot-runtime-wasm.c
@@ -112,6 +112,22 @@ mono_wasm_interp_to_native_trampoline (void *target_func, InterpMethodArguments
icall_trampoline_dispatch (cookie, target_func, margs);
}
+typedef mono_bool (*GodotMonoM2nIcallTrampolineDispatch)(const char *cookie, void *target_func, InterpMethodArguments *margs);
+
+GodotMonoM2nIcallTrampolineDispatch m2n_icall_trampoline_dispatch_hook = NULL;
+
+GodotMonoM2nIcallTrampolineDispatch
+godot_mono_get_m2n_icall_trampoline_dispatch_hook (void)
+{
+ return m2n_icall_trampoline_dispatch_hook;
+}
+
+MONO_API void
+godot_mono_register_m2n_icall_trampoline_dispatch_hook (GodotMonoM2nIcallTrampolineDispatch hook)
+{
+ m2n_icall_trampoline_dispatch_hook = hook;
+}
+
#else /* TARGET_WASM */
MONO_EMPTY_SOURCE_FILE (aot_runtime_wasm);
diff --git a/mono/mini/wasm_m2n_invoke.g.h b/mono/mini/wasm_m2n_invoke.g.h
index aea7e9698ad..3bb715f9fd8 100644
--- a/mono/mini/wasm_m2n_invoke.g.h
+++ b/mono/mini/wasm_m2n_invoke.g.h
@@ -1017,6 +1017,10 @@ wasm_invoke_vil (void *target_func, InterpMethodArguments *margs)
}
+typedef mono_bool (*GodotMonoM2nIcallTrampolineDispatch)(const char *cookie, void *target_func, InterpMethodArguments *margs);
+
+GodotMonoM2nIcallTrampolineDispatch godot_mono_get_m2n_icall_trampoline_dispatch_hook (void);
+
static void
icall_trampoline_dispatch (const char *cookie, void *target_func, InterpMethodArguments *margs)
{
@@ -1820,5 +1824,9 @@ icall_trampoline_dispatch (const char *cookie, void *target_func, InterpMethodAr
}
}
}
+ GodotMonoM2nIcallTrampolineDispatch trampoline_dispatch_hook = godot_mono_get_m2n_icall_trampoline_dispatch_hook ();
+ if (trampoline_dispatch_hook != NULL && trampoline_dispatch_hook (cookie, target_func, margs)) {
+ return;
+ }
g_error ("CANNOT HANDLE COOKIE %s\n", cookie);
}

48
format.sh Executable file
View File

@@ -0,0 +1,48 @@
#!/usr/bin/env bash
set -uo pipefail
IFS=$'\n\t'
# Loops through all text files tracked by Git.
git grep -zIl '' |
while IFS= read -rd '' f; do
# Exclude csproj and hdr files, and patches.
if [[ "$f" == *"csproj" ]]; then
continue
elif [[ "$f" == *"hdr" ]]; then
continue
elif [[ "$f" == *"diff" ]]; then
continue
elif [[ "$f" == *"patch" ]]; then
continue
fi
# Ensures that files are UTF-8 formatted.
recode UTF-8 "$f" 2> /dev/null
# Ensures that files have LF line endings.
dos2unix "$f" 2> /dev/null
# Ensures that files do not contain a BOM.
sed -i '1s/^\xEF\xBB\xBF//' "$f"
# Ensures that files end with newline characters.
tail -c1 < "$f" | read -r _ || echo >> "$f";
# Remove trailing space characters.
sed -z -i 's/\x20\x0A/\x0A/g' "$f"
done
git diff > patch.patch
FILESIZE="$(stat -c%s patch.patch)"
MAXSIZE=5
# If no patch has been generated all is OK, clean up, and exit.
if (( FILESIZE < MAXSIZE )); then
printf "Files in this commit comply with the formatting rules.\n"
rm -f patch.patch
exit 0
fi
# A patch has been created, notify the user, clean up, and exit.
printf "\n*** The following differences were found between the code "
printf "and the formatting rules:\n\n"
cat patch.patch
printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n"
rm -f patch.patch
exit 1

16
ios.py
View File

@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python3
import os
import os.path
@@ -96,6 +96,9 @@ def setup_ios_device_template(env: dict, opts: iOSOpts, target: str):
'ac_cv_func_futimens=no',
'ac_cv_func_utimensat=no',
'ac_cv_func_shm_open_working_with_mmap=no',
'ac_cv_func_pthread_jit_write_protect_np=no',
'ac_cv_func_preadv=no',
'ac_cv_func_pwritev=no',
'mono_cv_sizeof_sunpath=104',
'mono_cv_uscore=yes'
]
@@ -121,13 +124,7 @@ def setup_ios_device_template(env: dict, opts: iOSOpts, target: str):
'-DSMALL_CONFIG', '-D_XOPEN_SOURCE', '-DHOST_IOS', '-DHAVE_LARGE_FILE_SUPPORT=1'
]
LDFLAGS = []
# https://github.com/mono/mono/issues/19393
if os.environ.get('DISABLE_NO_WEAK_IMPORTS', '0') != '1':
LDFLAGS += ['-Wl,-no_weak_imports']
LDFLAGS += [
LDFLAGS = [
'-arch %s' % arch,
'-framework', 'CoreFoundation',
'-lobjc', '-lc++'
@@ -225,6 +222,9 @@ def setup_ios_simulator_template(env: dict, opts: iOSOpts, target: str):
'ac_cv_func_futimens=no',
'ac_cv_func_utimensat=no',
'ac_cv_func_shm_open_working_with_mmap=no',
'ac_cv_func_pthread_jit_write_protect_np=no',
'ac_cv_func_preadv=no',
'ac_cv_func_pwritev=no',
'mono_cv_uscore=yes'
]

View File

@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python3
from desktop import run_main

View File

@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python3
import os
import sys
@@ -38,8 +38,8 @@ def make(opts: BaseOpts, target: str):
CMAKE_ARGS += [
'-DCMAKE_EXE_LINKER_FLAGS="-static"',
'-DCROSS_TOOLCHAIN_FLAGS_NATIVE=-DCMAKE_TOOLCHAIN_FILE=%s/external/llvm/cmake/modules/NATIVE.cmake' % opts.mono_source_root,
'-DCMAKE_TOOLCHAIN_FILE=%s/external/llvm/cmake/modules/%s.cmake' % (opts.mono_source_root, mxe),
'-DCROSS_TOOLCHAIN_FLAGS_NATIVE=-DCMAKE_TOOLCHAIN_FILE=%s/external/llvm-project/llvm/cmake/modules/NATIVE.cmake' % opts.mono_source_root,
'-DCMAKE_TOOLCHAIN_FILE=%s/external/llvm-project/llvm/cmake/modules/%s.cmake' % (opts.mono_source_root, mxe),
'-DLLVM_ENABLE_THREADS=Off',
'-DLLVM_BUILD_EXECUTION_ENGINE=Off'
]
@@ -58,7 +58,7 @@ def make(opts: BaseOpts, target: str):
replace_in_new_file(
src_file='%s/sdks/builds/%s.cmake.in' % (opts.mono_source_root, mxe),
search='@MXE_PATH@', replace=opts.mxe_prefix,
dst_file='%s/external/llvm/cmake/modules/%s.cmake' % (opts.mono_source_root, mxe)
dst_file='%s/external/llvm-project/llvm/cmake/modules/%s.cmake' % (opts.mono_source_root, mxe)
)
if target in ['llvm32', 'llvmwin32']:

61
msbuild_helper.py Normal file
View File

@@ -0,0 +1,61 @@
import os
from os_utils import *
def find_dotnet_cli():
import os.path
for hint_dir in os.environ["PATH"].split(os.pathsep):
hint_dir = hint_dir.strip('"')
hint_path = os.path.join(hint_dir, "dotnet")
if os.path.isfile(hint_path) and os.access(hint_path, os.X_OK):
return hint_path
def find_msbuild():
import os.path
import sys
hint_dirs = []
if sys.platform == "darwin":
hint_dirs[:0] = [
"/Library/Frameworks/Mono.framework/Versions/Current/bin",
"/usr/local/var/homebrew/linked/mono/bin",
]
for hint_dir in hint_dirs:
hint_path = os.path.join(hint_dir, "msbuild")
if os.path.isfile(hint_path):
return hint_path
for hint_dir in os.environ["PATH"].split(os.pathsep):
hint_dir = hint_dir.strip('"')
hint_path = os.path.join(hint_dir, "msbuild")
if os.path.isfile(hint_path) and os.access(hint_path, os.X_OK):
return hint_path
return None
def build_solution(solution_path, build_config, extra_msbuild_args=[]):
msbuild_args = []
dotnet_cli = find_dotnet_cli()
if dotnet_cli:
msbuild_path = dotnet_cli
msbuild_args += ["msbuild"] # `dotnet msbuild` command
else:
msbuild_path = find_msbuild()
if msbuild_path is None:
raise BuildError("Cannot find MSBuild executable")
print("MSBuild path: " + msbuild_path)
# Build solution
msbuild_args += [solution_path, "/restore", "/t:Build", "/p:Configuration=" + build_config]
msbuild_args += extra_msbuild_args
run_command(msbuild_path, msbuild_args, name="msbuild")

2
osx.py
View File

@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python3
from desktop import run_main

View File

@@ -1,5 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python3
def main(raw_args):
import os
@@ -24,7 +23,6 @@ def main(raw_args):
patches = [
'%s/sdks/builds/fix-emscripten-8511.diff' % mono_source_root,
'%s/sdks/builds/emscripten-pr-8457.diff' % mono_source_root
]
from subprocess import Popen

View File

@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python3
def main(raw_args):
@@ -29,7 +29,8 @@ def main(raw_args):
'fix-mono-android-tkill.diff',
'mono-dbg-agent-clear-tls-instead-of-abort.diff',
'bcl-profile-platform-override.diff',
'mono_ios_asl_log_deprecated.diff'
'mono_ios_asl_log_deprecated.diff',
'wasm_m2n_trampolines_hook.diff',
]
if os.path.isfile(os.path.join(mono_source_root, 'mono/tools/offsets-tool/offsets-tool.py')):

View File

@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python3
import sys

View File

@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python3
import os
import os.path

View File

@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python3
from desktop import run_main