From 2ec9868937fae417a2edee43ee5015b368429b29 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Wed, 7 Aug 2024 13:13:20 -0700 Subject: [PATCH 1/7] Run GitHub Actions on macOS M1. --- .github/workflows/main.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 100f3026..22598800 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: ['macos-12', 'windows-2022'] + # Note: macOS 12 runs on x86 hardware, and 14 runs on M1 hardware + os: ['macos-12', 'macos-14', 'windows-2022'] llvm: ['11', '12', '13', '14', '15', '16', '17', '18'] cuda: ['0', '1'] lua: ['luajit', 'moonjit'] @@ -27,6 +28,12 @@ jobs: # macOS: exclude cuda - os: 'macos-12' cuda: '1' + - os: 'macos-14' + cuda: '1' + + # macOS 14: exclude Moonjit (M1 requires LuaJIT) + - os: 'macos-14' + lua: 'moonjit' # Windows: exclude LLVM 12-18 - os: 'windows-2022' From 83c18cb1682a5070b5d9da92464b5df98ca25804 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Wed, 7 Aug 2024 13:22:56 -0700 Subject: [PATCH 2/7] Fetch LLVM for relevant architecture. --- travis.sh | 81 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/travis.sh b/travis.sh index c48b8512..97bd6c71 100755 --- a/travis.sh +++ b/travis.sh @@ -33,54 +33,55 @@ if [[ $(uname) = Linux ]]; then exit 1 elif [[ $(uname) = Darwin ]]; then + arch=$(uname -m) if [[ $LLVM_VERSION = 18 ]]; then - curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-18.1.7/clang+llvm-18.1.7-x86_64-apple-darwin.tar.xz - tar xf clang+llvm-18.1.7-x86_64-apple-darwin.tar.xz - ln -s clang+llvm-18.1.7-x86_64-apple-darwin/bin/llvm-config llvm-config-17 - ln -s clang+llvm-18.1.7-x86_64-apple-darwin/bin/clang clang-17 - export CMAKE_PREFIX_PATH=$PWD/clang+llvm-18.1.7-x86_64-apple-darwin + curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-18.1.7/clang+llvm-18.1.7-${arch}-apple-darwin.tar.xz + tar xf clang+llvm-18.1.7-${arch}-apple-darwin.tar.xz + ln -s clang+llvm-18.1.7-${arch}-apple-darwin/bin/llvm-config llvm-config-17 + ln -s clang+llvm-18.1.7-${arch}-apple-darwin/bin/clang clang-17 + export CMAKE_PREFIX_PATH=$PWD/clang+llvm-18.1.7-${arch}-apple-darwin elif [[ $LLVM_VERSION = 17 ]]; then - curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-17.0.5/clang+llvm-17.0.5-x86_64-apple-darwin.tar.xz - tar xf clang+llvm-17.0.5-x86_64-apple-darwin.tar.xz - ln -s clang+llvm-17.0.5-x86_64-apple-darwin/bin/llvm-config llvm-config-17 - ln -s clang+llvm-17.0.5-x86_64-apple-darwin/bin/clang clang-17 - export CMAKE_PREFIX_PATH=$PWD/clang+llvm-17.0.5-x86_64-apple-darwin + curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-17.0.5/clang+llvm-17.0.5-${arch}-apple-darwin.tar.xz + tar xf clang+llvm-17.0.5-${arch}-apple-darwin.tar.xz + ln -s clang+llvm-17.0.5-${arch}-apple-darwin/bin/llvm-config llvm-config-17 + ln -s clang+llvm-17.0.5-${arch}-apple-darwin/bin/clang clang-17 + export CMAKE_PREFIX_PATH=$PWD/clang+llvm-17.0.5-${arch}-apple-darwin elif [[ $LLVM_VERSION = 16 ]]; then - curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-16.0.3/clang+llvm-16.0.3-x86_64-apple-darwin.tar.xz - tar xf clang+llvm-16.0.3-x86_64-apple-darwin.tar.xz - ln -s clang+llvm-16.0.3-x86_64-apple-darwin/bin/llvm-config llvm-config-16 - ln -s clang+llvm-16.0.3-x86_64-apple-darwin/bin/clang clang-16 - export CMAKE_PREFIX_PATH=$PWD/clang+llvm-16.0.3-x86_64-apple-darwin + curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-16.0.3/clang+llvm-16.0.3-${arch}-apple-darwin.tar.xz + tar xf clang+llvm-16.0.3-${arch}-apple-darwin.tar.xz + ln -s clang+llvm-16.0.3-${arch}-apple-darwin/bin/llvm-config llvm-config-16 + ln -s clang+llvm-16.0.3-${arch}-apple-darwin/bin/clang clang-16 + export CMAKE_PREFIX_PATH=$PWD/clang+llvm-16.0.3-${arch}-apple-darwin elif [[ $LLVM_VERSION = 15 ]]; then - curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-15.0.2/clang+llvm-15.0.2-x86_64-apple-darwin.tar.xz - tar xf clang+llvm-15.0.2-x86_64-apple-darwin.tar.xz - ln -s clang+llvm-15.0.2-x86_64-apple-darwin/bin/llvm-config llvm-config-15 - ln -s clang+llvm-15.0.2-x86_64-apple-darwin/bin/clang clang-15 - export CMAKE_PREFIX_PATH=$PWD/clang+llvm-15.0.2-x86_64-apple-darwin + curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-15.0.2/clang+llvm-15.0.2-${arch}-apple-darwin.tar.xz + tar xf clang+llvm-15.0.2-${arch}-apple-darwin.tar.xz + ln -s clang+llvm-15.0.2-${arch}-apple-darwin/bin/llvm-config llvm-config-15 + ln -s clang+llvm-15.0.2-${arch}-apple-darwin/bin/clang clang-15 + export CMAKE_PREFIX_PATH=$PWD/clang+llvm-15.0.2-${arch}-apple-darwin elif [[ $LLVM_VERSION = 14 ]]; then - curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-14.0.6/clang+llvm-14.0.6-x86_64-apple-darwin.tar.xz - tar xf clang+llvm-14.0.6-x86_64-apple-darwin.tar.xz - ln -s clang+llvm-14.0.6-x86_64-apple-darwin/bin/llvm-config llvm-config-14 - ln -s clang+llvm-14.0.6-x86_64-apple-darwin/bin/clang clang-14 - export CMAKE_PREFIX_PATH=$PWD/clang+llvm-14.0.6-x86_64-apple-darwin + curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-14.0.6/clang+llvm-14.0.6-${arch}-apple-darwin.tar.xz + tar xf clang+llvm-14.0.6-${arch}-apple-darwin.tar.xz + ln -s clang+llvm-14.0.6-${arch}-apple-darwin/bin/llvm-config llvm-config-14 + ln -s clang+llvm-14.0.6-${arch}-apple-darwin/bin/clang clang-14 + export CMAKE_PREFIX_PATH=$PWD/clang+llvm-14.0.6-${arch}-apple-darwin elif [[ $LLVM_VERSION = 13 ]]; then - curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-13.0.1/clang+llvm-13.0.1-x86_64-apple-darwin.tar.xz - tar xf clang+llvm-13.0.1-x86_64-apple-darwin.tar.xz - ln -s clang+llvm-13.0.1-x86_64-apple-darwin/bin/llvm-config llvm-config-13 - ln -s clang+llvm-13.0.1-x86_64-apple-darwin/bin/clang clang-13 - export CMAKE_PREFIX_PATH=$PWD/clang+llvm-13.0.1-x86_64-apple-darwin + curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-13.0.1/clang+llvm-13.0.1-${arch}-apple-darwin.tar.xz + tar xf clang+llvm-13.0.1-${arch}-apple-darwin.tar.xz + ln -s clang+llvm-13.0.1-${arch}-apple-darwin/bin/llvm-config llvm-config-13 + ln -s clang+llvm-13.0.1-${arch}-apple-darwin/bin/clang clang-13 + export CMAKE_PREFIX_PATH=$PWD/clang+llvm-13.0.1-${arch}-apple-darwin elif [[ $LLVM_VERSION = 12 ]]; then - curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-12.0.1/clang+llvm-12.0.1-x86_64-apple-darwin-macos11.tar.xz - tar xf clang+llvm-12.0.1-x86_64-apple-darwin-macos11.tar.xz - ln -s clang+llvm-12.0.1-x86_64-apple-darwin/bin/llvm-config llvm-config-12 - ln -s clang+llvm-12.0.1-x86_64-apple-darwin/bin/clang clang-12 - export CMAKE_PREFIX_PATH=$PWD/clang+llvm-12.0.1-x86_64-apple-darwin + curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-12.0.1/clang+llvm-12.0.1-${arch}-apple-darwin-macos11.tar.xz + tar xf clang+llvm-12.0.1-${arch}-apple-darwin-macos11.tar.xz + ln -s clang+llvm-12.0.1-${arch}-apple-darwin/bin/llvm-config llvm-config-12 + ln -s clang+llvm-12.0.1-${arch}-apple-darwin/bin/clang clang-12 + export CMAKE_PREFIX_PATH=$PWD/clang+llvm-12.0.1-${arch}-apple-darwin elif [[ $LLVM_VERSION = 11 ]]; then - curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-11.1.0/clang+llvm-11.1.0-x86_64-apple-darwin-macos11.tar.xz - tar xf clang+llvm-11.1.0-x86_64-apple-darwin-macos11.tar.xz - ln -s clang+llvm-11.1.0-x86_64-apple-darwin/bin/llvm-config llvm-config-11 - ln -s clang+llvm-11.1.0-x86_64-apple-darwin/bin/clang clang-11 - export CMAKE_PREFIX_PATH=$PWD/clang+llvm-11.1.0-x86_64-apple-darwin + curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-11.1.0/clang+llvm-11.1.0-${arch}-apple-darwin-macos11.tar.xz + tar xf clang+llvm-11.1.0-${arch}-apple-darwin-macos11.tar.xz + ln -s clang+llvm-11.1.0-${arch}-apple-darwin/bin/llvm-config llvm-config-11 + ln -s clang+llvm-11.1.0-${arch}-apple-darwin/bin/clang clang-11 + export CMAKE_PREFIX_PATH=$PWD/clang+llvm-11.1.0-${arch}-apple-darwin else echo "Don't know this LLVM version: $LLVM_VERSION" exit 1 From 00d4178c66b21b5f918e6894370463812fc10301 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Wed, 7 Aug 2024 14:37:05 -0700 Subject: [PATCH 3/7] Update arch configurations. --- travis.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/travis.sh b/travis.sh index 97bd6c71..6b163026 100755 --- a/travis.sh +++ b/travis.sh @@ -28,12 +28,12 @@ if [[ -n $DOCKER_DISTRO ]]; then exit 0 fi +arch=$(uname -m | sed -e s/arm64/aarch64/) if [[ $(uname) = Linux ]]; then echo "Use Docker for testing build on Linux" exit 1 elif [[ $(uname) = Darwin ]]; then - arch=$(uname -m) if [[ $LLVM_VERSION = 18 ]]; then curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-18.1.7/clang+llvm-18.1.7-${arch}-apple-darwin.tar.xz tar xf clang+llvm-18.1.7-${arch}-apple-darwin.tar.xz @@ -96,13 +96,13 @@ elif [[ $(uname) = Darwin ]]; then elif [[ $(uname) = MINGW* ]]; then if [[ $LLVM_VERSION = 14 ]]; then - curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-14.0.0/clang+llvm-14.0.0-x86_64-windows-msvc17.7z - 7z x -y clang+llvm-14.0.0-x86_64-windows-msvc17.7z - export CMAKE_PREFIX_PATH=$PWD/clang+llvm-14.0.0-x86_64-windows-msvc17 + curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-14.0.0/clang+llvm-14.0.0-${arch}-windows-msvc17.7z + 7z x -y clang+llvm-14.0.0-${arch}-windows-msvc17.7z + export CMAKE_PREFIX_PATH=$PWD/clang+llvm-14.0.0-${arch}-windows-msvc17 elif [[ $LLVM_VERSION = 11 ]]; then - curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-11.1.0/clang+llvm-11.1.0-x86_64-windows-msvc17.7z - 7z x -y clang+llvm-11.1.0-x86_64-windows-msvc17.7z - export CMAKE_PREFIX_PATH=$PWD/clang+llvm-11.1.0-x86_64-windows-msvc17 + curl -L -O https://github.com/terralang/llvm-build/releases/download/llvm-11.1.0/clang+llvm-11.1.0-${arch}-windows-msvc17.7z + 7z x -y clang+llvm-11.1.0-${arch}-windows-msvc17.7z + export CMAKE_PREFIX_PATH=$PWD/clang+llvm-11.1.0-${arch}-windows-msvc17 fi if [[ $USE_CUDA -eq 1 ]]; then From d82307c83e08f97396317f7e464e479a1b115951 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Wed, 7 Aug 2024 14:38:03 -0700 Subject: [PATCH 4/7] Build LLVM 18 specifically. --- .github/workflows/main.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 22598800..c1016aa2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,6 +35,22 @@ jobs: - os: 'macos-14' lua: 'moonjit' + # macOS 14: exclude LLVM 11-17 + - os: 'macos-14' + llvm: '11' + - os: 'macos-14' + llvm: '12' + - os: 'macos-14' + llvm: '13' + - os: 'macos-14' + llvm: '14' + - os: 'macos-14' + llvm: '15' + - os: 'macos-14' + llvm: '16' + - os: 'macos-14' + llvm: '17' + # Windows: exclude LLVM 12-18 - os: 'windows-2022' llvm: '12' From 7402b82921a3a9cf9ce6300b1411cd2877cb26dd Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Wed, 7 Aug 2024 14:42:01 -0700 Subject: [PATCH 5/7] Fix release name. --- travis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis.sh b/travis.sh index 6b163026..cf31bad6 100755 --- a/travis.sh +++ b/travis.sh @@ -180,7 +180,7 @@ fi # Only deploy builds with LLVM 13 (macOS) and 11 (Windows). if [[ (( $(uname) == Darwin && $LLVM_VERSION = 18 ) || ( $(uname) == MINGW* && $LLVM_VERSION = 11 && $USE_CUDA -eq 1 )) && $SLIB_INCLUDE_LLVM -eq 1 && $TERRA_LUA = luajit ]]; then - RELEASE_NAME=terra-`uname | sed -e s/Darwin/OSX/ | sed -e s/MINGW.*/Windows/`-`uname -m`-`git rev-parse --short HEAD` + RELEASE_NAME=terra-`uname | sed -e s/Darwin/OSX/ | sed -e s/MINGW.*/Windows/`-${arch}-`git rev-parse --short HEAD` mv install $RELEASE_NAME if [[ $(uname) = MINGW* ]]; then 7z a -t7z $RELEASE_NAME.7z $RELEASE_NAME From 2c2c3486af74d543df99af7607f108befd506be3 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Wed, 7 Aug 2024 15:23:56 -0700 Subject: [PATCH 6/7] Enable macOS M1 test for LLVM 16. --- .github/workflows/main.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c1016aa2..a764022d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,7 @@ jobs: - os: 'macos-14' lua: 'moonjit' - # macOS 14: exclude LLVM 11-17 + # macOS 14: exclude LLVM 11-15,17 - os: 'macos-14' llvm: '11' - os: 'macos-14' @@ -46,8 +46,6 @@ jobs: llvm: '14' - os: 'macos-14' llvm: '15' - - os: 'macos-14' - llvm: '16' - os: 'macos-14' llvm: '17' From edf7b11d866d95bc33bbba0d6c7172fd60f83620 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Wed, 7 Aug 2024 22:24:49 -0700 Subject: [PATCH 7/7] Enable test for LLVM 17. --- .github/workflows/main.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a764022d..46701967 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,7 @@ jobs: - os: 'macos-14' lua: 'moonjit' - # macOS 14: exclude LLVM 11-15,17 + # macOS 14: exclude LLVM 11-15 - os: 'macos-14' llvm: '11' - os: 'macos-14' @@ -46,8 +46,6 @@ jobs: llvm: '14' - os: 'macos-14' llvm: '15' - - os: 'macos-14' - llvm: '17' # Windows: exclude LLVM 12-18 - os: 'windows-2022'