Skip to content

Commit 65449ba

Browse files
mattgodboltclaude
andcommitted
Fix hylo trunk build with Swift 6.2 and LLVM 20 upgrade
Updates dependencies to match hylo trunk requirements (Swift 6.2, LLVM 20, Ubuntu 22.04) and works around the removal of Swifty-LLVM's make-pkgconfig.sh script by generating llvm.pc locally via PKG_CONFIG_PATH. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent f0e3576 commit 65449ba

File tree

2 files changed

+31
-12
lines changed

2 files changed

+31
-12
lines changed

Dockerfile.hylo

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:22.04
22

33
ARG DEBIAN_FRONTEND=noninteractive
44

@@ -8,27 +8,27 @@ RUN apt-get install -y -q \
88
curl \
99
git \
1010
patchelf \
11-
python3.9 \
12-
python3.9-venv \
11+
python3.10 \
12+
python3.10-venv \
1313
python3-pip \
1414
ssh \
1515
wget \
1616
software-properties-common
1717

1818
RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
19-
RUN apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main"
19+
RUN apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-20 main"
2020
RUN apt-get update -y -q
2121

2222
RUN apt-get install -y -q \
23-
libllvm15 \
24-
llvm-15 \
25-
llvm-15-dev \
26-
llvm-15-runtime \
23+
libllvm20 \
24+
llvm-20 \
25+
llvm-20-dev \
26+
llvm-20-runtime \
2727
pkg-config \
2828
libzstd-dev
2929
# zstd
3030

31-
RUN ln -s /usr/bin/llvm-config-15 /usr/bin/llvm-config
31+
RUN ln -s /usr/bin/llvm-config-20 /usr/bin/llvm-config
3232

3333
RUN mkdir -p /opt/compiler-explorer
3434
RUN mkdir /root/.ssh \
@@ -37,8 +37,8 @@ RUN mkdir /root/.ssh \
3737
RUN git clone https://github.com/compiler-explorer/infra /opt/compiler-explorer/infra
3838

3939
RUN cd /opt/compiler-explorer/infra && make ce
40-
RUN /opt/compiler-explorer/infra/bin/ce_install install 'swift 5.10'
41-
ENV PATH="${PATH}:/opt/compiler-explorer/swift-5.10/usr/bin"
40+
RUN /opt/compiler-explorer/infra/bin/ce_install install 'swift 6.2'
41+
ENV PATH="${PATH}:/opt/compiler-explorer/swift-6.2/usr/bin"
4242

4343
RUN mkdir -p /root
4444
COPY hylo /root/

hylo/build.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,26 @@ git clone -q --depth 1 --single-branch --recursive -b "${BRANCH}" "${URL}" "hylo
3737

3838
cd "hylo-${VERSION}"
3939
swift package resolve
40-
.build/checkouts/Swifty-LLVM/Tools/make-pkgconfig.sh /usr/local/lib/pkgconfig/llvm.pc
40+
41+
# Create LLVM pkgconfig file locally since Swifty-LLVM no longer provides the script
42+
# Use PKG_CONFIG_PATH to avoid system-level changes
43+
PKGCONFIG_DIR="${ROOT}/pkgconfig"
44+
mkdir -p "${PKGCONFIG_DIR}"
45+
cat > "${PKGCONFIG_DIR}/llvm.pc" << EOF
46+
prefix=$(llvm-config --prefix)
47+
libdir=$(llvm-config --libdir)
48+
includedir=$(llvm-config --includedir)
49+
50+
Name: LLVM
51+
Description: Low Level Virtual Machine
52+
Version: $(llvm-config --version)
53+
Requires:
54+
Libs: -L\${libdir} $(llvm-config --libs --system-libs)
55+
Cflags: -I\${includedir}
56+
EOF
57+
58+
export PKG_CONFIG_PATH="${PKGCONFIG_DIR}:${PKG_CONFIG_PATH:-}"
59+
4160
./Tools/set-hc-version.sh
4261
swift build --static-swift-stdlib -c release --product hc
4362

0 commit comments

Comments
 (0)