fix(ci): Install the system requirements of the packages being checked - #2853
Merged
Conversation
Libra fails both halves of its check with
```
LBLasso.c:8:10: fatal error: gsl/gsl_vector.h: No such file or directory
```
and the report records it as a package that fails to install.
It is not: nothing ever installed `libgsl-dev` on the runner.
`install_closure()` returns each revdep's *dependencies*,
never the revdep itself,
so the package under test is never in the shard's library.
`R CMD check` builds it from its tarball,
and neither of the two things that resolve system requirements sees it:
`PKG_SYSREQS` covers what pak installs,
and `sysreqs_fix_installed()` covers what is on disk.
Libra declares `SystemRequirements: gsl`
and `pak::pkg_sysreqs("Libra")` resolves it without difficulty --
nobody asked.
So the shard asks, for its own members,
after the installs and before the first check.
Only what is missing is installed:
`sysreqs_list_system_packages()` says what is already there,
including what other packages *provide*,
since a virtual package satisfies a dependency as a real one does.
A shard whose requirements the image already carries runs no apt at all.
apt directly rather than through pak,
because `sysreqs_fix_installed()` reads the library
and these packages are not in it.
A failure is reported and not fatal:
the check will fail either way,
and it will say why more clearly than this can.
Verified on a runner without gsl:
```
Test: 1 of 1 system requirement(s) of the packages to check are missing: libgsl0-dev
...
Test: installed 1 system package(s) for the packages to check
```
and a second call is a no-op --
`all 1 system requirement(s) of the 1 package(s) to check are present`.
A package with no unmet requirements installs nothing;
an empty member list returns without resolving anything.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D1xpHRV7yVfgtJg4vp9P7z
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Libra fails both halves of its check with
and the report records it under "failed to check — installation failed". It is not a Libra problem: nothing ever installed
libgsl-devon the runner.Why nothing did
install_closure()returns each revdep's dependencies, never the revdep itself, so the package under test is never in the shard's library.R CMD checkbuilds it from its tarball. Neither of the two things that resolve system requirements can see it:PKG_SYSREQScovers what pak installs — and pak never installs Libra.sysreqs_fix_installed(library =)covers what is on disk — and Libra is not.Libra declares
SystemRequirements: gsl, andpak::pkg_sysreqs("Libra")resolves it tolibgsl0-devwithout difficulty. Nobody asked.The change
ensure_check_sysreqs(members), called from the shard after the installs and before the first check, alongside the existing library survey.Only what is missing gets installed.
sysreqs_list_system_packages()says what is already there, including what other packages provide — a virtual package satisfies a dependency as a real one does — so a shard whose requirements the image already carries runs no apt at all.apt directly rather than through pak, because
sysreqs_fix_installed()reads the library and these packages are not in it. A failure is reported and not fatal: the check will fail either way, and it will say why more clearly than this can.Verified on a runner without gsl
A second call is a no-op —
all 1 system requirement(s) of the 1 package(s) to check are present. A package with no unmet requirements installs nothing. An empty member list returns without resolving anything.Note apt resolved
libgsl0-devtolibgsl-dev; the mapping pak returns and the package apt installs need not be the same name, which is why the check issetdiffagainst installed-plus-provided rather than an equality test.🤖 Generated with Claude Code
https://claude.ai/code/session_01D1xpHRV7yVfgtJg4vp9P7z
Generated by Claude Code