File tree 2 files changed +40
-6
lines changed
2 files changed +40
-6
lines changed Original file line number Diff line number Diff line change @@ -110,18 +110,20 @@ jobs:
110
110
runs-on : ${{ matrix.target.runner }}
111
111
container :
112
112
image : ghcr.io/inko-lang/ci:fedora
113
+ env :
114
+ # This is needed because when setting an explicit target, "ring" looks for
115
+ # `aarch64-linux-musl-gcc` instead of using `musl-gcc`.
116
+ CC_aarch64_unknown_linux_musl : musl-gcc
113
117
steps :
114
118
- uses : actions/checkout@v4
115
119
- uses : actions/cache@v4
116
120
with :
117
121
path : ' ${{ env.CARGO_HOME }}'
118
122
key : ${{ matrix.target.name }}-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
119
- - name : Build the runtime
120
- run : cargo build -p rt --target=${{ matrix.target.triple }}
121
- - name : Build the compiler
122
- run : INKO_RT="${PWD}/target/${{ matrix.target.triple }}/debug" cargo build -p inko
123
- - name : Run the tests
124
- run : ' cd std && ../target/${{ matrix.target.triple }}/debug/inko test --opt=${{ matrix.level }} --target=${{ matrix.name }}'
123
+ - name : Build the runtime and compiler
124
+ run : ./ci/linux.sh ${{ matrix.target.name }} ${{ matrix.target.triple }}
125
+ - name : Run tests
126
+ run : ' cd std && ../target/debug/inko test --opt=${{ matrix.level }} --target=${{ matrix.target.name }}'
125
127
126
128
compiler-mac :
127
129
strategy :
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -e
4
+
5
+ INKO_VERSION=" $( cargo pkgid -p inko | cut -d\# -f2 | cut -d: -f2) "
6
+ INKO_TRIPLE=" ${1} "
7
+ RUST_TRIPLE=" ${2} "
8
+ INKO_RUNTIMES=" ${HOME} /.local/share/inko/runtimes/${INKO_VERSION} /${INKO_TRIPLE} "
9
+
10
+ function rustup_lib {
11
+ local home
12
+ local toolchain
13
+ home=" $( rustup show home) "
14
+ toolchain=" $( rustup show active-toolchain | awk ' {print $1}' ) "
15
+
16
+ echo " ${home} /toolchains/${toolchain} /lib/rustlib/${1} /lib/"
17
+ }
18
+
19
+ # As the host is a GNU host, a bit of extra work is needed to get
20
+ # cross-compilation to musl to work.
21
+ if [[ " ${INKO_TRIPLE} " == * -musl ]]
22
+ then
23
+ cargo build -p rt --target=" ${RUST_TRIPLE} "
24
+ mkdir -p " ${INKO_RUNTIMES} "
25
+ cp " ./target/${RUST_TRIPLE} /debug/libinko.a" " ${INKO_RUNTIMES} /libinko.a"
26
+ cp " $( rustup_lib " ${RUST_TRIPLE} " ) /self-contained/libunwind.a" \
27
+ " ${INKO_RUNTIMES} /libunwind.a"
28
+
29
+ INKO_RT=" ${PWD} /target/${RUST_TRIPLE} /debug" cargo build -p inko
30
+ else
31
+ cargo build
32
+ fi
You can’t perform that action at this time.
0 commit comments