Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packaging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ A 36-minute compile in `override_dh_auto_build` is slow, hard to debug, and
collides with `dh-python`'s expectations for a pure-Python `pyproject` build.
The two-stage Docker approach builds the wheel once, then wraps it cheaply
into a `.deb`/`.rpm` — keeping the heavy lifting in a controlled container.
The wheel builders use the distro nlohmann-json headers through
`JSON_SYSPATH=/usr`; backend-specific LLVM and device tools remain pinned to
the versions expected by each backend.

## Build locally

Expand Down
3 changes: 2 additions & 1 deletion packaging/debian/build-helpers/Dockerfile.deb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ENV PIP_ROOT_USER_ACTION=ignore
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 python3-pip python3-dev python3-venv \
build-essential cmake ninja-build git \
zlib1g zlib1g-dev libxml2 libxml2-dev \
zlib1g zlib1g-dev libxml2 libxml2-dev nlohmann-json3-dev \
wget curl ca-certificates \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -96,6 +96,7 @@ COPY CMakeLists.txt pyproject.toml setup.py MANIFEST.in LICENSE README.md /src/
# tree and the LLVM tarball cache (~/.triton) would otherwise add
# several GB and push CI runners into ENOSPC.
RUN unset FLAGTREE_BACKEND && \
JSON_SYSPATH=/usr \
FLAGTREE_DEFAULT_BACKENDS=nvidia,amd \
MAX_JOBS=4 python -m pip wheel . --no-build-isolation --no-deps -w /wheels -v && \
ls -lh /wheels/ && \
Expand Down
3 changes: 3 additions & 0 deletions packaging/rpm/helpers/Dockerfile.rpm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ RUN dnf install -y --setopt=install_weak_deps=False \
gcc gcc-c++ make cmake ninja-build git \
zlib-devel libxml2-devel \
wget curl ca-certificates \
&& (dnf install -y --setopt=install_weak_deps=False json-devel \
|| dnf install -y --setopt=install_weak_deps=False nlohmann-json-devel) \
&& dnf clean all

RUN python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel build
Expand Down Expand Up @@ -67,6 +69,7 @@ COPY CMakeLists.txt pyproject.toml setup.py MANIFEST.in LICENSE README.md /src/
# tree and the LLVM tarball cache (~/.triton) would otherwise add
# several GB and push CI runners into ENOSPC.
RUN unset FLAGTREE_BACKEND && \
JSON_SYSPATH=/usr \
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)" && \
Expand Down
Loading