Skip to content

Commit 71ba940

Browse files
committed
Check that pure-rust-build software is minimal
This verifies the absence of utilities and libraries `max-pure` should not need, but that are needed for building `max`. When `pure-rust-build` was introduced in ed4deac (#624), the goal was to test that a C toolchain was not needed. Currently, we are installing a C toolchain, by installing `gcc` and `libc-dev`, so that the Rust toolchain will use the linker, which it may invoke through `cc`/`gcc`. Nonetheless, the test is effective, as verified in #1664, becuase it uses an environment free of several packages that `max-pure` would likely inadverently require for building, if it failed to be "pure". Utilities could, in principle, be installed as part of a package other than the package(s) that usually provide them. So a `$PATH` search is performed. However, `libssl-dev` is a library (and more libraries might be listed in the future), with no executable tool to do a `$PATH` search for. Furthermore, it may be possible for a utility to be installed, such that software in a Rust toolchain might find and use it, while not being in a `$PATH` directory. So this checks for known DEB packages as well as searching `$PATH`.
1 parent 1df68e4 commit 71ba940

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,24 @@ jobs:
2424
steps:
2525
- uses: actions/checkout@v4
2626
- name: Prerequisites
27-
run: apt-get update && apt-get install --no-install-recommends -y ca-certificates curl gcc libc-dev # gcc is required as OS abstraction
28-
- name: install Rust via Rustup
29-
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal;
27+
run: |
28+
apt-get update
29+
apt-get install --no-install-recommends -y ca-certificates curl gcc libc-dev # gcc is required as OS abstraction
30+
- name: Verify environment is sufficiently minimal for the test
31+
run: |
32+
set -x
33+
for pattern in cmake g++ libssl-dev make pkgconf pkg-config; do
34+
if dpkg-query --status -- "$pattern"; then
35+
exit 1
36+
fi
37+
done
38+
for cmd in cmake g++ make pkgconf pkg-config; do
39+
if command -v -- "$cmd"; then
40+
exit 1
41+
fi
42+
done
43+
- name: Install Rust via Rustup
44+
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
3045
- uses: Swatinem/rust-cache@v2
3146
- run: /github/home/.cargo/bin/cargo install --debug --locked --no-default-features --features max-pure --path .
3247

0 commit comments

Comments
 (0)