From 3d4e2ff1b1d7240635d1fdb5e0d070b7c35dd126 Mon Sep 17 00:00:00 2001 From: Cheng Li Date: Thu, 16 Jul 2026 00:00:17 +0900 Subject: [PATCH 1/8] ci(packaging): build packages only on tags/dispatch; free runner disk The full-source wheel build peaks close to the standard runner's ~14 GB free disk: two Build-RPM runs hit ENOSPC on 2026-07-15 (fedora43 during wheel zip packing, openeuler2403 during final link), blocking unrelated PRs. Packaging is a release artifact, not a PR gate: - drop the pull_request trigger; keep tag push + workflow_dispatch - reclaim ~25-30 GB by removing unused preinstalled toolchains - add a concurrency group to cancel superseded runs --- .github/workflows/build-deb.yml | 28 ++++++++++++++++------------ .github/workflows/build-rpm.yml | 28 ++++++++++++++++------------ 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build-deb.yml b/.github/workflows/build-deb.yml index 6744a4ae6..94f0c0c53 100644 --- a/.github/workflows/build-deb.yml +++ b/.github/workflows/build-deb.yml @@ -1,23 +1,18 @@ name: Build Debian Packages +# Packaging is a release artifact, not a PR gate: the full-source wheel +# build costs ~45 min per run and its ENOSPC flakiness was blocking +# unrelated PRs. Build on release tags or on demand (workflow_dispatch). on: push: tags: - 'v*' - pull_request: - branches: [main] - paths: - - 'packaging/debian/**' - - 'python/**' - - 'include/**' - - 'lib/**' - - 'cmake/**' - - 'bin/**' - - 'CMakeLists.txt' - - 'pyproject.toml' - - '.github/workflows/build-deb.yml' workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build-deb: # WARNING: this builds the full FlagTree LLVM/MLIR wheel from source @@ -28,6 +23,15 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 90 steps: + # The wheel build peaks close to the standard runner's ~14 GB of + # free disk (ENOSPC seen on the RPM twin of this workflow); + # dropping unused preinstalled toolchains reclaims ~25-30 GB. + - name: Free runner disk space + run: | + sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL + sudo docker image prune --all --force + df -h / + - name: Checkout repository uses: actions/checkout@v4 with: diff --git a/.github/workflows/build-rpm.yml b/.github/workflows/build-rpm.yml index 3c75f10a6..f4a99d30c 100644 --- a/.github/workflows/build-rpm.yml +++ b/.github/workflows/build-rpm.yml @@ -1,23 +1,18 @@ name: Build RPM Packages +# Packaging is a release artifact, not a PR gate: the full-source wheel +# build costs ~45 min x 2 runners and its ENOSPC flakiness was blocking +# unrelated PRs. Build on release tags or on demand (workflow_dispatch). on: push: tags: - 'v*' - pull_request: - branches: [main] - paths: - - 'packaging/rpm/**' - - 'python/**' - - 'include/**' - - 'lib/**' - - 'cmake/**' - - 'bin/**' - - 'CMakeLists.txt' - - 'pyproject.toml' - - '.github/workflows/build-rpm.yml' workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build-rpm: runs-on: ubuntu-latest @@ -34,6 +29,15 @@ jobs: base_image: openeuler/openeuler:24.03-lts artifact: flagtree-nvidia-oe2403-rpm-packages steps: + # The wheel build peaks close to the standard runner's ~14 GB of + # free disk (ENOSPC seen in both matrix targets); dropping unused + # preinstalled toolchains reclaims ~25-30 GB. + - name: Free runner disk space + run: | + sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL + sudo docker image prune --all --force + df -h / + - name: Checkout repository uses: actions/checkout@v4 with: From 6045ba1a2c4cced19ac8cc69c6a3a546691eb518 Mon Sep 17 00:00:00 2001 From: Cheng Li Date: Thu, 16 Jul 2026 00:01:11 +0900 Subject: [PATCH 2/8] fix(packaging): drop build tree and LLVM cache from the wheel layer Remove /src/build and /root/.triton at the end of the wheel-build RUN so the layer keeps only /wheels. The CMake build tree plus the downloaded LLVM tarballs add several GB to the layer and contribute to ENOSPC on CI runners; they are dead weight once the wheel exists. --- packaging/debian/build-helpers/Dockerfile.deb | 6 +++++- packaging/rpm/helpers/Dockerfile.rpm | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packaging/debian/build-helpers/Dockerfile.deb b/packaging/debian/build-helpers/Dockerfile.deb index 20f8d470d..71819ee97 100644 --- a/packaging/debian/build-helpers/Dockerfile.deb +++ b/packaging/debian/build-helpers/Dockerfile.deb @@ -72,11 +72,15 @@ COPY CMakeLists.txt pyproject.toml setup.py MANIFEST.in LICENSE README.md /src/ # FLAGTREE_DEFAULT_BACKENDS=nvidia,amd matches the historical package # contents and keeps the tileir backend (GCC >= 13 + cuda-tile # submodule) out of the distro build. +# The trailing rm keeps only /wheels in this layer: the CMake build +# tree and the LLVM tarball cache (~/.triton) would otherwise add +# several GB and push CI runners into ENOSPC. RUN unset FLAGTREE_BACKEND && \ FLAGTREE_DEFAULT_BACKENDS=nvidia,amd \ MAX_JOBS=4 python -m pip wheel . --no-build-isolation --no-deps -w /wheels -v && \ ls -lh /wheels/ && \ - test -n "$(ls /wheels/flagtree-*.whl 2>/dev/null)" + test -n "$(ls /wheels/flagtree-*.whl 2>/dev/null)" && \ + rm -rf /src/build /root/.triton # ---------- Stage 2: assemble the .deb ---------- FROM ${DEB_BASE_IMAGE} AS deb-assembler diff --git a/packaging/rpm/helpers/Dockerfile.rpm b/packaging/rpm/helpers/Dockerfile.rpm index dbaea8087..5b5c1f759 100644 --- a/packaging/rpm/helpers/Dockerfile.rpm +++ b/packaging/rpm/helpers/Dockerfile.rpm @@ -44,11 +44,15 @@ COPY CMakeLists.txt pyproject.toml setup.py MANIFEST.in LICENSE README.md /src/ # FLAGTREE_DEFAULT_BACKENDS=nvidia,amd matches the historical package # contents and keeps the tileir backend (GCC >= 13 + cuda-tile # submodule) out of the distro build. +# The trailing rm keeps only /wheels in this layer: the CMake build +# tree and the LLVM tarball cache (~/.triton) would otherwise add +# several GB and push CI runners into ENOSPC. RUN unset FLAGTREE_BACKEND && \ FLAGTREE_DEFAULT_BACKENDS=nvidia,amd \ MAX_JOBS=4 python3 -m pip wheel . --no-build-isolation --no-deps -w /wheels -v && \ ls -lh /wheels/ && \ - test -n "$(ls /wheels/flagtree-*.whl 2>/dev/null)" + test -n "$(ls /wheels/flagtree-*.whl 2>/dev/null)" && \ + rm -rf /src/build /root/.triton # ---------- Stage 2: assemble the .rpm ---------- FROM ${RPM_BASE_IMAGE} AS rpm-assembler From cd9b50da7ed8cf7c4424cde0e45e502a95071278 Mon Sep 17 00:00:00 2001 From: Cheng Li Date: Thu, 16 Jul 2026 00:01:11 +0900 Subject: [PATCH 3/8] fix(packaging): sync rpm/deb package version with the 0.6.0 wheel The spec and debian changelog still said 0.5.0 while setup.py builds flagtree 0.6.0, so packages were mislabeled. Bump both to 0.6.0 and make the rpm install step fail if the wheel version ever drifts from the spec Version again. --- packaging/debian/changelog | 6 ++++++ packaging/rpm/specs/flagtree.spec | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/packaging/debian/changelog b/packaging/debian/changelog index 8694dca01..b038b02a6 100644 --- a/packaging/debian/changelog +++ b/packaging/debian/changelog @@ -1,3 +1,9 @@ +flagtree (0.6.0-1) unstable; urgency=medium + + * Sync package version with the flagtree wheel (0.6.0). + + -- FlagOS Contributors Wed, 15 Jul 2026 08:00:00 +0000 + flagtree (0.5.0-1) unstable; urgency=medium * Initial Debian packaging. diff --git a/packaging/rpm/specs/flagtree.spec b/packaging/rpm/specs/flagtree.spec index 0c93bdf40..599b1c006 100644 --- a/packaging/rpm/specs/flagtree.spec +++ b/packaging/rpm/specs/flagtree.spec @@ -29,7 +29,7 @@ %define __requires_exclude libcuda\\.so|libnvidia.* Name: python3-flagtree-%{flagtree_backend} -Version: 0.5.0 +Version: 0.6.0 Release: 1%{?dist} Summary: FlagTree compiler with %{flagtree_backend} backend License: MIT AND Apache-2.0 WITH LLVM-exception AND BSD-3-Clause AND LicenseRef-NVIDIA-CUDA-EULA @@ -102,6 +102,14 @@ if [ -z "$WHEEL" ]; then exit 1 fi +# Guard against Version drifting from the wheel again (0.5.0 rpms used +# to ship a 0.6.0 wheel). +WHEEL_VER=$(basename "$WHEEL" | cut -d- -f2) +if [ "$WHEEL_VER" != "%{version}" ]; then + echo "ERROR: wheel version $WHEEL_VER != spec Version %{version}" >&2 + exit 1 +fi + PYDIR=%{buildroot}%{python3_sitearch} mkdir -p "$PYDIR" %{buildroot}%{_bindir} @@ -134,6 +142,10 @@ install -D -m 0644 %{SOURCE0} %{buildroot}%{_licensedir}/%{name}/LICENSE %{_bindir}/proton* %changelog +* Wed Jul 15 2026 FlagOS Contributors - 0.6.0-1 +- Sync package version with the flagtree wheel (0.6.0). +- Fail the install step when the wheel version does not match the spec. + * Mon Apr 27 2026 FlagOS Contributors - 0.5.0-1 - Initial RPM packaging. - Package the %{flagtree_backend} backend variant. From 0a0dccf66eb092935387adeb250ab03a7971d7a1 Mon Sep 17 00:00:00 2001 From: Cheng Li Date: Thu, 16 Jul 2026 00:04:26 +0900 Subject: [PATCH 4/8] ci(packaging): restrict disk cleanup to GitHub-hosted runners Skip the sudo rm -rf toolchain cleanup unless RUNNER_ENVIRONMENT is github-hosted, so a future switch to a self-hosted runner cannot wipe a persistent machine. --- .github/workflows/build-deb.yml | 6 ++++++ .github/workflows/build-rpm.yml | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-deb.yml b/.github/workflows/build-deb.yml index 94f0c0c53..c89aa7333 100644 --- a/.github/workflows/build-deb.yml +++ b/.github/workflows/build-deb.yml @@ -26,8 +26,14 @@ jobs: # The wheel build peaks close to the standard runner's ~14 GB of # free disk (ENOSPC seen on the RPM twin of this workflow); # dropping unused preinstalled toolchains reclaims ~25-30 GB. + # Guarded to ephemeral GitHub-hosted VMs only, so a future move to + # a self-hosted runner can never wipe a real machine. - name: Free runner disk space run: | + if [ "${RUNNER_ENVIRONMENT}" != "github-hosted" ]; then + echo "Not a GitHub-hosted runner; skipping disk cleanup." + exit 0 + fi sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL sudo docker image prune --all --force df -h / diff --git a/.github/workflows/build-rpm.yml b/.github/workflows/build-rpm.yml index f4a99d30c..6d2b418bc 100644 --- a/.github/workflows/build-rpm.yml +++ b/.github/workflows/build-rpm.yml @@ -31,9 +31,15 @@ jobs: steps: # The wheel build peaks close to the standard runner's ~14 GB of # free disk (ENOSPC seen in both matrix targets); dropping unused - # preinstalled toolchains reclaims ~25-30 GB. + # preinstalled toolchains reclaims ~25-30 GB. Guarded to ephemeral + # GitHub-hosted VMs only, so a future move to a self-hosted runner + # can never wipe a real machine. - name: Free runner disk space run: | + if [ "${RUNNER_ENVIRONMENT}" != "github-hosted" ]; then + echo "Not a GitHub-hosted runner; skipping disk cleanup." + exit 0 + fi sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL sudo docker image prune --all --force df -h / From 32fcf08ddf7aea7066498de2f3b0c3f622d168f6 Mon Sep 17 00:00:00 2001 From: Cheng Li Date: Thu, 16 Jul 2026 00:12:26 +0900 Subject: [PATCH 5/8] ci(packaging): match unprefixed release tags; skip backend variants The tag trigger only matched 'v*', but FlagTree release tags dropped the v prefix after v0.3.0 (0.6.0, 0.6.0rc1, ...), so tag pushes never started a packaging build. Match unprefixed numeric tags too, and skip backend-variant tags (0.6.0+mthreads3.6) at the job level: '+' is not a valid RPM Version character and those releases are not the nvidia package. --- .github/workflows/build-deb.yml | 10 +++++++++- .github/workflows/build-rpm.yml | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deb.yml b/.github/workflows/build-deb.yml index c89aa7333..a5ebbe326 100644 --- a/.github/workflows/build-deb.yml +++ b/.github/workflows/build-deb.yml @@ -3,10 +3,16 @@ name: Build Debian Packages # Packaging is a release artifact, not a PR gate: the full-source wheel # build costs ~45 min per run and its ENOSPC flakiness was blocking # unrelated PRs. Build on release tags or on demand (workflow_dispatch). +# +# FlagTree release tags are unprefixed (0.6.0, 0.6.0rc1); v-prefixed +# tags stopped after v0.3.0. Backend-variant tags (0.6.0+mthreads3.6) +# are filtered out at the job level — those releases are not the +# nvidia package. on: push: tags: - - 'v*' + - '[0-9]*' + - 'v[0-9]*' workflow_dispatch: concurrency: @@ -15,6 +21,8 @@ concurrency: jobs: build-deb: + # Skip backend-variant tags like 0.6.0+mthreads3.6. + if: ${{ github.event_name != 'push' || !contains(github.ref_name, '+') }} # WARNING: this builds the full FlagTree LLVM/MLIR wheel from source # (~36 min on a 4-core builder) and peaks well above 4 GB RAM. The # public `ubuntu-latest` runner (4 vCPU / ~16 GB RAM) is on the edge diff --git a/.github/workflows/build-rpm.yml b/.github/workflows/build-rpm.yml index 6d2b418bc..aa7935dbe 100644 --- a/.github/workflows/build-rpm.yml +++ b/.github/workflows/build-rpm.yml @@ -3,10 +3,16 @@ name: Build RPM Packages # Packaging is a release artifact, not a PR gate: the full-source wheel # build costs ~45 min x 2 runners and its ENOSPC flakiness was blocking # unrelated PRs. Build on release tags or on demand (workflow_dispatch). +# +# FlagTree release tags are unprefixed (0.6.0, 0.6.0rc1); v-prefixed +# tags stopped after v0.3.0. Backend-variant tags (0.6.0+mthreads3.6) +# are filtered out at the job level — '+' cannot appear in an RPM +# Version and those releases are not the nvidia package. on: push: tags: - - 'v*' + - '[0-9]*' + - 'v[0-9]*' workflow_dispatch: concurrency: @@ -15,6 +21,8 @@ concurrency: jobs: build-rpm: + # Skip backend-variant tags like 0.6.0+mthreads3.6. + if: ${{ github.event_name != 'push' || !contains(github.ref_name, '+') }} runs-on: ubuntu-latest strategy: fail-fast: false From 9a82f682a147edf3d04e34194ebdfc41337821ed Mon Sep 17 00:00:00 2001 From: Cheng Li Date: Thu, 16 Jul 2026 00:36:36 +0900 Subject: [PATCH 6/8] ci(packaging): trim workflow comments to essentials Move the rationale narrative to the PR description; keep only the constraints a reader needs at the code. --- .github/workflows/build-deb.yml | 17 ++++------------- .github/workflows/build-rpm.yml | 17 ++++------------- 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build-deb.yml b/.github/workflows/build-deb.yml index a5ebbe326..3d6a97130 100644 --- a/.github/workflows/build-deb.yml +++ b/.github/workflows/build-deb.yml @@ -1,13 +1,7 @@ name: Build Debian Packages -# Packaging is a release artifact, not a PR gate: the full-source wheel -# build costs ~45 min per run and its ENOSPC flakiness was blocking -# unrelated PRs. Build on release tags or on demand (workflow_dispatch). -# -# FlagTree release tags are unprefixed (0.6.0, 0.6.0rc1); v-prefixed -# tags stopped after v0.3.0. Backend-variant tags (0.6.0+mthreads3.6) -# are filtered out at the job level — those releases are not the -# nvidia package. +# Release packaging only (no PR trigger). Release tags are unprefixed +# since 0.3.0, e.g. 0.6.0 / 0.6.0rc1. on: push: tags: @@ -31,11 +25,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 90 steps: - # The wheel build peaks close to the standard runner's ~14 GB of - # free disk (ENOSPC seen on the RPM twin of this workflow); - # dropping unused preinstalled toolchains reclaims ~25-30 GB. - # Guarded to ephemeral GitHub-hosted VMs only, so a future move to - # a self-hosted runner can never wipe a real machine. + # The wheel build peaks near the runner's free-disk limit. + # Ephemeral GitHub-hosted VMs only — never a self-hosted machine. - name: Free runner disk space run: | if [ "${RUNNER_ENVIRONMENT}" != "github-hosted" ]; then diff --git a/.github/workflows/build-rpm.yml b/.github/workflows/build-rpm.yml index aa7935dbe..458402534 100644 --- a/.github/workflows/build-rpm.yml +++ b/.github/workflows/build-rpm.yml @@ -1,13 +1,7 @@ name: Build RPM Packages -# Packaging is a release artifact, not a PR gate: the full-source wheel -# build costs ~45 min x 2 runners and its ENOSPC flakiness was blocking -# unrelated PRs. Build on release tags or on demand (workflow_dispatch). -# -# FlagTree release tags are unprefixed (0.6.0, 0.6.0rc1); v-prefixed -# tags stopped after v0.3.0. Backend-variant tags (0.6.0+mthreads3.6) -# are filtered out at the job level — '+' cannot appear in an RPM -# Version and those releases are not the nvidia package. +# Release packaging only (no PR trigger). Release tags are unprefixed +# since 0.3.0, e.g. 0.6.0 / 0.6.0rc1. on: push: tags: @@ -37,11 +31,8 @@ jobs: base_image: openeuler/openeuler:24.03-lts artifact: flagtree-nvidia-oe2403-rpm-packages steps: - # The wheel build peaks close to the standard runner's ~14 GB of - # free disk (ENOSPC seen in both matrix targets); dropping unused - # preinstalled toolchains reclaims ~25-30 GB. Guarded to ephemeral - # GitHub-hosted VMs only, so a future move to a self-hosted runner - # can never wipe a real machine. + # The wheel build peaks near the runner's free-disk limit. + # Ephemeral GitHub-hosted VMs only — never a self-hosted machine. - name: Free runner disk space run: | if [ "${RUNNER_ENVIRONMENT}" != "github-hosted" ]; then From 16bcf20e53f53d3e239d2e1ef290665ab16d2c39 Mon Sep 17 00:00:00 2001 From: Cheng Li Date: Thu, 16 Jul 2026 00:51:30 +0900 Subject: [PATCH 7/8] ci(packaging): restore PR trigger for packaging-file changes only Packaging edits do need CI validation before merge, and contributors without write access cannot use workflow_dispatch upstream. Narrow the paths to packaging/** and the workflow file itself instead of the old python/**-wide filter that ran the 45-min build on unrelated PRs. --- .github/workflows/build-deb.yml | 10 ++++++++-- .github/workflows/build-rpm.yml | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-deb.yml b/.github/workflows/build-deb.yml index 3d6a97130..c589dcd92 100644 --- a/.github/workflows/build-deb.yml +++ b/.github/workflows/build-deb.yml @@ -1,12 +1,18 @@ name: Build Debian Packages -# Release packaging only (no PR trigger). Release tags are unprefixed -# since 0.3.0, e.g. 0.6.0 / 0.6.0rc1. +# PRs trigger this only for packaging-file changes; source changes do +# not (the full wheel build is too heavy for a general PR gate). +# Release tags are unprefixed since 0.3.0, e.g. 0.6.0 / 0.6.0rc1. on: push: tags: - '[0-9]*' - 'v[0-9]*' + pull_request: + branches: [main] + paths: + - 'packaging/debian/**' + - '.github/workflows/build-deb.yml' workflow_dispatch: concurrency: diff --git a/.github/workflows/build-rpm.yml b/.github/workflows/build-rpm.yml index 458402534..39a672d98 100644 --- a/.github/workflows/build-rpm.yml +++ b/.github/workflows/build-rpm.yml @@ -1,12 +1,18 @@ name: Build RPM Packages -# Release packaging only (no PR trigger). Release tags are unprefixed -# since 0.3.0, e.g. 0.6.0 / 0.6.0rc1. +# PRs trigger this only for packaging-file changes; source changes do +# not (the full wheel build is too heavy for a general PR gate). +# Release tags are unprefixed since 0.3.0, e.g. 0.6.0 / 0.6.0rc1. on: push: tags: - '[0-9]*' - 'v[0-9]*' + pull_request: + branches: [main] + paths: + - 'packaging/rpm/**' + - '.github/workflows/build-rpm.yml' workflow_dispatch: concurrency: From 77cdc38edf6f0e49eb301998ee8e9bbf0446e51c Mon Sep 17 00:00:00 2001 From: Cheng Li Date: Thu, 16 Jul 2026 01:07:01 +0900 Subject: [PATCH 8/8] test(packaging): smoke-test built packages by installing and importing Install the freshly built rpm/deb in the assembler stage and run 'import triton'. rpmbuild/dpkg-buildpackage validate packaging metadata but never execute the payload, so the 'installs fine, fails at import' class (missing libs, bad rpath, glibc mismatch) went undetected. --- packaging/debian/build-helpers/Dockerfile.deb | 8 ++++++++ packaging/rpm/helpers/Dockerfile.rpm | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/packaging/debian/build-helpers/Dockerfile.deb b/packaging/debian/build-helpers/Dockerfile.deb index 71819ee97..28f595f09 100644 --- a/packaging/debian/build-helpers/Dockerfile.deb +++ b/packaging/debian/build-helpers/Dockerfile.deb @@ -110,6 +110,14 @@ RUN dpkg-buildpackage -us -uc -b && \ # in the build log without failing the build. RUN lintian --info --display-info /python3-flagtree-*.deb || true +# Smoke test: install the freshly built deb and import the package. +# Catches the "installs fine, fails at import" class (missing libs, +# bad rpath, glibc mismatch) that dpkg-buildpackage alone cannot see. +RUN apt-get update && \ + apt-get install -y --no-install-recommends /python3-flagtree-*.deb && \ + python3 -c "import triton; print(getattr(triton, '__version__', 'import ok'))" && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + # ---------- Stage 3: just the .deb output ---------- FROM scratch AS deb-output COPY --from=deb-assembler /python3-flagtree-*.deb /output/ diff --git a/packaging/rpm/helpers/Dockerfile.rpm b/packaging/rpm/helpers/Dockerfile.rpm index 5b5c1f759..49d8e05b9 100644 --- a/packaging/rpm/helpers/Dockerfile.rpm +++ b/packaging/rpm/helpers/Dockerfile.rpm @@ -86,6 +86,12 @@ RUN rpmbuild -ba /root/rpmbuild/SPECS/flagtree.spec \ --define "wheel_dir /wheels" && \ ls -lh /root/rpmbuild/RPMS/x86_64/ +# Smoke test: install the freshly built rpm and import the package. +# Catches the "installs fine, fails at import" class (missing libs, +# bad rpath, glibc mismatch) that rpmbuild alone cannot see. +RUN dnf install -y /root/rpmbuild/RPMS/x86_64/python3-flagtree-*.x86_64.rpm && \ + python3 -c "import triton; print(getattr(triton, '__version__', 'import ok'))" + # ---------- Stage 3: extract just the rpms ---------- FROM scratch AS rpm-output COPY --from=rpm-assembler /root/rpmbuild/RPMS/x86_64/python3-flagtree-*.rpm /output/