Skip to content

Commit 507feb4

Browse files
pythongh-127432: Add CI job to cross build Python
This is to avoid regressions in the cross building process.
1 parent b2ac70a commit 507feb4

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/build.yml

+39
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,45 @@ jobs:
523523
suppressions_path: Tools/tsan/suppressions_free_threading.txt
524524
tsan_logs_artifact_name: tsan-logs-free-threading
525525

526+
cross-build-linux:
527+
name: Cross build Linux
528+
runs-on: ubuntu-latest
529+
needs: check_source
530+
if: needs.check_source.outputs.run_tests == 'true'
531+
steps:
532+
- uses: actions/checkout@v4
533+
with:
534+
persist-credentials: false
535+
- name: Runner image version
536+
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
537+
- name: Restore config.cache
538+
uses: actions/cache@v4
539+
with:
540+
path: config.cache
541+
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}
542+
- name: Register gcc problem matcher
543+
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
544+
- name: Set build dir
545+
run:
546+
# an absolute path outside of the working directoy
547+
echo "BUILD_DIR=$(realpath ${{ github.workspace }}/../build)" >> "$GITHUB_ENV"
548+
- name: Install Dependencies
549+
run: sudo ./.github/workflows/posix-deps-apt.sh
550+
- name: Configure host build
551+
run: ./configure --prefix="$BUILD_DIR/host-python"
552+
- name: Install host Python
553+
run: make -j8 install
554+
- name: Run test subset with host build
555+
run: |
556+
"$BUILD_DIR/host-python/bin/python3" -m test test_sysconfig test_site test_embed
557+
- name: Configure cross build
558+
run: ./configure --prefix="$BUILD_DIR/cross-python" --with-build-python="$BUILD_DIR/host-python/bin/python3"
559+
- name: Install cross Python
560+
run: make -j8 install
561+
- name: Run test subset with host build
562+
run: |
563+
"$BUILD_DIR/cross-python/bin/python3" -m test test_sysconfig test_site test_embed
564+
526565
# CIFuzz job based on https://google.github.io/oss-fuzz/getting-started/continuous-integration/
527566
cifuzz:
528567
name: CIFuzz

0 commit comments

Comments
 (0)