Compare commits

..

7 Commits

Author SHA1 Message Date
Rémi Verschelde
9fb4d32e35 Merge pull request #92 from godotengine/update-ci
CI: Bump actions, various fixes, update to Mono 6.12.0.206
2025-10-12 13:03:45 +02:00
Rémi Verschelde
945d2619f8 CI: Bump actions, various fixes, update to Mono 6.12.0.206
- Update TuxFamily links for Linux SDKs.
- Downgrade CMake to v3 on macOS, it breaks building old LLVM.
- Fix conflict between LLVM `regex_impl.h` header guard and Xcode SDK.
- Pin `macos-13` as newer ones are arm64-based and our scripts don't seem
  to infer this properly.
- Patch Mono `offsets-tool.py` to support newer Clang (dotnet patches).
2025-10-12 12:14:33 +02:00
Rémi Verschelde
4912f62a8f Revert "Add patch to fix Linux kernel regression with mmap and MAP_32BIT"
This reverts commit d496154ab1.

The Linux kernel regression has been patched in 6.1.30 and 6.3.4.
2023-06-02 15:55:02 +02:00
Rémi Verschelde
6236e2ee74 CI: Mono 6.12.0.198, Python 3.11, use ubuntu-latest
- Rediff patches against Mono 6.12.0.198.
- Drop `xcode_13_14_fix.diff` which is included upstream in 6.12.0.198.
2023-05-26 12:59:57 +02:00
Rémi Verschelde
d496154ab1 Add patch to fix Linux kernel regression with mmap and MAP_32BIT 2023-05-26 12:58:55 +02:00
Rémi Verschelde
8767196960 Merge pull request #80 from bruvzg/btls_arm_macos
Add patch for ARM64 macOS BTLS build.
2023-02-09 22:57:44 +01:00
bruvzg
a0e457e7c1 Add patch for ARM64 macOS BTLS build. 2023-02-09 21:16:57 +02:00
17 changed files with 489 additions and 148 deletions

View File

@@ -23,17 +23,19 @@ on:
env: env:
# Use SHA or tag instead of the branch for caching purposes. # Use SHA or tag instead of the branch for caching purposes.
MONO_TAG: mono-6.12.0.182 MONO_TAG: mono-6.12.0.206
PYTHON_VERSION: '3.10' PYTHON_VERSION: '3.11'
# Should match the version that Mono supports. # Should match the version that Mono supports.
EMSDK_VERSION: 1.39.9 EMSDK_VERSION: 1.39.9
# platform/iphone/detect.py # platform/iphone/detect.py
IOS_VERSION_MIN: 10.0 IOS_VERSION_MIN: 12.0
# Supporting Xcode 15+ requires backporting a bunch of stuff.
XCODE_VERSION: 14.3.1
jobs: jobs:
linux: linux:
name: Linux name: Linux
runs-on: ubuntu-latest runs-on: ubuntu-22.04
strategy: strategy:
matrix: matrix:
target: [x86, x86_64] target: [x86, x86_64]
@@ -49,37 +51,37 @@ jobs:
if: matrix.target == 'x86_64' if: matrix.target == 'x86_64'
run: | run: |
cd /home/runner cd /home/runner
curl -LO https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2 curl -LO https://github.com/godotengine/buildroot/releases/download/godot-2023.08.x-4/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
tar xf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2 tar xf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
rm -f x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2 rm -f x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
cd x86_64-godot-linux-gnu_sdk-buildroot cd x86_64-godot-linux-gnu_sdk-buildroot
./relocate-sdk.sh ./relocate-sdk.sh
cd bin cd bin
rm -f {aclocal*,auto*,libtool*,m4}
for file in x86_64-godot-*; do alias=$(echo $file | sed "s/godot-//"); ln -s $file $alias; done for file in x86_64-godot-*; do alias=$(echo $file | sed "s/godot-//"); ln -s $file $alias; done
echo "PATH=/home/runner/x86_64-godot-linux-gnu_sdk-buildroot/bin:${PATH}" >> $GITHUB_ENV echo "PATH=/home/runner/x86_64-godot-linux-gnu_sdk-buildroot/bin:${PATH}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/home/runner/x86_64-godot-linux-gnu_sdk-buildroot/x86_64-godot-linux-gnu/lib64:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
- name: Install Linux SDK (x86) - name: Install Linux SDK (x86)
if: matrix.target == 'x86' if: matrix.target == 'x86'
run: | run: |
cd /home/runner cd /home/runner
curl -LO https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/i686-godot-linux-gnu_sdk-buildroot.tar.bz2 curl -LO https://github.com/godotengine/buildroot/releases/download/godot-2023.08.x-4/i686-godot-linux-gnu_sdk-buildroot.tar.bz2
tar xf i686-godot-linux-gnu_sdk-buildroot.tar.bz2 tar xf i686-godot-linux-gnu_sdk-buildroot.tar.bz2
rm -f i686-godot-linux-gnu_sdk-buildroot.tar.bz2 rm -f i686-godot-linux-gnu_sdk-buildroot.tar.bz2
cd i686-godot-linux-gnu_sdk-buildroot cd i686-godot-linux-gnu_sdk-buildroot
./relocate-sdk.sh ./relocate-sdk.sh
cd bin cd bin
rm -f {aclocal*,auto*,libtool*,m4}
for file in i686-godot-*; do alias=$(echo $file | sed "s/godot-//"); ln -s $file $alias; done for file in i686-godot-*; do alias=$(echo $file | sed "s/godot-//"); ln -s $file $alias; done
echo "PATH=/home/runner/i686-godot-linux-gnu_sdk-buildroot/bin:${PATH}" >> $GITHUB_ENV echo "PATH=/home/runner/i686-godot-linux-gnu_sdk-buildroot/bin:${PATH}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/home/runner/i686-godot-linux-gnu_sdk-buildroot/i686-godot-linux-gnu/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
- name: Cache Mono Sources - name: Cache Mono Sources
id: cache_mono_sources id: cache_mono_sources
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: ${{ env.MONO_SOURCE_ROOT }} path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources - name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true' if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3 uses: actions/checkout@v5
with: with:
repository: mono/mono repository: mono/mono
ref: ${{ env.MONO_TAG }} ref: ${{ env.MONO_TAG }}
@@ -88,11 +90,11 @@ jobs:
- name: Clean Mono - name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v5
with: with:
path: godot-mono-builds path: godot-mono-builds
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v4 uses: actions/setup-python@v6
with: with:
python-version: ${{ env.PYTHON_VERSION }} python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono - name: Patch Mono
@@ -109,7 +111,7 @@ jobs:
mkdir -p $HOME/mono-installs-artifacts mkdir -p $HOME/mono-installs-artifacts
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/linux-${{ matrix.target }}.zip desktop-linux-${{ matrix.target }}-release) (cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/linux-${{ matrix.target }}.zip desktop-linux-${{ matrix.target }}-release)
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: linux-${{ matrix.target }} name: linux-${{ matrix.target }}
path: ~/mono-installs-artifacts/linux-${{ matrix.target }}.zip path: ~/mono-installs-artifacts/linux-${{ matrix.target }}.zip
@@ -117,14 +119,14 @@ jobs:
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Upload config.log After Error - name: Upload config.log After Error
if: ${{ failure() }} if: ${{ failure() }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: linux-${{ matrix.target }}-config.log name: linux-${{ matrix.target }}-config.log
path: ~/mono-configs/desktop-linux-${{ matrix.target }}-release/config.log path: ~/mono-configs/desktop-linux-${{ matrix.target }}-release/config.log
windows: windows:
name: Windows name: Windows
runs-on: ubuntu-latest runs-on: ubuntu-22.04
strategy: strategy:
matrix: matrix:
target: [x86, x86_64] target: [x86, x86_64]
@@ -147,13 +149,13 @@ jobs:
sudo apt-get -y install mingw-w64 libz-mingw-w64-dev sudo apt-get -y install mingw-w64 libz-mingw-w64-dev
- name: Cache Mono Sources - name: Cache Mono Sources
id: cache_mono_sources id: cache_mono_sources
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: ${{ env.MONO_SOURCE_ROOT }} path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources - name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true' if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3 uses: actions/checkout@v5
with: with:
repository: mono/mono repository: mono/mono
ref: ${{ env.MONO_TAG }} ref: ${{ env.MONO_TAG }}
@@ -162,11 +164,11 @@ jobs:
- name: Clean Mono - name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v5
with: with:
path: godot-mono-builds path: godot-mono-builds
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v4 uses: actions/setup-python@v6
with: with:
python-version: ${{ env.PYTHON_VERSION }} python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono - name: Patch Mono
@@ -183,7 +185,7 @@ jobs:
mkdir -p $HOME/mono-installs-artifacts mkdir -p $HOME/mono-installs-artifacts
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/windows-${{ matrix.target }}.zip desktop-windows-${{ matrix.target }}-release) (cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/windows-${{ matrix.target }}.zip desktop-windows-${{ matrix.target }}-release)
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: windows-${{ matrix.target }} name: windows-${{ matrix.target }}
path: ~/mono-installs-artifacts/windows-${{ matrix.target }}.zip path: ~/mono-installs-artifacts/windows-${{ matrix.target }}.zip
@@ -191,14 +193,14 @@ jobs:
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Upload config.log After Error - name: Upload config.log After Error
if: ${{ failure() }} if: ${{ failure() }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: windows-${{ matrix.target }}-config.log name: windows-${{ matrix.target }}-config.log
path: ~/mono-configs/desktop-windows-${{ matrix.target }}-release/config.log path: ~/mono-configs/desktop-windows-${{ matrix.target }}-release/config.log
osx: osx:
name: macOS name: macOS
runs-on: macos-latest runs-on: macos-13
strategy: strategy:
matrix: matrix:
target: [arm64, x86_64] target: [arm64, x86_64]
@@ -206,18 +208,26 @@ jobs:
- name: Set Environment Variables - name: Set Environment Variables
run: | run: |
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Setup compatible Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}
- name: Install Dependencies - name: Install Dependencies
run: | run: |
brew install autoconf automake libtool pkg-config cmake python3 brew install automake
- name: Install cmake 3
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.31.7'
- name: Cache Mono Sources - name: Cache Mono Sources
id: cache_mono_sources id: cache_mono_sources
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: ${{ env.MONO_SOURCE_ROOT }} path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources - name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true' if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3 uses: actions/checkout@v5
with: with:
repository: mono/mono repository: mono/mono
ref: ${{ env.MONO_TAG }} ref: ${{ env.MONO_TAG }}
@@ -226,15 +236,15 @@ jobs:
- name: Clean Mono - name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v5
with: with:
path: godot-mono-builds path: godot-mono-builds
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v4 uses: actions/setup-python@v6
with: with:
python-version: ${{ env.PYTHON_VERSION }} python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono - name: Patch Mono
run: run: |
python3 godot-mono-builds/patch_mono.py python3 godot-mono-builds/patch_mono.py
- name: Configure - name: Configure
run: run:
@@ -247,7 +257,7 @@ jobs:
mkdir -p $HOME/mono-installs-artifacts mkdir -p $HOME/mono-installs-artifacts
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/osx-${{ matrix.target }}.zip desktop-osx-${{ matrix.target }}-release) (cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/osx-${{ matrix.target }}.zip desktop-osx-${{ matrix.target }}-release)
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: osx-${{ matrix.target }} name: osx-${{ matrix.target }}
path: ~/mono-installs-artifacts/osx-${{ matrix.target }}.zip path: ~/mono-installs-artifacts/osx-${{ matrix.target }}.zip
@@ -255,14 +265,14 @@ jobs:
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Upload config.log After Error - name: Upload config.log After Error
if: ${{ failure() }} if: ${{ failure() }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: osx-${{ matrix.target }}-config.log name: osx-${{ matrix.target }}-config.log
path: ~/mono-configs/desktop-osx-${{ matrix.target }}-release/config.log path: ~/mono-configs/desktop-osx-${{ matrix.target }}-release/config.log
ios: ios:
name: iOS name: iOS
runs-on: macos-latest runs-on: macos-13
strategy: strategy:
matrix: matrix:
target: [arm64, x86_64, arm64-sim] target: [arm64, x86_64, arm64-sim]
@@ -270,18 +280,26 @@ jobs:
- name: Set Environment Variables - name: Set Environment Variables
run: | run: |
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Setup compatible Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}
- name: Install Dependencies - name: Install Dependencies
run: | run: |
brew install autoconf automake libtool pkg-config cmake python3 brew install automake
- name: Install cmake 3
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.31.7'
- name: Cache Mono Sources - name: Cache Mono Sources
id: cache_mono_sources id: cache_mono_sources
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: ${{ env.MONO_SOURCE_ROOT }} path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources - name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true' if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3 uses: actions/checkout@v5
with: with:
repository: mono/mono repository: mono/mono
ref: ${{ env.MONO_TAG }} ref: ${{ env.MONO_TAG }}
@@ -290,15 +308,15 @@ jobs:
- name: Clean Mono - name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v5
with: with:
path: godot-mono-builds path: godot-mono-builds
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v4 uses: actions/setup-python@v6
with: with:
python-version: ${{ env.PYTHON_VERSION }} python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono - name: Patch Mono
run: run: |
python3 godot-mono-builds/patch_mono.py python3 godot-mono-builds/patch_mono.py
- name: Configure - name: Configure
run: | run: |
@@ -312,7 +330,7 @@ jobs:
mkdir -p $HOME/mono-installs-artifacts mkdir -p $HOME/mono-installs-artifacts
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/ios-${{ matrix.target }}.zip ios-${{ matrix.target }}-release) (cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/ios-${{ matrix.target }}.zip ios-${{ matrix.target }}-release)
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: ios-${{ matrix.target }} name: ios-${{ matrix.target }}
path: ~/mono-installs-artifacts/ios-${{ matrix.target }}.zip path: ~/mono-installs-artifacts/ios-${{ matrix.target }}.zip
@@ -320,15 +338,16 @@ jobs:
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Upload config.log After Error - name: Upload config.log After Error
if: ${{ failure() }} if: ${{ failure() }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: ios-${{ matrix.target }}-config.log name: ios-${{ matrix.target }}-config.log
path: ~/mono-configs/ios-${{ matrix.target }}-release/config.log path: ~/mono-configs/ios-${{ matrix.target }}-release/config.log
ios-cross: ios-cross:
# Disable for now as it doesn't build.
needs: llvm needs: llvm
name: iOS Cross-compiler name: iOS Cross-compiler
runs-on: macos-latest runs-on: macos-13
strategy: strategy:
matrix: matrix:
target: [cross-arm64] target: [cross-arm64]
@@ -340,18 +359,26 @@ jobs:
- name: Set Environment Variables - name: Set Environment Variables
run: | run: |
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Setup compatible Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}
- name: Install Dependencies - name: Install Dependencies
run: | run: |
brew install autoconf automake libtool pkg-config cmake python3 brew install automake
- name: Install cmake 3
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.31.7'
- name: Cache Mono Sources - name: Cache Mono Sources
id: cache_mono_sources id: cache_mono_sources
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: ${{ env.MONO_SOURCE_ROOT }} path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources - name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true' if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3 uses: actions/checkout@v5
with: with:
repository: mono/mono repository: mono/mono
ref: ${{ env.MONO_TAG }} ref: ${{ env.MONO_TAG }}
@@ -360,20 +387,20 @@ jobs:
- name: Clean Mono - name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v5
with: with:
path: godot-mono-builds path: godot-mono-builds
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v4 uses: actions/setup-python@v6
with: with:
python-version: ${{ env.PYTHON_VERSION }} python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono - name: Patch Mono
run: run: |
python3 godot-mono-builds/patch_mono.py python3 godot-mono-builds/patch_mono.py
- name: Download LLVM artifact - name: Download LLVM artifact
uses: actions/download-artifact@v3 uses: actions/download-artifact@v5
with: with:
name: llvm-${{ matrix.llvm }}-macos-latest name: llvm-${{ matrix.llvm }}-macos-13
# Tilde ~/ not supported when downloading yet: https://github.com/actions/download-artifact/issues/37 # Tilde ~/ not supported when downloading yet: https://github.com/actions/download-artifact/issues/37
# File permissions are also messed up: https://github.com/actions/upload-artifact/issues/38 # File permissions are also messed up: https://github.com/actions/upload-artifact/issues/38
# We have to manually move the folder and restore the file permissions in the next step. # We have to manually move the folder and restore the file permissions in the next step.
@@ -399,7 +426,7 @@ jobs:
mkdir -p $HOME/mono-installs-artifacts mkdir -p $HOME/mono-installs-artifacts
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/ios-${{ matrix.target }}.zip ios-${{ matrix.target }}-release) (cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/ios-${{ matrix.target }}.zip ios-${{ matrix.target }}-release)
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: ios-${{ matrix.target }} name: ios-${{ matrix.target }}
path: ~/mono-installs-artifacts/ios-${{ matrix.target }}.zip path: ~/mono-installs-artifacts/ios-${{ matrix.target }}.zip
@@ -407,27 +434,26 @@ jobs:
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Upload Runtime config.log After Error - name: Upload Runtime config.log After Error
if: ${{ failure() }} if: ${{ failure() }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: ios-${{ matrix.target }}-runtime-config.log name: ios-${{ matrix.target }}-runtime-config.log
path: ~/mono-configs/ios-${{ matrix.runtime_target }}-release/config.log path: ~/mono-configs/ios-${{ matrix.runtime_target }}-release/config.log
- name: Upload Cross config.log After Error - name: Upload Cross config.log After Error
if: ${{ failure() }} if: ${{ failure() }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: ios-${{ matrix.target }}-config.log name: ios-${{ matrix.target }}-config.log
path: ~/mono-configs/ios-${{ matrix.target }}-release/config.log path: ~/mono-configs/ios-${{ matrix.target }}-release/config.log
android: android:
name: Android name: Android
runs-on: ubuntu-latest runs-on: ubuntu-22.04
strategy: strategy:
matrix: matrix:
target: [armv7, arm64v8, x86, x86_64] target: [armv7, arm64v8, x86, x86_64]
steps: steps:
- name: Set Environment Variables - name: Set Environment Variables
run: | run: |
env
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Install Dependencies - name: Install Dependencies
run: | run: |
@@ -435,13 +461,13 @@ jobs:
sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl
- name: Cache Mono Sources - name: Cache Mono Sources
id: cache_mono_sources id: cache_mono_sources
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: ${{ env.MONO_SOURCE_ROOT }} path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources - name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true' if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3 uses: actions/checkout@v5
with: with:
repository: mono/mono repository: mono/mono
ref: ${{ env.MONO_TAG }} ref: ${{ env.MONO_TAG }}
@@ -450,11 +476,11 @@ jobs:
- name: Clean Mono - name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v5
with: with:
path: godot-mono-builds path: godot-mono-builds
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v4 uses: actions/setup-python@v6
with: with:
python-version: ${{ env.PYTHON_VERSION }} python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono - name: Patch Mono
@@ -471,7 +497,7 @@ jobs:
mkdir -p $HOME/mono-installs-artifacts mkdir -p $HOME/mono-installs-artifacts
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/android-${{ matrix.target }}.zip android-${{ matrix.target }}-release) (cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/android-${{ matrix.target }}.zip android-${{ matrix.target }}-release)
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: android-${{ matrix.target }} name: android-${{ matrix.target }}
path: ~/mono-installs-artifacts/android-${{ matrix.target }}.zip path: ~/mono-installs-artifacts/android-${{ matrix.target }}.zip
@@ -479,14 +505,14 @@ jobs:
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Upload config.log After Error - name: Upload config.log After Error
if: ${{ failure() }} if: ${{ failure() }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: android-${{ matrix.target }}-config.log name: android-${{ matrix.target }}-config.log
path: ~/mono-configs/android-${{ matrix.target }}-release/config.log path: ~/mono-configs/android-${{ matrix.target }}-release/config.log
wasm: wasm:
name: WebAssembly name: WebAssembly
runs-on: ubuntu-latest runs-on: ubuntu-22.04
strategy: strategy:
matrix: matrix:
target: [runtime, runtime-threads] target: [runtime, runtime-threads]
@@ -500,13 +526,13 @@ jobs:
sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl sudo apt-get -y install git autoconf libtool libtool-bin automake build-essential gettext cmake python3 curl
- name: Cache Mono Sources - name: Cache Mono Sources
id: cache_mono_sources id: cache_mono_sources
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: ${{ env.MONO_SOURCE_ROOT }} path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources - name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true' if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3 uses: actions/checkout@v5
with: with:
repository: mono/mono repository: mono/mono
ref: ${{ env.MONO_TAG }} ref: ${{ env.MONO_TAG }}
@@ -515,15 +541,15 @@ jobs:
- name: Clean Mono - name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v5
with: with:
path: godot-mono-builds path: godot-mono-builds
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v4 uses: actions/setup-python@v6
with: with:
python-version: ${{ env.PYTHON_VERSION }} python-version: ${{ env.PYTHON_VERSION }}
- name: Setup Emscripten SDK - name: Setup Emscripten SDK
uses: mymindstorm/setup-emsdk@v11 uses: mymindstorm/setup-emsdk@v14
with: with:
version: ${{ env.EMSDK_VERSION }} version: ${{ env.EMSDK_VERSION }}
- name: Patch Mono - name: Patch Mono
@@ -540,7 +566,7 @@ jobs:
mkdir -p $HOME/mono-installs-artifacts mkdir -p $HOME/mono-installs-artifacts
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/wasm-${{ matrix.target }}.zip wasm-${{ matrix.target }}-release) (cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/wasm-${{ matrix.target }}.zip wasm-${{ matrix.target }}-release)
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: wasm-${{ matrix.target }} name: wasm-${{ matrix.target }}
path: ~/mono-installs-artifacts/wasm-${{ matrix.target }}.zip path: ~/mono-installs-artifacts/wasm-${{ matrix.target }}.zip
@@ -548,7 +574,7 @@ jobs:
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Upload config.log After Error - name: Upload config.log After Error
if: ${{ failure() }} if: ${{ failure() }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: wasm-${{ matrix.target }}-config.log name: wasm-${{ matrix.target }}-config.log
path: ~/mono-configs/wasm-${{ matrix.target }}-release/config.log path: ~/mono-configs/wasm-${{ matrix.target }}-release/config.log
@@ -558,22 +584,27 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, macos-latest] os: [ubuntu-22.04, macos-13]
target: [llvm64, llvmwin64] target: [llvm64, llvmwin64]
exclude: exclude:
# We already build for Windows on ubuntu-latest # We already build for Windows on ubuntu-22.04
- os: macos-latest - os: macos-13
target: llvmwin64 target: llvmwin64
steps: steps:
- name: Cache LLVM - name: Cache LLVM
id: cache_llvm id: cache_llvm
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: ~/mono-installs/llvm-${{ matrix.target }} path: ~/mono-installs/llvm-${{ matrix.target }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-llvm-${{ matrix.target }} key: ${{ runner.os }}-${{ env.MONO_TAG }}-llvm-${{ matrix.target }}
- name: Set Environment Variables - name: Set Environment Variables
run: | run: |
echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV echo "MONO_SOURCE_ROOT=$GITHUB_WORKSPACE/mono_sources" >> $GITHUB_ENV
- name: Setup compatible Xcode version
if: steps.cache_llvm.outputs.cache-hit != 'true' && matrix.os == 'macos-13'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}
- name: Install Dependencies (Linux) - name: Install Dependencies (Linux)
if: steps.cache_llvm.outputs.cache-hit != 'true' && runner.os == 'Linux' if: steps.cache_llvm.outputs.cache-hit != 'true' && runner.os == 'Linux'
run: | run: |
@@ -583,33 +614,38 @@ jobs:
if: steps.cache_llvm.outputs.cache-hit != 'true' && runner.os == 'Linux' if: steps.cache_llvm.outputs.cache-hit != 'true' && runner.os == 'Linux'
run: | run: |
cd /home/runner cd /home/runner
curl -LO https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2 curl -LO https://github.com/godotengine/buildroot/releases/download/godot-2023.08.x-4/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
tar xf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2 tar xf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
rm -f x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2 rm -f x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
cd x86_64-godot-linux-gnu_sdk-buildroot cd x86_64-godot-linux-gnu_sdk-buildroot
./relocate-sdk.sh ./relocate-sdk.sh
cd bin cd bin
rm -f {aclocal*,auto*,libtool*,m4}
for file in x86_64-godot-*; do alias=$(echo $file | sed "s/godot-//"); ln -s $file $alias; done for file in x86_64-godot-*; do alias=$(echo $file | sed "s/godot-//"); ln -s $file $alias; done
echo "PATH=/home/runner/x86_64-godot-linux-gnu_sdk-buildroot/bin:${PATH}" >> $GITHUB_ENV echo "PATH=/home/runner/x86_64-godot-linux-gnu_sdk-buildroot/bin:${PATH}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/home/runner/x86_64-godot-linux-gnu_sdk-buildroot/x86_64-godot-linux-gnu/lib64:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
- name: Install Dependencies (Linux Targeting Windows) - name: Install Dependencies (Linux Targeting Windows)
if: steps.cache_llvm.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.target == 'llvmwin64' if: steps.cache_llvm.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.target == 'llvmwin64'
run: | run: |
sudo apt-get -y install mingw-w64 libz-mingw-w64-dev sudo apt-get -y install mingw-w64 libz-mingw-w64-dev
- name: Install Dependencies (macOS) - name: Install Dependencies (macOS)
if: steps.cache_llvm.outputs.cache-hit != 'true' && matrix.os == 'macos-latest' if: steps.cache_llvm.outputs.cache-hit != 'true' && matrix.os == 'macos-13'
run: | run: |
brew install autoconf automake libtool pkg-config cmake python3 brew install automake
- name: Install cmake 3 (macOS)
if: steps.cache_llvm.outputs.cache-hit != 'true' && matrix.os == 'macos-13'
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.31.7'
- name: Cache Mono Sources - name: Cache Mono Sources
if: steps.cache_llvm.outputs.cache-hit != 'true' if: steps.cache_llvm.outputs.cache-hit != 'true'
id: cache_mono_sources id: cache_mono_sources
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: ${{ env.MONO_SOURCE_ROOT }} path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources - name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true' && steps.cache_llvm.outputs.cache-hit != 'true' if: steps.cache_mono_sources.outputs.cache-hit != 'true' && steps.cache_llvm.outputs.cache-hit != 'true'
uses: actions/checkout@v3 uses: actions/checkout@v5
with: with:
repository: mono/mono repository: mono/mono
ref: ${{ env.MONO_TAG }} ref: ${{ env.MONO_TAG }}
@@ -620,24 +656,24 @@ jobs:
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout - name: Checkout
if: steps.cache_llvm.outputs.cache-hit != 'true' if: steps.cache_llvm.outputs.cache-hit != 'true'
uses: actions/checkout@v3 uses: actions/checkout@v5
with: with:
path: godot-mono-builds path: godot-mono-builds
- name: Setup Python - name: Setup Python
if: steps.cache_llvm.outputs.cache-hit != 'true' if: steps.cache_llvm.outputs.cache-hit != 'true'
uses: actions/setup-python@v4 uses: actions/setup-python@v6
with: with:
python-version: ${{ env.PYTHON_VERSION }} python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono - name: Patch Mono
if: steps.cache_llvm.outputs.cache-hit != 'true' if: steps.cache_llvm.outputs.cache-hit != 'true'
run: run: |
python3 godot-mono-builds/patch_mono.py python3 godot-mono-builds/patch_mono.py
- name: Make - name: Make
if: steps.cache_llvm.outputs.cache-hit != 'true' if: steps.cache_llvm.outputs.cache-hit != 'true'
run: run:
python3 godot-mono-builds/llvm.py make --target=${{ matrix.target }} -j 2 python3 godot-mono-builds/llvm.py make --target=${{ matrix.target }} -j 2
- name: Upload LLVM Artifact - name: Upload LLVM Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: llvm-${{ matrix.target }}-${{ matrix.os }} name: llvm-${{ matrix.target }}-${{ matrix.os }}
path: ~/mono-installs/llvm-${{ matrix.target }} path: ~/mono-installs/llvm-${{ matrix.target }}
@@ -646,14 +682,14 @@ jobs:
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Upload config.log After Error - name: Upload config.log After Error
if: ${{ failure() }} if: ${{ failure() }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: llvm-${{ matrix.target }}-${{ matrix.os }}-config.log name: llvm-${{ matrix.target }}-${{ matrix.os }}-config.log
path: ~/mono-configs/llvm-${{ matrix.target }}/config.log path: ~/mono-configs/llvm-${{ matrix.target }}/config.log
bcl: bcl:
name: BCL name: BCL
runs-on: ubuntu-latest runs-on: ubuntu-22.04
strategy: strategy:
matrix: matrix:
product: [desktop, desktop-win32, android, ios, wasm] product: [desktop, desktop-win32, android, ios, wasm]
@@ -668,24 +704,24 @@ jobs:
- name: Install Linux SDK (x86_64) - name: Install Linux SDK (x86_64)
run: | run: |
cd /home/runner cd /home/runner
curl -LO https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2 curl -LO https://github.com/godotengine/buildroot/releases/download/godot-2023.08.x-4/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
tar xf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2 tar xf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
rm -f x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2 rm -f x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2
cd x86_64-godot-linux-gnu_sdk-buildroot cd x86_64-godot-linux-gnu_sdk-buildroot
./relocate-sdk.sh ./relocate-sdk.sh
cd bin cd bin
rm -f {aclocal*,auto*,libtool*,m4}
for file in x86_64-godot-*; do alias=$(echo $file | sed "s/godot-//"); ln -s $file $alias; done for file in x86_64-godot-*; do alias=$(echo $file | sed "s/godot-//"); ln -s $file $alias; done
echo "PATH=/home/runner/x86_64-godot-linux-gnu_sdk-buildroot/bin:${PATH}" >> $GITHUB_ENV echo "PATH=/home/runner/x86_64-godot-linux-gnu_sdk-buildroot/bin:${PATH}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/home/runner/x86_64-godot-linux-gnu_sdk-buildroot/x86_64-godot-linux-gnu/lib64:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
- name: Cache Mono Sources - name: Cache Mono Sources
id: cache_mono_sources id: cache_mono_sources
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: ${{ env.MONO_SOURCE_ROOT }} path: ${{ env.MONO_SOURCE_ROOT }}
key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources key: ${{ runner.os }}-${{ env.MONO_TAG }}-mono-sources
- name: Checkout Mono Sources - name: Checkout Mono Sources
if: steps.cache_mono_sources.outputs.cache-hit != 'true' if: steps.cache_mono_sources.outputs.cache-hit != 'true'
uses: actions/checkout@v3 uses: actions/checkout@v5
with: with:
repository: mono/mono repository: mono/mono
ref: ${{ env.MONO_TAG }} ref: ${{ env.MONO_TAG }}
@@ -694,11 +730,11 @@ jobs:
- name: Clean Mono - name: Clean Mono
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v5
with: with:
path: godot-mono-builds path: godot-mono-builds
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v4 uses: actions/setup-python@v6
with: with:
python-version: ${{ env.PYTHON_VERSION }} python-version: ${{ env.PYTHON_VERSION }}
- name: Patch Mono - name: Patch Mono
@@ -716,7 +752,7 @@ jobs:
mkdir -p $HOME/mono-installs-artifacts mkdir -p $HOME/mono-installs-artifacts
(cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/bcl-${{ matrix.product }}.zip ${{ matrix.product }}-bcl) (cd $HOME/mono-installs && zip -ry $HOME/mono-installs-artifacts/bcl-${{ matrix.product }}.zip ${{ matrix.product }}-bcl)
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: bcl-${{ matrix.product }} name: bcl-${{ matrix.product }}
path: ~/mono-installs-artifacts/bcl-${{ matrix.product }}.zip path: ~/mono-installs-artifacts/bcl-${{ matrix.product }}.zip
@@ -724,7 +760,7 @@ jobs:
run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd run: pushd ${{ env.MONO_SOURCE_ROOT }} && git reset --hard && git clean -xffd && git submodule foreach --recursive git reset --hard && git submodule foreach --recursive git clean -xffd && git submodule update --init --recursive && popd
- name: Upload config.log After Error - name: Upload config.log After Error
if: ${{ failure() }} if: ${{ failure() }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: bcl-${{ matrix.product }}-config.log name: bcl-${{ matrix.product }}-config.log
path: ~/mono-configs/bcl/config.log path: ~/mono-configs/bcl/config.log
@@ -733,7 +769,7 @@ jobs:
if: success() && github.event_name == 'create' && startsWith(github.ref, 'refs/heads/release/') if: success() && github.event_name == 'create' && startsWith(github.ref, 'refs/heads/release/')
needs: [linux, windows, osx, ios, ios-cross, android, wasm, bcl] needs: [linux, windows, osx, ios, ios-cross, android, wasm, bcl]
name: Create Release name: Create Release
runs-on: ubuntu-18.04 runs-on: ubuntu-22.04
outputs: outputs:
release_upload_url: ${{ steps.create_release.outputs.upload_url }} release_upload_url: ${{ steps.create_release.outputs.upload_url }}
steps: steps:
@@ -760,7 +796,7 @@ jobs:
if: success() && github.event_name == 'create' && startsWith(github.ref, 'refs/heads/release/') if: success() && github.event_name == 'create' && startsWith(github.ref, 'refs/heads/release/')
needs: create-release needs: create-release
name: Upload Release Artifacts name: Upload Release Artifacts
runs-on: ubuntu-18.04 runs-on: ubuntu-22.04
strategy: strategy:
matrix: matrix:
artifact_name: [linux-x86, linux-x86_64, windows-x86, windows-x86_64, osx-arm64, osx-x86_64, artifact_name: [linux-x86, linux-x86_64, windows-x86, windows-x86_64, osx-arm64, osx-x86_64,
@@ -770,7 +806,7 @@ jobs:
bcl-desktop, bcl-desktop-win32, bcl-android, bcl-ios, bcl-wasm] bcl-desktop, bcl-desktop-win32, bcl-android, bcl-ios, bcl-wasm]
steps: steps:
- name: Download Artifact - name: Download Artifact
uses: actions/download-artifact@v3 uses: actions/download-artifact@v5
with: with:
name: ${{ matrix.artifact_name }} name: ${{ matrix.artifact_name }}
path: ./ path: ./

View File

@@ -3,10 +3,10 @@ on: [push, pull_request]
jobs: jobs:
build: build:
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v5
- name: Lint repo - name: Lint repo
run: | run: |

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. 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. 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.182. - Mono: 6.12.0.206.
- Emscripten: 1.39.9. - Emscripten: 1.39.9.
- Android NDK: 23.2.8568313 - Android NDK: 23.2.8568313

6
bcl.py
View File

@@ -195,16 +195,16 @@ def make_product(opts: BclOpts, product: str):
mkdir_p(monotouch_profile_dir) mkdir_p(monotouch_profile_dir)
android_env_csc_args = [ ios_env_csc_args = [
path_join(this_script_dir, 'files', 'xi.cs'), path_join(this_script_dir, 'files', 'xi.cs'),
'-keyfile:' + path_join(this_script_dir, 'files', 'xi.snk'), '-keyfile:' + path_join(this_script_dir, 'files', 'xi.snk'),
'-out:%s' % path_join(monotouch_profile_dir, 'Xamarin.iOS.dll'), '-out:%s' % path_join(monotouch_profile_dir, 'Xamarin.iOS.dll'),
'-optimize', '-deterministic', '-publicsign', '-target:library', '-optimize', '-deterministic', '-publicsign', '-target:library',
'-nostdlib', '-noconfig', '-langversion:latest' '-nostdlib', '-noconfig', '-langversion:latest'
] ]
android_env_csc_args += ['-r:%s' % path_join(monotouch_profile_dir, r) for r in refs] ios_env_csc_args += ['-r:%s' % path_join(monotouch_profile_dir, r) for r in refs]
run_command('csc', android_env_csc_args) run_command('csc', ios_env_csc_args)
def clean_product(opts: BclOpts, product: str): def clean_product(opts: BclOpts, product: str):

View File

@@ -3,11 +3,11 @@ index e57a636ef4d..60c60a8fc17 100644
--- a/mcs/build/rules.make --- a/mcs/build/rules.make
+++ b/mcs/build/rules.make +++ b/mcs/build/rules.make
@@ -94,7 +94,7 @@ include $(topdir)/build/config-default.make @@ -94,7 +94,7 @@ include $(topdir)/build/config-default.make
include $(topdir)/build/platforms/$(BUILD_PLATFORM).make include $(topdir)/build/platforms/$(BUILD_PLATFORM).make
-PROFILE_PLATFORM = $(if $(PLATFORMS),$(if $(filter $(PLATFORMS),$(HOST_PLATFORM)),$(HOST_PLATFORM),$(error Unknown platform "$(HOST_PLATFORM)" for profile "$(PROFILE)"))) -PROFILE_PLATFORM = $(if $(PLATFORMS),$(if $(filter $(PLATFORMS),$(HOST_PLATFORM)),$(HOST_PLATFORM),$(error Unknown platform "$(HOST_PLATFORM)" for profile "$(PROFILE)")))
+PROFILE_PLATFORM ?= $(if $(PLATFORMS),$(if $(filter $(PLATFORMS),$(HOST_PLATFORM)),$(HOST_PLATFORM),$(error Unknown platform "$(HOST_PLATFORM)" for profile "$(PROFILE)"))) +PROFILE_PLATFORM ?= $(if $(PLATFORMS),$(if $(filter $(PLATFORMS),$(HOST_PLATFORM)),$(HOST_PLATFORM),$(error Unknown platform "$(HOST_PLATFORM)" for profile "$(PROFILE)")))
PROFILE_DIRECTORY = $(PROFILE)$(if $(PROFILE_PLATFORM),-$(PROFILE_PLATFORM)) PROFILE_DIRECTORY = $(PROFILE)$(if $(PROFILE_PLATFORM),-$(PROFILE_PLATFORM))
# Useful # Useful

View File

@@ -1,8 +1,8 @@
diff --git a/configure.ac b/configure.ac diff --git a/configure.ac b/configure.ac
index 088128e5e74..54693aace64 100644 index 19b20127ca2..d07afde5e05 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -5918,6 +5918,8 @@ if test "x$enable_btls" = "xyes"; then @@ -5924,6 +5924,8 @@ if test "x$enable_btls" = "xyes"; then
if test "x$HAVE_YASM" != "xyes"; then if test "x$HAVE_YASM" != "xyes"; then
BTLS_CMAKE_ARGS="-DOPENSSL_NO_ASM=1" BTLS_CMAKE_ARGS="-DOPENSSL_NO_ASM=1"
fi fi
@@ -11,7 +11,7 @@ index 088128e5e74..54693aace64 100644
;; ;;
esac esac
;; ;;
@@ -5929,6 +5931,8 @@ if test "x$enable_btls" = "xyes"; then @@ -5935,6 +5937,8 @@ if test "x$enable_btls" = "xyes"; then
if test "x$HAVE_YASM" != "xyes"; then if test "x$HAVE_YASM" != "xyes"; then
BTLS_CMAKE_ARGS="-DOPENSSL_NO_ASM=1" BTLS_CMAKE_ARGS="-DOPENSSL_NO_ASM=1"
fi fi

View File

@@ -0,0 +1,59 @@
diff --git a/configure.ac b/configure.ac
index d07afde5e05..2c052530f2c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4927,9 +4927,6 @@ if test "x$target_mach" = "xyes"; then
CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_OSX"
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_OSX"
target_osx=yes
- if test "x$TARGET" = "xARM64"; then
- BTLS_SUPPORTED=no
- fi
], [
AC_DEFINE(TARGET_IOS,1,[The JIT/AOT targets iOS])
CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_IOS"
@@ -5952,7 +5949,11 @@ if test "x$enable_btls" = "xyes"; then
;;
aarch64)
btls_arch=aarch64
- btls_cflags="-march=armv8-a+crypto"
+ if test "x$target_mach" = "xyes"; then
+ btls_cflags="-arch arm64"
+ else
+ btls_cflags="-march=armv8-a+crypto"
+ fi
;;
s390x)
btls_arch=s390x
diff --git a/mono/btls/CMakeLists.txt b/mono/btls/CMakeLists.txt
index 9946f5d21a4..a8aa3d07b0e 100644
--- a/mono/btls/CMakeLists.txt
+++ b/mono/btls/CMakeLists.txt
@@ -21,6 +21,15 @@ if (MSVC OR CYGWIN)
set(BTLS_HOST_WIN32 1)
endif ()
+if (NOT "${BTLS_ARCH}" STREQUAL "")
+ message (STATUS "SET ARCH: ${BTLS_ARCH}")
+ set (CMAKE_SYSTEM_PROCESSOR "${BTLS_ARCH}")
+endif ()
+
+if ((("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64") OR ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64")) AND APPLE AND NOT IOS)
+ set(OPENSSL_NO_ASM 1)
+endif ()
+
if (NOT OPENSSL_NO_ASM)
if (BTLS_HOST_WIN32)
if (CYGWIN AND "${BTLS_ARCH}" STREQUAL "i386")
@@ -38,11 +47,6 @@ if (NOT OPENSSL_NO_ASM)
endif ()
endif ()
-if (NOT "${BTLS_ARCH}" STREQUAL "")
- message (STATUS "SET ARCH: ${BTLS_ARCH}")
- set (CMAKE_SYSTEM_PROCESSOR "${BTLS_ARCH}")
-endif ()
-
if (NOT MSVC)
if(${CMAKE_SYSTEM_NAME} MATCHES "AIX" OR ${CMAKE_SYSTEM_NAME} MATCHES "OS400")
# GCC+XCOFF doesn't support -fvisibility=hidden, and we would prefer XCOFF debugging info.

View File

@@ -1,8 +1,8 @@
diff --git a/mono/metadata/threads.c b/mono/metadata/threads.c diff --git a/mono/metadata/threads.c b/mono/metadata/threads.c
index ad9b8823f8f..3542b32b540 100644 index 8d6753f2e01..1c1bd460123 100644
--- a/mono/metadata/threads.c --- a/mono/metadata/threads.c
+++ b/mono/metadata/threads.c +++ b/mono/metadata/threads.c
@@ -77,8 +77,12 @@ mono_native_thread_join_handle (HANDLE thread_handle, gboolean close_handle); @@ -78,8 +78,12 @@ mono_native_thread_join_handle (HANDLE thread_handle, gboolean close_handle);
#include <zircon/syscalls.h> #include <zircon/syscalls.h>
#endif #endif
@@ -18,10 +18,10 @@ index ad9b8823f8f..3542b32b540 100644
#ifdef HOST_ANDROID #ifdef HOST_ANDROID
diff --git a/mono/utils/mono-threads-posix.c b/mono/utils/mono-threads-posix.c diff --git a/mono/utils/mono-threads-posix.c b/mono/utils/mono-threads-posix.c
index 3e4bf93de5f..79c9f731fe7 100644 index cd32e6b042d..5e2fd4618b8 100644
--- a/mono/utils/mono-threads-posix.c --- a/mono/utils/mono-threads-posix.c
+++ b/mono/utils/mono-threads-posix.c +++ b/mono/utils/mono-threads-posix.c
@@ -31,8 +31,12 @@ @@ -32,8 +32,12 @@
#include <errno.h> #include <errno.h>

View File

@@ -1,16 +1,16 @@
diff --git a/mono/metadata/threadpool-io.c b/mono/metadata/threadpool-io.c diff --git a/mono/metadata/threadpool-io.c b/mono/metadata/threadpool-io.c
index fdfef2de91e28..45ac0d84b2429 100644 index a8a947e7dea..b87b59ed5b6 100644
--- a/mono/metadata/threadpool-io.c --- a/mono/metadata/threadpool-io.c
+++ b/mono/metadata/threadpool-io.c +++ b/mono/metadata/threadpool-io.c
@@ -180,6 +180,7 @@ selector_thread_wakeup_drain_pipes (void) @@ -179,6 +179,7 @@ selector_thread_wakeup_drain_pipes (void)
{ {
gchar buffer [128]; gchar buffer [128];
gint received; gint received;
+ static gint warnings_issued = 0; + static gint warnings_issued = 0;
for (;;) { for (;;) {
#if !defined(HOST_WIN32) #if !defined(HOST_WIN32)
@@ -192,11 +193,16 @@ selector_thread_wakeup_drain_pipes (void) @@ -191,11 +192,16 @@ selector_thread_wakeup_drain_pipes (void)
* some unices (like AIX) send ERESTART, which doesn't * some unices (like AIX) send ERESTART, which doesn't
* exist on some other OSes errno * exist on some other OSes errno
*/ */
@@ -30,7 +30,7 @@ index fdfef2de91e28..45ac0d84b2429 100644
break; break;
} }
#else #else
@@ -204,8 +210,13 @@ selector_thread_wakeup_drain_pipes (void) @@ -203,8 +209,13 @@ selector_thread_wakeup_drain_pipes (void)
if (received == 0) if (received == 0)
break; break;
if (received == SOCKET_ERROR) { if (received == SOCKET_ERROR) {

View File

@@ -0,0 +1,21 @@
diff --git a/external/llvm-project/llvm/lib/Support/regex_impl.h b/external/llvm-project/llvm/lib/Support/regex_impl.h
index f8296c9ff75e..45bdb469a0b3 100644
--- a/external/llvm-project/llvm/lib/Support/regex_impl.h
+++ b/external/llvm-project/llvm/lib/Support/regex_impl.h
@@ -35,8 +35,8 @@
* @(#)regex.h 8.1 (Berkeley) 6/2/93
*/
-#ifndef _REGEX_H_
-#define _REGEX_H_
+#ifndef _REGEX_IMPL_H_
+#define _REGEX_IMPL_H_
#include <sys/types.h>
typedef off_t llvm_regoff_t;
@@ -105,4 +105,4 @@ size_t llvm_strlcpy(char *dst, const char *src, size_t siz);
}
#endif
-#endif /* !_REGEX_H_ */
+#endif /* !_REGEX_IMPL_H_ */

View File

@@ -1,10 +1,10 @@
diff --git a/mono/mini/debugger-agent.c b/mono/mini/debugger-agent.c diff --git a/mono/mini/debugger-agent.c b/mono/mini/debugger-agent.c
index df6329391df..05f30d5b4dc 100644 index 32bfc471ea2..5087405eed5 100644
--- a/mono/mini/debugger-agent.c --- a/mono/mini/debugger-agent.c
+++ b/mono/mini/debugger-agent.c +++ b/mono/mini/debugger-agent.c
@@ -4088,8 +4088,12 @@ thread_startup (MonoProfiler *prof, uintptr_t tid) @@ -4172,8 +4172,12 @@ thread_startup (MonoProfiler *prof, uintptr_t tid)
} }
tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id); tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id);
- g_assert (!tls); - g_assert (!tls);
- // FIXME: Free this somewhere - // FIXME: Free this somewhere

View File

@@ -1,5 +1,5 @@
diff --git a/mono/utils/mono-log-darwin.c b/mono/utils/mono-log-darwin.c diff --git a/mono/utils/mono-log-darwin.c b/mono/utils/mono-log-darwin.c
index 3cb127bad59..30ff5edc307 100644 index 2cb41b1481e..4f566ddb90a 100644
--- a/mono/utils/mono-log-darwin.c --- a/mono/utils/mono-log-darwin.c
+++ b/mono/utils/mono-log-darwin.c +++ b/mono/utils/mono-log-darwin.c
@@ -5,7 +5,8 @@ @@ -5,7 +5,8 @@

View File

@@ -0,0 +1,32 @@
Extracted from https://github.com/dotnet/runtime/commit/087651ee0c2e315f7fe1cbecab5f507af364ab5c
--
diff --git a/mono/tools/offsets-tool/offsets-tool.py b/mono/tools/offsets-tool/offsets-tool.py
index adf7eb4b..46214429 100644
--- a/mono/tools/offsets-tool/offsets-tool.py
+++ b/mono/tools/offsets-tool/offsets-tool.py
@@ -303,8 +303,11 @@ class OffsetsTool:
if type.size == -1:
continue
f.write ("DECL_SIZE2(%s,%s)\n" % (type.name, type.size))
+ done_fields = {}
for field in type.fields:
- f.write ("DECL_OFFSET2(%s,%s,%s)\n" % (type.name, field.name, field.offset))
+ if field.name not in done_fields:
+ f.write ("DECL_OFFSET2(%s,%s,%s)\n" % (type.name, field.name, field.offset))
+ done_fields [field.name] = field.name
f.write ("#endif //disable metadata check\n")
f.write ("#ifndef DISABLE_JIT_OFFSETS\n")
@@ -314,8 +317,11 @@ class OffsetsTool:
if type.size == -1:
continue
f.write ("DECL_SIZE2(%s,%s)\n" % (type.name, type.size))
+ done_fields = {}
for field in type.fields:
- f.write ("DECL_OFFSET2(%s,%s,%s)\n" % (type.name, field.name, field.offset))
+ if field.name not in done_fields:
+ f.write ("DECL_OFFSET2(%s,%s,%s)\n" % (type.name, field.name, field.offset))
+ done_fields [field.name] = field.name
f.write ("#endif //disable jit check\n")
f.write ("#endif //cross compiler checks\n")

View File

@@ -1,5 +1,5 @@
diff --git a/mono/tools/offsets-tool/offsets-tool.py b/mono/tools/offsets-tool/offsets-tool.py diff --git a/mono/tools/offsets-tool/offsets-tool.py b/mono/tools/offsets-tool/offsets-tool.py
index 35445ba585c..d1586ee5ecd 100644 index f06799cba12..adf7eb4bbd6 100644
--- a/mono/tools/offsets-tool/offsets-tool.py --- a/mono/tools/offsets-tool/offsets-tool.py
+++ b/mono/tools/offsets-tool/offsets-tool.py +++ b/mono/tools/offsets-tool/offsets-tool.py
@@ -54,6 +54,7 @@ class OffsetsTool: @@ -54,6 +54,7 @@ class OffsetsTool:

View File

@@ -1,22 +0,0 @@
diff --git a/tools/offsets-tool-py/offsets-tool.py b/tools/offsets-tool-py/offsets-tool.py
index 536206aa5c9..04e515f13f2 100644
--- a/tools/offsets-tool-py/offsets-tool.py
+++ b/tools/offsets-tool-py/offsets-tool.py
@@ -61,6 +61,7 @@ class OffsetsTool:
parser.add_argument ('--targetdir', dest='target_path', help='path to mono tree configured for target', required=True)
parser.add_argument ('--abi=', dest='abi', help='ABI triple to generate', required=True)
parser.add_argument ('--sysroot=', dest='sysroot', help='path to sysroot headers of target')
+ parser.add_argument ('--extra-cflag=', dest='extra_cflags', action='append', help='extra flags for clang')
args = parser.parse_args ()
if not args.libclang or not os.path.isfile (args.libclang):
@@ -78,6 +79,9 @@ class OffsetsTool:
self.target_args = []
android_api_level = "-D__ANDROID_API=21"
+ if args.extra_cflags:
+ self.target_args += args.extra_cflags
+
if "wasm" in args.abi:
require_emscipten_path (args)
self.sys_includes = [args.emscripten_path + "/system/include/libc"]

View File

@@ -0,0 +1,215 @@
From 63e677701d35c7e2dad4fe74a84eb935cd396155 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= <alex.koeplinger@outlook.com>
Date: Mon, 15 May 2023 20:46:12 +0200
Subject: [PATCH] [mono] Update offsets-tool python clang binding so it works
with newer clang (#86256)
They introduced a breaking change to CursorKind.TRANSLATION_UNIT in https://github.com/llvm/llvm-project/commit/bb83f8e70bd1d56152f02307adacd718cd67e312, which means we hit an issue when using the binding against a newer clang. Update the binding to the latest upstream and add a tweak so it still works with older clang versions.
---
mono/tools/offsets-tool/clang/cindex.py | 137 +++++++++++++++++-
1 file changed, 135 insertions(+), 2 deletions(-)
diff --git a/mono/tools/offsets-tool/clang/cindex.py b/mono/tools/offsets-tool/clang/cindex.py
index 44c6f49096f495..0ed1c199ba44dd 100644
--- a/mono/tools/offsets-tool/clang/cindex.py
+++ b/mono/tools/offsets-tool/clang/cindex.py
@@ -286,6 +286,11 @@ def offset(self):
"""Get the file offset represented by this source location."""
return self._get_instantiation()[3]
+ #@property
+ #def is_in_system_header(self):
+ # """Returns true if the given source location is in a system header."""
+ # return conf.lib.clang_Location_isInSystemHeader(self)
+
def __eq__(self, other):
return conf.lib.clang_equalLocations(self, other)
@@ -646,6 +651,11 @@ def name(self):
@classmethod
def from_id(cls, id):
+ if cls == CursorKind and id == 300:
+ # --- DOTNET change ---
+ # The id of CursorKind.TRANSLATION_UNIT changed in https://github.com/llvm/llvm-project/commit/bb83f8e70bd1d56152f02307adacd718cd67e312,
+ # add mapping from the old to the new value so using the binding with an older clang still works.
+ return cls._kinds[350]
if id >= len(cls._kinds) or cls._kinds[id] is None:
raise ValueError('Unknown template argument kind %d' % id)
return cls._kinds[id]
@@ -1152,7 +1162,7 @@ def __repr__(self):
# Objective-C's @synchronized statement.
CursorKind.OBJC_AT_SYNCHRONIZED_STMT = CursorKind(220)
-# Objective-C's autorealease pool statement.
+# Objective-C's autorelease pool statement.
CursorKind.OBJC_AUTORELEASE_POOL_STMT = CursorKind(221)
# Objective-C's for collection statement.
@@ -1312,7 +1322,7 @@ def __repr__(self):
#
# The translation unit cursor exists primarily to act as the root cursor for
# traversing the contents of a translation unit.
-CursorKind.TRANSLATION_UNIT = CursorKind(300)
+CursorKind.TRANSLATION_UNIT = CursorKind(350)
###
# Attributes
@@ -1473,6 +1483,107 @@ def is_default_method(self):
"""
return conf.lib.clang_CXXMethod_isDefaulted(self)
+ #def is_deleted_method(self):
+ # """Returns True if the cursor refers to a C++ member function or member
+ # function template that is declared '= delete'.
+ # """
+ # return conf.lib.clang_CXXMethod_isDeleted(self)
+
+ #def is_copy_assignment_operator_method(self):
+ # """Returnrs True if the cursor refers to a copy-assignment operator.
+
+ # A copy-assignment operator `X::operator=` is a non-static,
+ # non-template member function of _class_ `X` with exactly one
+ # parameter of type `X`, `X&`, `const X&`, `volatile X&` or `const
+ # volatile X&`.
+
+
+ # That is, for example, the `operator=` in:
+
+ # class Foo {
+ # bool operator=(const volatile Foo&);
+ # };
+
+ # Is a copy-assignment operator, while the `operator=` in:
+
+ # class Bar {
+ # bool operator=(const int&);
+ # };
+
+ # Is not.
+ # """
+ # return conf.lib.clang_CXXMethod_isCopyAssignmentOperator(self)
+
+ #def is_move_assignment_operator_method(self):
+ # """Returnrs True if the cursor refers to a move-assignment operator.
+
+ # A move-assignment operator `X::operator=` is a non-static,
+ # non-template member function of _class_ `X` with exactly one
+ # parameter of type `X&&`, `const X&&`, `volatile X&&` or `const
+ # volatile X&&`.
+
+
+ # That is, for example, the `operator=` in:
+
+ # class Foo {
+ # bool operator=(const volatile Foo&&);
+ # };
+
+ # Is a move-assignment operator, while the `operator=` in:
+
+ # class Bar {
+ # bool operator=(const int&&);
+ # };
+
+ # Is not.
+ # """
+ # return conf.lib.clang_CXXMethod_isMoveAssignmentOperator(self)
+
+ #def is_explicit_method(self):
+ # """Determines if a C++ constructor or conversion function is
+ # explicit, returning 1 if such is the case and 0 otherwise.
+
+ # Constructors or conversion functions are declared explicit through
+ # the use of the explicit specifier.
+
+ # For example, the following constructor and conversion function are
+ # not explicit as they lack the explicit specifier:
+
+ # class Foo {
+ # Foo();
+ # operator int();
+ # };
+
+ # While the following constructor and conversion function are
+ # explicit as they are declared with the explicit specifier.
+
+ # class Foo {
+ # explicit Foo();
+ # explicit operator int();
+ # };
+
+ # This method will return 0 when given a cursor pointing to one of
+ # the former declarations and it will return 1 for a cursor pointing
+ # to the latter declarations.
+
+ # The explicit specifier allows the user to specify a
+ # conditional compile-time expression whose value decides
+ # whether the marked element is explicit or not.
+
+ # For example:
+
+ # constexpr bool foo(int i) { return i % 2 == 0; }
+
+ # class Foo {
+ # explicit(foo(1)) Foo();
+ # explicit(foo(2)) operator int();
+ # }
+
+ # This method will return 0 for the constructor and 1 for
+ # the conversion function.
+ # """
+ # return conf.lib.clang_CXXMethod_isExplicit(self)
+
def is_mutable_field(self):
"""Returns True if the cursor refers to a C++ field that is declared
'mutable'.
@@ -2059,6 +2170,7 @@ def __repr__(self):
TypeKind.OBJCSEL = TypeKind(29)
TypeKind.FLOAT128 = TypeKind(30)
TypeKind.HALF = TypeKind(31)
+TypeKind.IBM128 = TypeKind(40)
TypeKind.COMPLEX = TypeKind(100)
TypeKind.POINTER = TypeKind(101)
TypeKind.BLOCKPOINTER = TypeKind(102)
@@ -2122,6 +2234,7 @@ def __repr__(self):
TypeKind.OCLRESERVEID = TypeKind(160)
TypeKind.EXTVECTOR = TypeKind(176)
+TypeKind.ATOMIC = TypeKind(177)
class RefQualifierKind(BaseEnumeration):
"""Describes a specific ref-qualifier of a type."""
@@ -3424,6 +3537,22 @@ def cursor(self):
[Cursor],
bool),
+ #("clang_CXXMethod_isDeleted",
+ # [Cursor],
+ # bool),
+
+ #("clang_CXXMethod_isCopyAssignmentOperator",
+ # [Cursor],
+ # bool),
+
+ #("clang_CXXMethod_isMoveAssignmentOperator",
+ # [Cursor],
+ # bool),
+
+ #("clang_CXXMethod_isExplicit",
+ # [Cursor],
+ # bool),
+
("clang_CXXMethod_isPureVirtual",
[Cursor],
bool),
@@ -4012,6 +4141,10 @@ def cursor(self):
[Cursor],
c_longlong),
+ #("clang_Location_isInSystemHeader",
+ # [SourceLocation],
+ # bool),
+
("clang_Type_getAlignOf",
[Type],
c_longlong),

View File

@@ -32,14 +32,14 @@ def main(raw_args):
'bcl-profile-platform-override.diff', 'bcl-profile-platform-override.diff',
'mono_ios_asl_log_deprecated.diff', 'mono_ios_asl_log_deprecated.diff',
'wasm_m2n_trampolines_hook.diff', 'wasm_m2n_trampolines_hook.diff',
'btls-cmake-args-linux-mingw.diff' 'btls-cmake-args-linux-mingw.diff',
'btls-cmake-arm64.diff',
'llvm-osx-regex-conflict.diff',
'offsets-tool-extra-cflags.diff',
'offsets-tool-newer-clang.diff',
'offsets-tool-duplicate-fields.diff',
] ]
if os.path.isfile(os.path.join(mono_source_root, 'mono/tools/offsets-tool/offsets-tool.py')):
patches += ['offsets-tool-extra-cflags_new.diff']
else:
patches += ['offsets-tool-extra-cflags_old.diff']
from subprocess import Popen from subprocess import Popen
from sys import exit from sys import exit
for patch in patches: for patch in patches: