Skip to content

Commit 72e1ea4

Browse files
committed
feat: updated docker image and fixed srcml tests.
1 parent 788d492 commit 72e1ea4

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

core/src/main/java/com/github/gumtreediff/gen/ExternalProcessTreeGenerator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.nio.charset.Charset;
2424
import java.nio.charset.StandardCharsets;
2525
import java.nio.file.Files;
26+
import java.util.Arrays;
2627

2728
public abstract class ExternalProcessTreeGenerator extends TreeGenerator {
2829

@@ -52,7 +53,7 @@ public String readStandardOutput(Reader r) throws IOException {
5253
}
5354

5455
private File dumpReaderInTempFile(Reader r) throws IOException {
55-
File f = File.createTempFile("gumtree", "");
56+
File f = File.createTempFile("gumtree", ".txt");
5657
try (
5758
Writer w = Files.newBufferedWriter(f.toPath(), Charset.forName("UTF-8"))
5859
) {

docker/Dockerfile

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
1-
FROM ubuntu:focal
1+
FROM ubuntu:noble
22

33
ARG DEBIAN_FRONTEND=noninteractive
44
ENV TZ=GMT
55

66
# Install all required packages
77
RUN apt-get update \
88
&& apt-get install -y --no-install-recommends openjdk-17-jdk wget git gdebi-core \
9-
build-essential ocaml libnum-ocaml-dev python3-pip python3-dev nodejs npm \
9+
build-essential ocaml libnum-ocaml-dev \
10+
python3-dev nodejs npm python3-venv \
1011
tzdata ca-certificates p11-kit
1112

12-
RUN pip3 install pandas plotnine scipy jupyter
13+
RUN python3 -m venv /opt/venv
14+
15+
ENV PATH="/opt/venv/bin:$PATH"
16+
17+
RUN pip install pandas plotnine scipy jupyter
1318

1419
# Set locale
1520
ENV LANG=C.UTF-8
1621

22+
ARG TARGETARCH
23+
1724
# Install srcML
18-
RUN wget https://github.com/srcML/srcML/releases/download/v1.0.0/srcml_1.0.0-1_ubuntu20.04.deb \
19-
&& gdebi srcml_1.0.0-1_ubuntu20.04.deb -n
25+
RUN if [ "${TARGETARCH}" = "arm64" ]; then \
26+
wget https://github.com/srcML/srcML/releases/download/v1.1.0/srcml_1.1.0-1_ubuntu24.10_arm64.deb && \
27+
gdebi srcml_1.1.0-1_ubuntu24.10_arm64.deb -n; \
28+
else \
29+
wget https://github.com/srcML/srcML/releases/download/v1.1.0/srcml_1.1.0-1_ubuntu24.04_amd64.deb && \
30+
gdebi srcml_1.1.0-1_ubuntu24.04_amd64.deb -n; \
31+
fi
2032

2133
# Install cgum
2234
RUN git clone https://github.com/GumTreeDiff/cgum.git /opt/cgum --depth 1 \

gen.srcml/src/main/java/com/github/gumtreediff/gen/srcml/AbstractSrcmlTreeGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,6 @@ private void setLength(Tree t, StartElement e) {
163163
public abstract String getLanguage();
164164

165165
public String[] getCommandLine(String file) {
166-
return new String[]{SRCML_CMD, "-l", getLanguage(), "--position", file, "--tabs=1"};
166+
return new String[]{SRCML_CMD, "--register-ext", "txt=" + getLanguage(), "--position", file, "--tabs=1"};
167167
}
168168
}

0 commit comments

Comments
 (0)