Skip to content

fix(arc): keep the sysroot's pkg-config files visible after actions/setup-python - #70

Merged
Mearman merged 1 commit into
mainfrom
fix/pkg-config-libdir
Oct 8, 2026
Merged

Mearman merged 1 commit into
mainfrom
fix/pkg-config-libdir

Conversation

@Mearman

@Mearman Mearman commented Oct 8, 2026

Copy link
Copy Markdown
Member

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-python does core.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 in PKG_CONFIG_PATH. In a real job log the variable was the sysroot's lib/pkgconfig right after the hook and only setup-python's directory afterwards, and a later pip install mysqlclient failed to find libmariadb through pkg-config. LD_LIBRARY_PATH was fine because setup-python prepends to it.

The hook now also sets PKG_CONFIG_LIBDIR to the sysroot's lib/pkgconfig followed by pkg-config's own default search path (pkg-config --variable=pc_path pkg-config), written to GITHUB_ENV and exported like the other sysroot variables. pkg-config searches PKG_CONFIG_PATH first and PKG_CONFIG_LIBDIR after it, and setup-python does not touch the latter, so the sysroot survives it and any other action that rewrites PKG_CONFIG_PATH. Appending the default path matters because PKG_CONFIG_LIBDIR replaces the default, and a bare sysroot value would hide the distribution's own .pc files. 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 through PKG_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 .pc file, applies the GITHUB_ENV it wrote, overwrites PKG_CONFIG_PATH as setup-python does and asserts pkg-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 whole tests/unit suite passes locally (298 tests), shellcheck and yamllint are clean. The unit job now installs pkg-config explicitly. check_pkg_config in the system-library checks now also resolves each module with PKG_CONFIG_PATH pointed elsewhere; I have not run that docker-based test locally, system-libraries.yml runs it on this PR.

Not covered: the live fleet is untouched. Taking this up needs a release and a fleet apply.

…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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-10-08T21:26:45.346955Z a3d261e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Mearman
Mearman merged commit 779c361 into main Oct 8, 2026
25 of 26 checks passed
@Mearman
Mearman deleted the fix/pkg-config-libdir branch October 8, 2026 21:35
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.26.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant