|
| 1 | +FROM ubuntu:22.04 |
| 2 | + |
| 3 | +WORKDIR /build |
| 4 | + |
| 5 | +ARG DEBIAN_FRONTEND=noninteractive |
| 6 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 7 | + ca-certificates \ |
| 8 | + cmake \ |
| 9 | + curl \ |
| 10 | + g++ \ |
| 11 | + git \ |
| 12 | + make \ |
| 13 | + ninja-build \ |
| 14 | + python3 \ |
| 15 | + xz-utils |
| 16 | + |
| 17 | +COPY host-x86_64/dist-windows-gnullvm/install-llvm-mingw.sh /build |
| 18 | +RUN ./install-llvm-mingw.sh |
| 19 | + |
| 20 | +COPY scripts/sccache.sh /scripts/ |
| 21 | +RUN sh /scripts/sccache.sh |
| 22 | + |
| 23 | +ENV CC_aarch64_pc_windows_gnullvm=aarch64-w64-mingw32-clang \ |
| 24 | + CXX_aarch64_pc_windows_gnullvm=aarch64-w64-mingw32-clang++ \ |
| 25 | + CC_i686_pc_windows_gnullvm=i686-w64-mingw32-clang \ |
| 26 | + CC_x86_64_pc_windows_gnullvm=x86_64-w64-mingw32-clang \ |
| 27 | + CXX_x86_64_pc_windows_gnullvm=x86_64-w64-mingw32-clang++ |
| 28 | + |
| 29 | +ENV HOSTS=aarch64-pc-windows-gnullvm,x86_64-pc-windows-gnullvm |
| 30 | +ENV TARGETS=aarch64-pc-windows-gnullvm,i686-pc-windows-gnullvm,x86_64-pc-windows-gnullvm |
| 31 | + |
| 32 | +# We are bootstrapping this target and cannot use previously built artifacts. |
| 33 | +# Without this option Clang is given `"-I/checkout/obj/build/aarch64-pc-windows-gnullvm/ci-llvm/include"` |
| 34 | +# despite no such directory existing: |
| 35 | +# ❯ ls obj/dist-windows-gnullvm/build/aarch64-pc-windows-gnullvm/ -1 |
| 36 | +# llvm |
| 37 | +# stage2 |
| 38 | +ENV NO_DOWNLOAD_CI_LLVM 1 |
| 39 | + |
| 40 | +ENV RUST_CONFIGURE_ARGS \ |
| 41 | + --enable-extended \ |
| 42 | + --enable-profiler \ |
| 43 | + --enable-sanitizers \ |
| 44 | + --disable-docs \ |
| 45 | + --set llvm.download-ci-llvm=false \ |
| 46 | + --set rust.llvm-tools=false |
| 47 | +# LLVM cross tools are not installed into expected location so copying fails. |
| 48 | +# Probably will solve itself when building from Windows. |
| 49 | +# --enable-full-tools \ |
| 50 | + |
| 51 | +ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $TARGETS |
0 commit comments