Skip to content

Commit 45a23c0

Browse files
committed
Merge branch 'topic/gh_mac_os_m1' into 'master'
Build binaries for Mac OS M1 on GitHub Action See merge request eng/ide/ada_language_server!1456
2 parents 6f4fd55 + 48ebae1 commit 45a23c0

File tree

4 files changed

+30
-14
lines changed

4 files changed

+30
-14
lines changed

.github/workflows/build-binaries.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ NO_REBASE=$4 # Specify this to skip the rebase over the edge branch. Used for lo
1010
CROSS=$5 # '' for native, aarch64 for ARM cross
1111

1212
prefix=/tmp/ADALIB_DIR
13-
TARGET=${CROSS:+$CROSS-linux} # '' or aarch64-linux
13+
if [ $RUNNER_OS = Linux ] ; then
14+
TARGET=${CROSS:+$CROSS-linux} # '' or aarch64-linux
15+
else
16+
TARGET=${CROSS:+$CROSS-darwin} # '' or aarch64-darwin
17+
fi
18+
1419
TARGET_OPTION=${TARGET:+--target=$TARGET} # '' or --target=aarch64-linux
1520

1621
export CPATH=/usr/local/include
@@ -114,7 +119,7 @@ function fix_rpath ()
114119

115120
ALS_EXEC_DIR=integration/vscode/ada/$NODE_ARCH/$NODE_PLATFORM
116121

117-
if [ $RUNNER_OS = macOS ]; then
122+
if [ $RUNNER_OS = macOS -a -z "$CROSS" ]; then
118123
cp -v -f /usr/local/opt/gmp/lib/libgmp.10.dylib $ALS_EXEC_DIR
119124
fix_rpath $ALS_EXEC_DIR/ada_language_server
120125
fi

.github/workflows/build-binaries.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ jobs:
2020
exclude:
2121
- os: windows-latest
2222
cross: aarch64
23-
- os: macos-11
24-
cross: aarch64
2523
runs-on: ${{ matrix.os }}
2624
steps:
2725
- name: Setup Python
@@ -37,18 +35,29 @@ jobs:
3735
else
3836
echo "TAG=$DEFAULT_TAG" >> $GITHUB_ENV
3937
fi
40-
- name: Unpack cross toolchain from AWS S3
41-
if: ${{ matrix.cross != '' }}
38+
- name: Install cross toolchain (Linux)
39+
if: ${{ matrix.cross != '' && runner.os == 'Linux' }}
4240
env:
4341
AWS_ACCESS_KEY_ID: ${{secrets.GHA_CACHE_ACCESS_KEY_ID}}
4442
AWS_SECRET_ACCESS_KEY: ${{secrets.GHA_CACHE_SECRET}}
4543
AWS_DEFAULT_REGION: eu-west-1
4644
run: |
47-
aws s3 cp s3://adacore-gha-tray-eu-west-1/libadalang/${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 . --sse=AES256
48-
aws s3 cp s3://adacore-gha-tray-eu-west-1/libadalang/${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 . --sse=AES256
4945
sudo apt install -y libc6-dev-arm64-cross linux-libc-dev-arm64-cross binutils-aarch64-linux-gnu
50-
sudo tar xavf ${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 -C /
51-
sudo tar xavf ${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 -C /
46+
aws s3 cp s3://adacore-gha-tray-eu-west-1/toolchain/${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 . --sse=AES256
47+
aws s3 cp s3://adacore-gha-tray-eu-west-1/toolchain/${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 . --sse=AES256
48+
sudo tar xjf ${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 -C /
49+
sudo tar xjf ${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 -C /
50+
- name: Install cross toolchain (MacOS)
51+
if: ${{ matrix.cross != '' && runner.os != 'Linux' }}
52+
env:
53+
AWS_ACCESS_KEY_ID: ${{secrets.GHA_CACHE_ACCESS_KEY_ID}}
54+
AWS_SECRET_ACCESS_KEY: ${{secrets.GHA_CACHE_SECRET}}
55+
AWS_DEFAULT_REGION: eu-west-1
56+
run: |
57+
aws s3 cp s3://adacore-gha-tray-eu-west-1/toolchain/${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 . --sse=AES256
58+
aws s3 cp s3://adacore-gha-tray-eu-west-1/toolchain/${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 . --sse=AES256
59+
sudo tar xjf ${{ matrix.cross }}-${{ runner.os }}-gcc-13.2.tar.bz2 --strip-components=3 -C /usr/local
60+
sudo tar xjf ${{ matrix.cross }}-${{ runner.os }}-gmp-6.2.1.tar.bz2 --strip-components=3 -C /usr/local
5261
- name: Force Alire use preinstalled MSYS2
5362
shell: bash
5463
if: ${{ runner.os == 'Windows' }}

.github/workflows/pack-binaries.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ function make_change_log()
1717
done
1818
}
1919

20-
chmod -R -v +x als-*-$DEBUG als-Linux-${DEBUG}aarch64
20+
chmod -R -v +x als-*-$DEBUG als-{Linux,macOS}-${DEBUG}aarch64
2121

2222
for X in Linux macOS Windows ; do
2323
rsync -rva als-$X-$DEBUG/ integration/vscode/ada/
2424
done
2525

26-
rsync -rva als-Linux-${DEBUG}aarch64/ integration/vscode/ada/
26+
rsync -rva als-{Linux,macOS}-${DEBUG}aarch64/ integration/vscode/ada/
2727

2828
# VS Code is supported on arm, arm64 and x64 so we only consider those
2929
# architectures

.github/workflows/release.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ echo "upload_url=$upload_url"
3838

3939
chmod -R -v +x als-*-$DEBUG
4040

41+
for CROSS in "" "aarch64" ; do
4142
for X in Linux macOS Windows ; do
42-
FILE=als-$TAG-$X${DEBUG:+-debug}_amd64.zip
43-
cd als-$X-$DEBUG
43+
FILE=als-$TAG-$X${DEBUG:+-debug}_${CROSS:-amd64}.zip
44+
cd als-$X-$DEBUG$CROSS
4445
zip -9 -r ../$FILE .
4546
cd ..
4647

@@ -54,3 +55,4 @@ for X in Linux macOS Windows ; do
5455
$upload_url?name=$FILE
5556
rm -v -f $FILE
5657
done
58+
done

0 commit comments

Comments
 (0)