Skip to content

Commit 617e4ba

Browse files
committed
Upgrade to LLVM 21 + fix Molasses compatibility
- Upgrade to LLVM version 21 (not available by default in Ubuntu 22.04's apt repos) - Molasses was recently patched to account for a change to smlnj. The patch is not compatible with our version, so we need to use an older version of Molasses. See comments in Dockerfile for details
1 parent 9ef7341 commit 617e4ba

1 file changed

Lines changed: 32 additions & 3 deletions

File tree

Dockerfile

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,42 @@ WORKDIR /autograder
2222
# Common Package Installation
2323
#------------------------------
2424
RUN apt-get update && apt-get install -y \
25-
clang \
2625
curl \
2726
g++ \
2827
gcc \
2928
git \
30-
llvm \
3129
make \
3230
python3 \
3331
rlwrap \
3432
sudo \
3533
wget \
34+
gnupg \
35+
software-properties-common lsb-release \
3636
&& rm -rf /var/lib/apt/lists/*
3737

3838

39+
#------------------------------
40+
# Install LLVM version 21
41+
#
42+
# LLVM version 21 isn't available by default in Ubuntu 22.04's apt repos
43+
#------------------------------
44+
RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh \
45+
&& ./llvm.sh 21 && rm llvm.sh \
46+
&& apt-get update && apt-get install -y \
47+
clang-21 \
48+
lldb-21 \
49+
lld-21 \
50+
llvm-21 \
51+
llvm-21-dev \
52+
&& update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-21 100 \
53+
&& update-alternatives --install /usr/bin/llc llc /usr/bin/llc-21 100 \
54+
&& update-alternatives --install /usr/bin/opt opt /usr/bin/opt-21 100 \
55+
&& update-alternatives --install /usr/bin/clang clang /usr/bin/clang-21 100 \
56+
&& update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-21 100 \
57+
&& update-alternatives --install /usr/bin/lld lld /usr/bin/lld-21 100 \
58+
&& update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-21 100
59+
60+
3961
#------------------------------
4062
# C0 Installation
4163
#------------------------------
@@ -79,10 +101,18 @@ RUN apt-get update && apt-get install -y \
79101

80102
#-----------------------
81103
# Molasses Installation
104+
#
105+
# At some point, smlnj changed the type for Compiler.version. Molasses was patched to
106+
# account for this change, but we're still using an older version of smlnj, so we now need
107+
# to use an older version of Molasses
108+
# - smlnj update: https://github.com/T-Brick/molasses/issues/2
109+
# - version we're using:
110+
# https://github.com/T-Brick/molasses/commit/d86c70923cabb39d34d2cc198d80bac248d564f8
82111
#-----------------------
83112
RUN cd /opt && \
84113
git clone --recurse-submodules -j8 https://github.com/T-Brick/molasses && \
85114
cd molasses && \
115+
git reset --hard d86c709 && \
86116
make && \
87117
make repl
88118

@@ -101,5 +131,4 @@ RUN apt-get update && apt-get install -y \
101131
gdb \
102132
python3 \
103133
vim \
104-
lldb \
105134
&& rm -rf /var/lib/apt/lists/*

0 commit comments

Comments
 (0)