@@ -49,17 +49,18 @@ jobs:
4949
5050 build :
5151 runs-on : ubuntu-22.04
52+ container :
53+ image : alpine:3.20
5254 strategy :
5355 fail-fast : false
5456 matrix :
5557 rust :
5658 - stable
5759 - beta
5860 - nightly
59- llvm :
60- - 19
61- - source
62- name : rustc=${{ matrix.rust }} llvm=${{ matrix.llvm }}
61+ target :
62+ - x86_64-unknown-linux-musl
63+ name : rustc=${{ matrix.rust }} target=${{ matrix.target }}
6364 needs : llvm
6465
6566 env :
6869 steps :
6970 - uses : actions/checkout@v4
7071
72+ - name : Install dependencies
73+ run : |
74+ set -euxo pipefail
75+ apk update
76+ apk add bash curl libgcc gcc
77+
7178 - name : Install Rust ${{ matrix.rust }}
7279 if : matrix.rust != 'nightly'
7380 uses : dtolnay/rust-toolchain@master
8188 toolchain : ${{ matrix.rust }}
8289 components : rust-src
8390 # TODO: Remove this and run the integration tests on the local machine when they pass on 5.15.
84- targets : aarch64-unknown-linux-musl,x86_64 -unknown-linux-musl
91+ targets : ${{ matrix.target }} -unknown-linux-musl
8592
8693 - uses : Swatinem/rust-cache@v2
8794
@@ -91,59 +98,33 @@ jobs:
9198 - name : Build (default features, no system LLVM)
9299 run : cargo build
93100
94- - name : Install dependencies
95- if : matrix.rust == 'nightly'
96- # ubuntu-22.04 comes with clang 14[0] which doesn't include support for signed and 64bit
97- # enum values which was added in clang 15[1].
98- #
99- # gcc-multilib provides at least <asm/types.h> which is referenced by libbpf.
100- #
101- # llvm provides llvm-objcopy which is used to build the BTF relocation tests.
102- #
103- # [0] https://github.com/actions/runner-images/blob/ubuntu22/20230724.1/images/linux/Ubuntu2204-Readme.md
104- #
105- # [1] https://github.com/llvm/llvm-project/commit/dc1c43d
106- run : |
107- set -euxo pipefail
108- wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
109- echo deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main | sudo tee /etc/apt/sources.list.d/llvm.list
110- sudo apt update
111- sudo apt -y install clang gcc-multilib
112-
113- - name : Install LLVM
114- if : matrix.llvm != 'source'
115- run : |
116- set -euxo pipefail
117- wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
118- echo -e deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${{ matrix.llvm }} main | sudo tee /etc/apt/sources.list.d/llvm.list
119-
120- sudo apt update
121- # TODO(vadorovsky): Remove the requirement of libpolly.
122- #
123- # Packages from apt.llvm.org are being built all at once, with one
124- # cmake build with superset of options, then different binaries and
125- # libraries are being included in different packages.
126- #
127- # That results in `llvm-config --libname --link-static` mentioning
128- # libpolly, even if it's not installed. The output of that command is
129- # being used in build.rs of llvm-sys, so building llvm-sys on such
130- # system is complaining about lack of libpolly.
131- #
132- # Hopefully that nightmare goes away once we switch to binstalls and
133- # ditch the system LLVM option.
134- sudo apt -y install llvm-${{ matrix.llvm }}-dev libpolly-${{ matrix.llvm }}-dev
135- echo /usr/lib/llvm-${{ matrix.llvm }}/bin >> $GITHUB_PATH
101+ # - name: Install dependencies
102+ # if: matrix.rust == 'nightly'
103+ # # ubuntu-22.04 comes with clang 14[0] which doesn't include support for signed and 64bit
104+ # # enum values which was added in clang 15[1].
105+ # #
106+ # # gcc-multilib provides at least <asm/types.h> which is referenced by libbpf.
107+ # #
108+ # # llvm provides llvm-objcopy which is used to build the BTF relocation tests.
109+ # #
110+ # # [0] https://github.com/actions/runner-images/blob/ubuntu22/20230724.1/images/linux/Ubuntu2204-Readme.md
111+ # #
112+ # # [1] https://github.com/llvm/llvm-project/commit/dc1c43d
113+ # run: |
114+ # set -euxo pipefail
115+ # wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
116+ # echo deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main | sudo tee /etc/apt/sources.list.d/llvm.list
117+ # sudo apt update
118+ # sudo apt -y install clang gcc-multilib
136119
137120 - name : Restore LLVM
138- if : matrix.llvm == 'source'
139121 uses : actions/cache/restore@v4
140122 with :
141123 path : llvm-install
142124 key : ${{ needs.llvm.outputs.cache-key }}
143125 fail-on-cache-miss : true
144126
145127 - name : Add LLVM to PATH && LD_LIBRARY_PATH
146- if : matrix.llvm == 'source'
147128 run : |
148129 set -euxo pipefail
149130 echo "${{ github.workspace }}/llvm-install/bin" >> $GITHUB_PATH
@@ -220,3 +201,7 @@ jobs:
220201 set -euxo pipefail
221202 sudo apt install -y locate qemu-system-{arm,x86}
222203 find test/.tmp -name 'vmlinuz-*' | RUSTFLAGS=-Cdebuginfo=line-directives-only xargs -t cargo xtask integration-test vm
204+
205+ - name : Setup tmate session
206+ if : ${{ failure() }}
207+ uses : mxschmitt/action-tmate@v3
0 commit comments