Repository navigation
Conversation
Build every <triplet>-ct-ng.config under src/ppbt/_config/<host>/ into its own tarball, so the x86_64 wheel carries both x86_64-linux-gnu and aarch64-linux-gnu toolchains (and vice versa for the aarch64 wheel). The native-only behaviour is preserved for hosts that have only a single config. Factor build_ppbt's per-toolchain work into _prepare_crosstool_ng, _prepare_patchelf, and _build_one_toolchain so the crosstool-ng and patchelf download/compile happens once per invocation rather than once per target. Expose archive_for(triplet), toolchain_for(triplet), and available_triplets() in ppbt.common (re-exported from ppbt) so callers like relenv can pick the matching tarball out of the wheel. extract() and environ() grow a triplet= kwarg defaulting to the host for backward compatibility.
3 of 6 tasks
Contributor
Author
|
Superseded by #9, which splits the cross toolchains into separate PyPI packages ( |
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.
Summary
src/ppbt/_config/<host>/instead of just the host's native one. The x86_64 wheel ships bothx86_64-linux-gnu.tar.xzandaarch64-linux-gnu.tar.xz; the aarch64 wheel ships both in reverse. Downstream consumers (relenv) can cross-compile the "other" Linux arch without building a crosstool-ng toolchain themselves (several-hour yak-shave previously).ppbt.common(also re-exported fromppbt):archive_for(triplet),toolchain_for(triplet),available_triplets().extract()andenviron()grow atriplet=kwarg defaulting to the host, so pre-0.2.0 callers keep working unchanged.build_ppbtrefactored:_prepare_crosstool_ng+_prepare_patchelfrun once per build;_build_one_toolchainruns once per<triplet>-ct-ng.config. Single-arch hosts (configs that only define the native triplet) get the original behaviour.Why
relenv needs to cross-build onedirs for aarch64 from an x86_64 runner (and vice versa) to validate saltstack/relenv#37 (cross-build
relenv relocate). Without a prebuilt cross toolchain shipped in ppbt, every cross build has to compile glibc from source — which is why nobody actually exercises the cross-build path today.Test plan
pytest tests/passes (newtests/test_common.pycoversarchive_for,toolchain_for,available_triplets,environ(triplet=...), and the re-exports).pre-commit runclean on all touched files (black reformatted a few lines, flake8 clean).get_toolchain()to callppbt.archive_for(triplet)and cross-build an aarch64 onedir from an x86_64 host end-to-end.