test(e2e): port rules_pycross sdist-build cases - #1413
Conversation
Port of rules_pycross's e2e suite (build_setuptools, patches_and_hooks, build_pure_python and the distutils probe) to rules_py's uv extension and pep517 rules. (cherry picked from commit 4869b33, adapted to keep main's //tools:linux_x86_64 platform)
Refinements over the original port so the suite runs green against the existing rules: - drop pycross-setuptools' cross matrix (native_wheels targets, per-case platforms, check_wheel_native.py): building a C extension for a non-host platform needs native_build_toolchain_type resolution for that platform, which lands with the cross-compilation branch. The pure-python collect_wheels matrix stays — anyarch builds exercise the exec-platform resolution without a native toolchain. - keep //tools:linux_x86_64, referenced by venv-namespace-collapse docs - require PYCROSS_TEST_PACKAGES in test_top_level_packages instead of falling back to packages this workspace doesn't ship - move design rationale from inline comments into module docstrings; strip the prose preamble from the post-install patch
✨ Aspect Workflows Tasks📅 Tue Aug 11 03:10:12 UTC 2026 ✅ 41 successful tasks
⏱ Last updated Tue Aug 11 03:16:44 UTC 2026 · 📊 GitHub API quota 938/15,000 (6% used, resets in 41m) |
py_binary startup benchmark
sys.path quality
Bazel analysis benchmark
|
expected_tags is now required: every caller asserts tags, and a collect_wheels without the tags test would reintroduce exactly the silent wrong-platform pass the macro exists to prevent. The unused **kwargs forwarding goes with it. collect_wheels.py keeps only the tree-artifact branch: wheels always arrive as pep517_whl/pep517_native_whl directory outputs, so the plain-file handling inherited from rules_pycross never ran.
373e69d to
86e0368
Compare
The four rules_pycross ports moved from e2e/cases into the crossbuild workspace, where the cross toolchains they exercise actually live: - restore the pycross-setuptools native_wheels matrix deferred out of #1413 (zstandard rebuilt for amd64/arm64 with ELF and wheel-tag assertions) — under this workspace's registered cross CC toolchain it runs where it couldn't on main - carry the reviewed refinements from #1413 over the original port - pin setproctitle to -std=gnu17: gcc_toolchain's GCC defaults to C23, where `bool` is a keyword and 1.3.2's `typedef char bool` breaks — coverage the e2e/cases host toolchain never gave us - drop the cases, their MODULE includes and the collect_wheels tooling from e2e/cases
The four rules_pycross ports moved from e2e/cases into the crossbuild workspace, where the cross toolchains they exercise actually live: - restore the pycross-setuptools native_wheels matrix deferred out of #1413 (zstandard rebuilt for amd64/arm64 with ELF and wheel-tag assertions) — under this workspace's registered cross CC toolchain it runs where it couldn't on main - carry the reviewed refinements from #1413 over the original port - pin setproctitle to -std=gnu17: gcc_toolchain's GCC defaults to C23, where `bool` is a keyword and 1.3.2's `typedef char bool` breaks — coverage the e2e/cases host toolchain never gave us - drop the cases, their MODULE includes and the collect_wheels tooling from e2e/cases
The four rules_pycross ports moved from e2e/cases into the crossbuild workspace, where the cross toolchains they exercise actually live: - restore the pycross-setuptools native_wheels matrix deferred out of #1413 (zstandard rebuilt for amd64/arm64 with ELF and wheel-tag assertions) — under this workspace's registered cross CC toolchain it runs where it couldn't on main - carry the reviewed refinements from #1413 over the original port - pin setproctitle to -std=gnu17: gcc_toolchain's GCC defaults to C23, where `bool` is a keyword and 1.3.2's `typedef char bool` breaks — coverage the e2e/cases host toolchain never gave us - drop the cases, their MODULE includes and the collect_wheels tooling from e2e/cases
Ports four cases from rules_pycross's e2e suite, exercising the existing sdist→wheel pipeline (host builds only — no cross-compilation involved). Split out of #1363, where these cases don't depend on the cross feature; every test passes against current
mainunchanged.Cases
build_setuptools): three setuptools C-extension sdists — PyYAML (Cython-generated extension, with an observablePYYAML_FORCE_LIBYAML=0env override), setproctitle (plain C,pre_build_patches), zstandard (vendored libzstd,resource_set).patches_and_hooks): pre-build and post-install patch phases stacked on setproctitle — the post-install hunk carries the pre-build patch's output as context, so an ordering regression fails the build itself.build_pure_python): hatchling and flit-core backends, runtime imports, site-packages placement hygiene, plus acollect_wheelsmatrix asserting anyarch wheels stay-none-anyunder non-host platform transitions (exec-platform resolution of the build tooling, no native toolchain needed).distutilson Python 3.12+, guardingrule.bzl's_INHERITED_PYTHON_ENVfilter. Fails only in the child, so it's invisible to a plain "does it build" check.Shared
tools/:collect_wheelsmacro (adds the wheel-tag assertion the rules_pycross original lacks) andcheck_wheel_tags.py.Not included
pycross-setuptools' cross matrix (native_wheels*,check_wheel_native.py): building a C extension for a non-host platform needsnative_build_toolchain_typeresolution for that platform, which lands with #1363. The second commit documents that scope cut.Changes are visible to end-users: no
Test plan