Skip to content

Commit

Permalink
Check that pure-rust-build software is minimal
Browse files Browse the repository at this point in the history
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 (GitoxideLabs#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 GitoxideLabs#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`.
  • Loading branch information
EliahKagan committed Nov 9, 2024
1 parent 1df68e4 commit 71ba940
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,24 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Prerequisites
run: apt-get update && apt-get install --no-install-recommends -y ca-certificates curl gcc libc-dev # gcc is required as OS abstraction
- name: install Rust via Rustup
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal;
run: |
apt-get update
apt-get install --no-install-recommends -y ca-certificates curl gcc libc-dev # gcc is required as OS abstraction
- name: Verify environment is sufficiently minimal for the test
run: |
set -x
for pattern in cmake g++ libssl-dev make pkgconf pkg-config; do
if dpkg-query --status -- "$pattern"; then
exit 1
fi
done
for cmd in cmake g++ make pkgconf pkg-config; do
if command -v -- "$cmd"; then
exit 1
fi
done
- name: Install Rust via Rustup
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
- uses: Swatinem/rust-cache@v2
- run: /github/home/.cargo/bin/cargo install --debug --locked --no-default-features --features max-pure --path .

Expand Down

0 comments on commit 71ba940

Please sign in to comment.