Skip to content

Commit 28abe18

Browse files
authored
Add Ubuntu 24.04 to Docker tests (#142)
* Add Ubuntu 24.04 to Docker tests * Don't obscure underlying cause of invalid library path exception * Bump to 1.5.2
1 parent af9ce66 commit 28abe18

File tree

7 files changed

+33
-14
lines changed

7 files changed

+33
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ repositories {
2323
}
2424

2525
dependencies {
26-
implementation("app.photofox.vips-ffm:vips-ffm-core:1.5.1")
26+
implementation("app.photofox.vips-ffm:vips-ffm-core:1.5.2")
2727
}
2828
```
2929
When running your project you must add `--enable-native-access=ALL-UNNAMED` to your JVM runtime arguments. If you

core/src/main/java/app/photofox/vipsffm/VipsLibLookup.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,18 @@ private static Optional<SymbolLookup> makeOptionalLibraryLookup(String libraryNa
101101
try {
102102
symbolLookup = SymbolLookup.libraryLookup(Path.of(path), arena);
103103
} catch (IllegalArgumentException exception) {
104-
throw makeOverriddenPathMissingException(libraryName, path);
104+
throw makeLibraryAtPathNotValidException(libraryName, path, exception);
105105
}
106106
return symbolLookup;
107107
});
108108
}
109109

110-
private static IllegalArgumentException makeOverriddenPathMissingException(
110+
private static IllegalArgumentException makeLibraryAtPathNotValidException(
111111
String libraryName,
112-
String overridePath
112+
String overridePath,
113+
Throwable cause
113114
) {
114-
var message = "path override requested for %s, but library not found at path: %s".formatted(libraryName, overridePath);
115-
return new IllegalArgumentException(message);
115+
var message = "path override requested for %s, but library not valid at path: %s".formatted(libraryName, overridePath);
116+
return new IllegalArgumentException(message, cause);
116117
}
117118
}

docker_tests/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
*/sample/*
2-
*/sample/run_samples.sh
2+
*/run_samples.sh

docker_tests/debian-12/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ COPY sample /opt/sample
77
COPY run_samples.sh /opt/run_samples.sh
88

99
RUN apt update && apt install libvips-dev -y
10+
RUN vips --version
1011

1112
WORKDIR /opt
1213
CMD ./run_samples.sh

docker_tests/ubuntu-2404/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM ubuntu:24.04
2+
ENV JAVA_HOME=/opt/java/openjdk
3+
COPY --from=eclipse-temurin:22 $JAVA_HOME $JAVA_HOME
4+
ENV PATH="${JAVA_HOME}/bin:${PATH}"
5+
6+
COPY sample /opt/sample
7+
COPY run_samples.sh /opt/run_samples.sh
8+
9+
RUN apt update && apt install libvips-dev -y
10+
RUN vips --version
11+
12+
WORKDIR /opt
13+
CMD ./run_samples.sh

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ <h2 id="usage-heading">Usage</h2>
7070
}
7171

7272
dependencies {
73-
implementation(&quot;app.photofox.vips-ffm:vips-ffm-core:1.5.1&quot;)
73+
implementation(&quot;app.photofox.vips-ffm:vips-ffm-core:1.5.2&quot;)
7474
}
7575
</code></pre>
7676
<p>When running your project you must add <code>--enable-native-access=ALL-UNNAMED</code> to your JVM runtime arguments. If you

run_docker_tests.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ echo "building samples..."
77
echo "running docker tests..."
88
WORKSPACE_DIR="$PWD"
99

10-
pushd docker_tests/debian-12
11-
cp -r "$WORKSPACE_DIR"/sample .
12-
cp "$WORKSPACE_DIR"/run_samples.sh .
13-
docker build -t vips-ffm-debian-test .
14-
docker run vips-ffm-debian-test
15-
popd
10+
docker_tests=("debian-12" "ubuntu-2404")
11+
for docker_test in "${docker_tests[@]}"; do
12+
echo "testing \"$docker_test\""
13+
pushd "docker_tests/$docker_test"
14+
cp -r "$WORKSPACE_DIR"/sample .
15+
cp "$WORKSPACE_DIR"/run_samples.sh .
16+
docker build -t "vips-ffm-$docker_test-test" .
17+
docker run "vips-ffm-$docker_test-test"
18+
popd
19+
done

0 commit comments

Comments
 (0)