Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify pure-rust-build has limited tools/headers, use stable-slim #1665

Merged
merged 3 commits into from
Nov 10, 2024

Conversation

EliahKagan
Copy link
Member

As suggested in #1664 (review), this checks that packages that are intended to be absent, for the pure-rust-build test's results to be trusted, really are absent. As detailed in 71ba940, it also checks if commands such as g++ are available in the $PATH, in case they are provided in an unexpected way.

With that check in place, we can more easily change what Docker image we use for this job. Of the changes that are useful, I think the safest is to change from bookworm to bookworm-slim. The "slim" images vary in what they omit, but they shouldn't add anything extra, and in any case, the check should catch anything unexpected. See c84c17e. This passed.

A somewhat greater risk, but I think reasonable given the presence of the new steps that checks what's installed, is to use the stable label instead of bookworm, so that when a new stable release comes out, it is automatically used. I did this, with stable-slim. See 2a791c8. This also passed. This is the current state on the feature branch, as I open this PR. However, that commit can be dropped or reverted if specific-release labels are prefered.

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`.
This changes `bookworm` to `bookworm-slim`. Information about the
Debian "slim" images is available in the "Image Variants" section
of the "About" page at https://hub.docker.com/_/debian. Which files
are removed changes over time, but I don't think files not present
in the non-slim image will be added to the slim image. Even if
something like that were to happen, the check in the previous
commit should identify an environment that has become unsuitable
for this job.

Using the smaller image should make the job a bit faster, since
that image should be a bit faster to download.
With the "Verify environment is sufficiently minimal for the test"
step, if a new stable release of Debian has software that makes the
environment too extensive for `pure-rust-build` to produce accurate
results, then that should be discovered.
@EliahKagan EliahKagan changed the title Check minimality of pure-rust-build software and use stable-slim Check that pure-rust-build environment is limited, and use stable-slim Nov 9, 2024
@EliahKagan EliahKagan changed the title Check that pure-rust-build environment is limited, and use stable-slim Check that pure-rust-build software is limited, and use stable-slim Nov 9, 2024
@EliahKagan EliahKagan changed the title Check that pure-rust-build software is limited, and use stable-slim Check that pure-rust-build has limited tools/libs, use stable-slim Nov 9, 2024
@EliahKagan EliahKagan changed the title Check that pure-rust-build has limited tools/libs, use stable-slim Check that pure-rust-build has limited tools/headers, use stable-slim Nov 9, 2024
@EliahKagan EliahKagan changed the title Check that pure-rust-build has limited tools/headers, use stable-slim Verify pure-rust-build has limited tools/headers, use stable-slim Nov 9, 2024
Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's wonderful, thanks!

Indeed it already shows its usefulness as it made the switch to stable-slim possible.

@Byron Byron merged commit ccd6525 into GitoxideLabs:main Nov 10, 2024
17 checks passed
@EliahKagan EliahKagan deleted the run-ci/pure-rust-build-next branch November 10, 2024 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants