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
5
2
6
3
WORKDIR /ws
7
4
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
15
7
16
8
# # 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 && \
19
12
cmake -G Ninja -S flatbuffers -B build \
20
13
-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 \
23
15
-DFLATBUFFERS_BUILD_TESTS=OFF \
24
16
&& \
25
17
cmake --build build --target install && \
26
18
rm -rf flatbuffers build
27
19
28
20
# # Install flatbuffers
21
+ FROM base AS wabt
29
22
ARG WABT_VERSION=1.0.36
30
23
RUN git clone --depth 1 --branch ${WABT_VERSION} https://github.com/WebAssembly/wabt.git && \
31
24
git -C wabt submodule update --init third_party/picosha2 && \
32
25
cmake -G Ninja -S wabt -B build \
33
26
-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 \
36
28
-DWITH_EXCEPTIONS=ON \
37
29
-DBUILD_TESTS=OFF \
38
30
-DBUILD_TOOLS=OFF \
@@ -43,15 +35,14 @@ RUN git clone --depth 1 --branch ${WABT_VERSION} https://github.com/WebAssembly/
43
35
rm -rf wabt build
44
36
45
37
# 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 && \
48
41
cmake -G Ninja -S llvm-project/llvm -B build \
49
42
"-DLLVM_ENABLE_PROJECTS=clang;lld" \
50
43
"-DLLVM_ENABLE_RUNTIMES=compiler-rt" \
51
44
"-DLLVM_TARGETS_TO_BUILD=WebAssembly;X86;AArch64;ARM;Hexagon;NVPTX;PowerPC;RISCV" \
52
45
-DCMAKE_BUILD_TYPE=Release \
53
- -DCMAKE_INSTALL_PREFIX=/usr/local/$CARGO_BUILD_TARGET \
54
- -DCMAKE_TOOLCHAIN_FILE=$TARGET_CMAKE_TOOLCHAIN_FILE_PATH \
55
46
-DLLVM_BUILD_32_BITS=OFF \
56
47
-DLLVM_ENABLE_ASSERTIONS=ON \
57
48
-DLLVM_ENABLE_BINDINGS=OFF \
@@ -75,6 +66,14 @@ RUN git clone --depth 1 --branch ${LLVM_TAG} https://github.com/llvm/llvm-projec
75
66
cmake --build build --target install && \
76
67
rm -rf llvm-project build
77
68
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
80
79
0 commit comments