Skip to content

Commit a58ebb7

Browse files
committed
ci: update GHA rust bindings test
1 parent 958b49f commit a58ebb7

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/rust-libc.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,24 @@ jobs:
1414
apt-get install -y meson ninja-build \
1515
python3-setuptools python3-jsonschema \
1616
python3-pexpect python3-pip python3-clang \
17-
netbase clang lld rustfmt git rsync
17+
netbase clang lld git rsync nodejs rustup
1818
pip install --break-system-packages -U xbstrap pyexpect
1919
- name: Prepare directories
2020
run: |
2121
mkdir src/
2222
mkdir src/mlibc/
23+
mkdir src/rust-libc/
2324
mkdir build/
2425
- name: Checkout
2526
uses: actions/checkout@v2
2627
with:
2728
path: src/mlibc/
29+
- name: Checkout rust-libc
30+
uses: actions/checkout@v4
31+
with:
32+
repository: 'rust-lang/libc'
33+
ref: '0.2.175'
34+
path: src/rust-libc
2835
- name: Prepare src/
2936
run: |
3037
cp mlibc/ci/bootstrap.yml .
@@ -42,8 +49,16 @@ jobs:
4249
- name: Build mlibc
4350
run: 'xbstrap install mlibc-headers-only'
4451
working-directory: build/
52+
- name: Expand rust-libc sources
53+
run: |
54+
rustup toolchain install stable
55+
cargo install cargo-expand
56+
~/.cargo/bin/cargo-expand expand unix > ../../build/libc-ignore.rs
57+
cd ../mlibc/scripts/libc-parser
58+
cargo run ../../../../build/libc-ignore.rs > ../../../../build/libc-ignore.yml
59+
working-directory: src/rust-libc/
4560
- name: Run generator
4661
run: |
47-
python3 ./scripts/rust-libc.py ../../build/packages/mlibc-headers-only/usr/include gcc | rustfmt
62+
python3 ./scripts/rust-libc.py ../../build/packages/mlibc-headers-only/usr/include gcc -c ./scripts/rust-libc-config.yml ../../build/libc-ignore.yml | rustfmt
4863
working-directory: src/mlibc/
4964

0 commit comments

Comments
 (0)