-
Notifications
You must be signed in to change notification settings - Fork 172
Expand file tree
/
Copy pathDockerfile.test
More file actions
94 lines (76 loc) · 3.1 KB
/
Dockerfile.test
File metadata and controls
94 lines (76 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
FROM rust:bookworm AS rust
RUN apt-get update && \
apt-get install -y --no-install-recommends \
clang && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# FIXME: Do not hard-code the version.
RUN cargo install --locked tree-sitter-cli@0.26.7
# -----------------------------------------------------------------------------
FROM haskell:9.12.2-bookworm
# Note: Do NOT hard-code package versions. They may get upgraded sometimes.
RUN apt-get update && \
apt-get -y install --no-install-recommends \
locales \
flex \
bison \
openjdk-17-jdk \
jflex \
antlr4 \
build-essential \
ocaml \
menhir \
doctest \
python3-pygments \
python3-setuptools \
virtualenv \
python3-venv \
nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN locale-gen C.UTF-8
ENV LANG=C.UTF-8
# FIXME: Do not hard-code the version for the following tools.
RUN cabal update
RUN cabal install alex-3.5.4.0 happy-2.2
RUN curl -OL https://github.com/agda/agda/releases/download/v2.8.0/Agda-v2.8.0-linux.tar.xz && \
tar xf Agda-v2.8.0-linux.tar.xz && \
mv agda /usr/bin/agda && \
rm -rf Agda-v2.8.0-linux.tar.xz
RUN curl -OL https://github.com/ndmitchell/hlint/releases/download/v3.10/hlint-3.10-x86_64-linux.tar.gz && \
tar xf hlint-3.10-x86_64-linux.tar.gz && \
mv hlint-3.10/hlint /usr/bin/hlint && \
rm -rf hlint-3.10 && \
rm -rf hlint-3.10-x86_64-linux.tar.gz
# Note: Recent `tree-sitter-cli` requires libc6>=2.39, while
# this image is based on 2.36, see https://hub.docker.com/_/haskell/.
# v0.24.7 seems to be the newest version supporting libc6-2.36.
# And we rely on some recent features of `tree-sitter-cli` (like `--cst` and
# parsing from stdin), that is why we build from source.
#
# If a newer `haskell` image with higher `libc6` version is published
# in the future, this may be replaced by directly downloading the pre-built
# binary like the commented following snippet (and remove the `rust` builder).
# RUN curl -OL https://github.com/tree-sitter/tree-sitter/releases/download/v0.24.7/tree-sitter-linux-x64.gz && \
# gzip -d tree-sitter-linux-x64.gz && \
# chmod +x tree-sitter-linux-x64 && \
# mv tree-sitter-linux-x64 /usr/bin/tree-sitter && \
# rm -rf tree-sitter-linux-x64.gz
COPY --from=rust /usr/local/cargo/bin/tree-sitter /usr/bin/tree-sitter
ENV CLASSPATH /bnfc/testing/data/JLex-1.2.6.jar:$CLASSPATH
ENV CLASSPATH /bnfc/testing/data/java-cup-11b.jar:$CLASSPATH
ENV CLASSPATH /bnfc/testing/data/java-cup-11b-runtime.jar:$CLASSPATH
ENV CLASSPATH /usr/share/java/jflex.jar:$CLASSPATH
ENV CLASSPATH /usr/share/java/stringtemplate4.jar:/usr/share/java/antlr4.jar:/usr/share/java/antlr4-runtime.jar:/usr/share/java/antlr3-runtime.jar/:/usr/share/java/treelayout.jar:$CLASSPATH
RUN mkdir -p /bnfc
WORKDIR /bnfc
COPY cabal.project /bnfc/cabal.project
COPY examples /bnfc/examples
COPY source /bnfc/source
COPY testing /bnfc/testing
WORKDIR /bnfc/source
RUN make test && \
make install
WORKDIR /bnfc/testing
RUN make build
CMD make test