Skip to content

Pick the versioned libpython for idapyswitch - #19

Merged
danielplohmann merged 1 commit into
mainfrom
ci/idapyswitch-versioned-libpython
Sep 16, 2026
Merged

danielplohmann merged 1 commit into
mainfrom
ci/idapyswitch-versioned-libpython

Conversation

@danielplohmann

Copy link
Copy Markdown
Collaborator

IDA integration fails at Configure IDAPython for GUI smoke with exit 110:

Cannot determine python library version for "/opt/hostedtoolcache/Python/3.11.16/x64/lib/libpython3.so":
Unsupported python version 0.0.0 ('') (3.8+ is required)

Not caused by any plugin change. It also fails on main (run 35063649418), whose only new commit is the README badge from #14.

Cause

The step locates Python's shared library with:

PYTHON_LIBRARY="$(find "$PYTHON_LIBDIR" -maxdepth 1 -name 'libpython3*.so*' -print -quit)"

That directory holds three matches — libpython3.11.so.1.0, libpython3.11.so and libpython3.so — and -print -quit returns whichever comes first in directory order, not a sorted or preferred one. libpython3.so is the stable-ABI forwarder and carries no version, so idapyswitch can't read one out of it.

The step is byte-identical to the last run that passed, on 2026-08-04. What changed is the runner: hosted Python went 3.11.15 → 3.11.16, and the re-extracted toolcache directory now yields the forwarder first. The step was always a coin flip; the toolcache refresh flipped it.

Why it went unnoticed for six weeks

licensed-linux is gated on github.event.pull_request.head.repo.full_name == github.repository, and every PR since 2026-08-12 has come from the r0ny123 fork, so the job reported skipped each time. #18 is the first branch on the origin repo since then, which is why it surfaced there.

Fix

Ask sysconfig for the library instead of globbing: INSTSONAME (the versioned soname), falling back to LDLIBRARY, and never PY3LIBRARY (libpython3.so). The chosen path is echoed so the next failure here says which library was used.

Verified

Ran the step as CI runs it — extracted from the YAML with yaml.safe_load, executed under bash --noprofile --norc -e -o pipefail — against a stub idapyswitch that reproduces the version probe, and a fake LIBDIR carrying all three filenames with a sysconfig matching the runner's:

  • old selector, on the candidate CI hit → the exact error above, exit 110
  • new selector → libpython3.11.so.1.0, exit 0

yaml.safe_load parses the workflow; pytest (82) and ruff are unaffected and clean.

Also affects #17

mcrit_plugin's ida-tests.yml in #17 carries the identical line (.github/workflows/ida-tests.yml:370). It has only ever run as a fork PR, so it has always skipped — it will hit this the first time it runs for real. Worth porting there too.

🤖 Generated with Claude Code

The GUI smoke step located Python's shared library with

  find "$PYTHON_LIBDIR" -maxdepth 1 -name 'libpython3*.so*' -print -quit

and the hosted toolcache lib directory holds three matches:
libpython3.11.so.1.0, libpython3.11.so and libpython3.so. `-print -quit`
returns whichever comes first in directory order, and libpython3.so is the
stable-ABI forwarder, which carries no version. idapyswitch rejects it:

  Cannot determine python library version for ".../libpython3.so":
  Unsupported python version 0.0.0 ('') (3.8+ is required)

exit code 110. The step is unchanged since it last passed on 2026-08-04; the
hosted Python moved 3.11.15 -> 3.11.16 and the re-extracted directory now
yields the forwarder first. It was always a coin flip.

Ask sysconfig for INSTSONAME (the versioned soname), falling back to
LDLIBRARY, and never PY3LIBRARY. Echo the chosen path so the next failure
here says which library was used.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@danielplohmann
danielplohmann merged commit bc2a9b3 into main Sep 16, 2026
6 checks passed
@danielplohmann
danielplohmann deleted the ci/idapyswitch-versioned-libpython branch September 16, 2026 06:43
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.

1 participant