Skip to content

gh-122931 CI for Linux multiarch co-installability#152831

Open
stefanor wants to merge 10 commits into
python:mainfrom
stefanor:ci-multiarch-co-install
Open

gh-122931 CI for Linux multiarch co-installability#152831
stefanor wants to merge 10 commits into
python:mainfrom
stefanor:ci-multiarch-co-install

Conversation

@stefanor

@stefanor stefanor commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

As suggested in this thread, add some CI tooling to ensure that Python continues to be multi-arch co-installable.

Explicitly skip checking abi3.so and abi3t.so extensions, as they are currently not co-installable (#122931).

We reuse reusable-ubuntu to perform an extra set of build+install+hash runs without running the Python test suite. We do not do this in the main test suite execution, as achieving multi-arch co-installability requires some non-default configure parameters. But we could share builds, if desired for performance.

From an earlier implementation that didn't use hash-manifests:

Example failure (without abi3 and abi3t ignored): https://github.com/stefanor/cpython/actions/runs/28550736484/job/84647793000
Example success (with them ignored): https://github.com/stefanor/cpython/actions/runs/28551134448/job/84648971317

@stefanor stefanor force-pushed the ci-multiarch-co-install branch from 3a52cb5 to b84e719 Compare July 1, 2026 22:39
@stefanor

stefanor commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Note: This will require an extra ~165MiB * 5 test builds = ~820 MiB of artifact storage in GitHub CI, per test run. These are stored for 90 days by default. We could configure less...

Duh. Let me store hash manifests instead of storing the installs.

Comment on lines +16 to +17
with path.open("rb") as f:
return json.load(f)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit

Suggested change
with path.open("rb") as f:
return json.load(f)
json.load(path.read_bytes("rb"))

continue

for file in filenames:
if relative_dirpath.is_relative_to("usr/include") and file == "pyconfig.h":

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it might be cleaner to move checks like relative_dirpath.is_relative_to("usr/include") into vars outside this nested loop so they aren't recomputed.

# some tests write to srcdir, lack of pyc files slows down testing
run: sudo mount "$CPYTHON_RO_SRCDIR" -oremount,rw
- name: Tests
if: ${{ inputs.test }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: mustache is redundant in if-keys.

Suggested change
if: ${{ inputs.test }}
if: inputs.test

CPYTHON_TEST_ABI3T=1 CPYTHON_TEST_EXT_NAME=abi3t_mod \
build/install/usr/bin/python3 -m pip install ../cpython-ro-srcdir/Lib/test/test_cext
# Until https://github.com/pypa/setuptools/pull/5193 is released
if [ ${{ fromJSON(inputs.free-threading) && '1' || '0' }} = '0' ]; then \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Pretty sure Zizmor will be unhappy w/ the mix of GHA rendering and bash.. Plz move this into a step.

Comment on lines +147 to +152
CPYTHON_TEST_EXT_NAME=c_mod \
build/install/usr/bin/python3 -m pip install ../cpython-ro-srcdir/Lib/test/test_cext
CPYTHON_TEST_LIMITED=1 CPYTHON_TEST_EXT_NAME=abi3_mod \
build/install/usr/bin/python3 -m pip install ../cpython-ro-srcdir/Lib/test/test_cext
CPYTHON_TEST_ABI3T=1 CPYTHON_TEST_EXT_NAME=abi3t_mod \
build/install/usr/bin/python3 -m pip install ../cpython-ro-srcdir/Lib/test/test_cext

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we have separate steps for these plz? They'd be easier to deal with and visually distinct.

- name: Generate the install hashes filename
if: ${{ inputs.upload-install-hashes }}
run: |
echo "INSTALL_HASHES_FILE=install-hashes-${{ runner.arch }}-${{ case(inputs.free-threading, 't', '')}}${{ case(inputs.debug, 'd', '') }}" >> "$GITHUB_ENV"

@webknjaz webknjaz Jul 2, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Plz move the GHA-level rendering into an env:https://docs.zizmor.sh/audits/#template-injection

test-hypothesis,
build-asan,
build-san,
cross-build-linux,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
cross-build-linux,
linux-install-compare,

@webknjaz

webknjaz commented Jul 2, 2026

Copy link
Copy Markdown
Member

We do not do this in the main test suite execution, as achieving multi-arch co-installability requires some non-default configure parameters.

Do you mean the debug option?

But we could share builds, if desired for performance.

Seems like having another matrix will add 15–16 minutes of CI runtime.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants