Skip to content

Commit 344637d

Browse files
committed
only generate x86_64 packages
1 parent d32bc8d commit 344637d

File tree

3 files changed

+35
-36
lines changed

3 files changed

+35
-36
lines changed

.github/workflows/build.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
matrix:
2626
arch:
2727
- x86_64
28-
- aarch64
28+
# - aarch64
2929
version:
3030
- major: 17
3131
full: 17.0.6
@@ -49,11 +49,10 @@ jobs:
4949
- name: Build and push image
5050
uses: docker/[email protected]
5151
with:
52-
context: .
52+
context: manylinux_2_28_${{ matrix.arch }}-llvm
5353
push: true
5454
tags: |
5555
${{ env.REGISTRY }}/${{ github.repository_owner }}/manylinux_2_28_${{ matrix.arch }}-llvm:${{ matrix.version.full }}
5656
${{ env.REGISTRY }}/${{ github.repository_owner }}/manylinux_2_28_${{ matrix.arch }}-llvm:${{ matrix.version.major }}
5757
build-args: |
58-
LLVM_TAG=llvmorg-${{ matrix.version.full }}
59-
ARCH=${{ matrix.arch }}
58+
LLVM_VERSION=${{ matrix.version.full }}

build-images.sh

+10-9
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@ set -eo pipefail
44

55
[[ "$1" == "" ]] && echo "You must specify the LLVM version as an argument, e.g. 17.0.6" && exit
66

7-
LLVM_TAG="$1"
7+
LLVM_VERSION="$1"
8+
LLVM_VERSION_MAJOR="${LLVM_VERSION%%.*}"
89

9-
build_arch () {
10-
ARCH="$1"
10+
build_image () {
11+
IMAGE="$1"; shift
1112
docker build \
12-
--tag "ghcr.io/halide/manylinux_2_28_$ARCH-llvm:$LLVM_TAG" \
13-
--build-arg "LLVM_TAG=llvmorg-$LLVM_TAG" \
14-
--build-arg "ARCH=$ARCH" \
15-
.
13+
--tag "ghcr.io/halide/$IMAGE:$LLVM_VERSION" \
14+
--tag "ghcr.io/halide/$IMAGE:$LLVM_VERSION_MAJOR" \
15+
--build-arg "LLVM_VERSION=$LLVM_VERSION" \
16+
"$@" \
17+
"$IMAGE"
1618
}
1719

18-
build_arch aarch64
19-
build_arch x86_64
20+
build_image manylinux_2_28_x86_64-llvm
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,30 @@
1-
ARG ARCH=x86_64
2-
FROM messense/manylinux_2_28-cross:$ARCH
3-
4-
LABEL org.opencontainers.image.source=https://github.com/halide/docker-images
1+
FROM quay.io/pypa/manylinux_2_28_x86_64 AS base
52

63
WORKDIR /ws
74

8-
## Install Ninja & CMake
9-
RUN apt-get remove -y cmake && \
10-
apt-get -y autoremove && \
11-
python -m pip install ninja==1.11.1.1 cmake==3.28.4
12-
13-
## Set the prefix path to an arch-specific folder
14-
ENV CMAKE_PREFIX_PATH=/usr/local/$CARGO_BUILD_TARGET
5+
## Install Ninja
6+
RUN pipx install ninja==1.11.1.1
157

168
## Install flatbuffers
17-
ARG FB_VERSION=v23.5.26
18-
RUN git clone --depth 1 --branch ${FB_VERSION} https://github.com/google/flatbuffers.git && \
9+
FROM base AS flatbuffers
10+
ARG FB_VERSION=23.5.26
11+
RUN git clone --depth 1 --branch v${FB_VERSION} https://github.com/google/flatbuffers.git && \
1912
cmake -G Ninja -S flatbuffers -B build \
2013
-DCMAKE_BUILD_TYPE=Release \
21-
-DCMAKE_INSTALL_PREFIX=/usr/local/$CARGO_BUILD_TARGET \
22-
-DCMAKE_TOOLCHAIN_FILE=$TARGET_CMAKE_TOOLCHAIN_FILE_PATH \
14+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
2315
-DFLATBUFFERS_BUILD_TESTS=OFF \
2416
&& \
2517
cmake --build build --target install && \
2618
rm -rf flatbuffers build
2719

2820
## Install flatbuffers
21+
FROM base AS wabt
2922
ARG WABT_VERSION=1.0.36
3023
RUN git clone --depth 1 --branch ${WABT_VERSION} https://github.com/WebAssembly/wabt.git && \
3124
git -C wabt submodule update --init third_party/picosha2 && \
3225
cmake -G Ninja -S wabt -B build \
3326
-DCMAKE_BUILD_TYPE=Release \
34-
-DCMAKE_INSTALL_PREFIX=/usr/local/$CARGO_BUILD_TARGET \
35-
-DCMAKE_TOOLCHAIN_FILE=$TARGET_CMAKE_TOOLCHAIN_FILE_PATH \
27+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
3628
-DWITH_EXCEPTIONS=ON \
3729
-DBUILD_TESTS=OFF \
3830
-DBUILD_TOOLS=OFF \
@@ -43,15 +35,14 @@ RUN git clone --depth 1 --branch ${WABT_VERSION} https://github.com/WebAssembly/
4335
rm -rf wabt build
4436

4537
# Install LLVM
46-
ARG LLVM_TAG=llvmorg-18.1.8
47-
RUN git clone --depth 1 --branch ${LLVM_TAG} https://github.com/llvm/llvm-project.git && \
38+
FROM base AS llvm
39+
ARG LLVM_VERSION=18.1.8
40+
RUN git clone --depth 1 --branch llvmorg-${LLVM_VERSION} https://github.com/llvm/llvm-project.git && \
4841
cmake -G Ninja -S llvm-project/llvm -B build \
4942
"-DLLVM_ENABLE_PROJECTS=clang;lld" \
5043
"-DLLVM_ENABLE_RUNTIMES=compiler-rt" \
5144
"-DLLVM_TARGETS_TO_BUILD=WebAssembly;X86;AArch64;ARM;Hexagon;NVPTX;PowerPC;RISCV" \
5245
-DCMAKE_BUILD_TYPE=Release \
53-
-DCMAKE_INSTALL_PREFIX=/usr/local/$CARGO_BUILD_TARGET \
54-
-DCMAKE_TOOLCHAIN_FILE=$TARGET_CMAKE_TOOLCHAIN_FILE_PATH \
5546
-DLLVM_BUILD_32_BITS=OFF \
5647
-DLLVM_ENABLE_ASSERTIONS=ON \
5748
-DLLVM_ENABLE_BINDINGS=OFF \
@@ -75,6 +66,14 @@ RUN git clone --depth 1 --branch ${LLVM_TAG} https://github.com/llvm/llvm-projec
7566
cmake --build build --target install && \
7667
rm -rf llvm-project build
7768

78-
# Configure qemu
79-
ENV QEMU_LD_PREFIX=$TARGET_SYSROOT
69+
##
70+
# Graft the final build products into a quay-derived manylinux image
71+
72+
FROM base
73+
74+
LABEL org.opencontainers.image.source=https://github.com/halide/docker-images
75+
76+
COPY --from=llvm /usr/local /usr/local
77+
COPY --from=wabt /usr/local /usr/local
78+
COPY --from=flatbuffers /usr/local /usr/local
8079

0 commit comments

Comments
 (0)