Repository navigation
fix(arc): keep the sysroot's pkg-config files visible after actions/setup-python - #70
Merged
Merged
Conversation
…etup-python actions/setup-python exports PKG_CONFIG_PATH as its own directory alone, replacing the sysroot's entry the job-started hook put there, so a later step could no longer find the sysroot's .pc files. The hook now also sets PKG_CONFIG_LIBDIR to the sysroot's directory followed by pkg-config's default search path. Nothing rewrites that variable, and pkg-config searches it after PKG_CONFIG_PATH, so the sysroot stays reachable and the distribution's own files still resolve. It is skipped when the image has no pkg-config.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
🎉 This PR is included in version 1.26.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
Refs #69. Closing it needs a release and a fleet apply, so I will close it once a job on a runner carrying this hook resolves the sysroot after setup-python.
actions/setup-pythondoescore.exportVariable('PKG_CONFIG_PATH', installDir + '/lib/pkgconfig')(src/find-python.ts, twice, no reference to the old value), so it replaces whatever the job-started hook put inPKG_CONFIG_PATH. In a real job log the variable was the sysroot'slib/pkgconfigright after the hook and only setup-python's directory afterwards, and a laterpip install mysqlclientfailed to findlibmariadbthrough pkg-config.LD_LIBRARY_PATHwas fine because setup-python prepends to it.The hook now also sets
PKG_CONFIG_LIBDIRto the sysroot'slib/pkgconfigfollowed by pkg-config's own default search path (pkg-config --variable=pc_path pkg-config), written toGITHUB_ENVand exported like the other sysroot variables. pkg-config searchesPKG_CONFIG_PATHfirst andPKG_CONFIG_LIBDIRafter it, and setup-python does not touch the latter, so the sysroot survives it and any other action that rewritesPKG_CONFIG_PATH. Appending the default path matters becausePKG_CONFIG_LIBDIRreplaces the default, and a bare sysroot value would hide the distribution's own.pcfiles. If the image has no pkg-config the variable is not set (nothing would read it, and a pkg-config installed mid-job still sees the sysroot throughPKG_CONFIG_PATH). I did not symlink files into a default directory, which is invasive and per-library.New unit test in
DispatcherTest: it runs the hook against a fake sysroot with a fixture.pcfile, applies theGITHUB_ENVit wrote, overwritesPKG_CONFIG_PATHas setup-python does and assertspkg-config --exists fixture, and that the default path is still appended. With the old hook the test fails (1 != 0), with the change it passes. The wholetests/unitsuite passes locally (298 tests), shellcheck and yamllint are clean. The unit job now installs pkg-config explicitly.check_pkg_configin the system-library checks now also resolves each module withPKG_CONFIG_PATHpointed elsewhere; I have not run that docker-based test locally,system-libraries.ymlruns it on this PR.Not covered: the live fleet is untouched. Taking this up needs a release and a fleet apply.