From c422199fb59a3e287e151a9e467663191ce5db89 Mon Sep 17 00:00:00 2001 From: Ostrzyciel Date: Sun, 14 Sep 2025 12:18:53 +0200 Subject: [PATCH] Fix reporting XML parse errors in AoT builds Closes #217 Surprisingly, there is no appreciable difference in the binary size. I'm not complaining! --- .github/workflows/aot-test.yml | 6 ++++++ build.sbt | 3 +++ 2 files changed, 9 insertions(+) diff --git a/.github/workflows/aot-test.yml b/.github/workflows/aot-test.yml index f5ec8dd..259ece4 100644 --- a/.github/workflows/aot-test.yml +++ b/.github/workflows/aot-test.yml @@ -58,6 +58,12 @@ jobs: target/graalvm-native-image/jelly-cli rdf to-jelly --in-format "rdfxml" > rdfxml.jelly && \ [ -s rdfxml.jelly ] + # Invalid RDF/XMl input test + # Regression test for: https://github.com/Jelly-RDF/cli/issues/217 + echo 'invalidxml' | \ + ( ! target/graalvm-native-image/jelly-cli rdf to-jelly --in-format "rdfxml" &> error.txt ) && \ + grep 'Content is not allowed in prolog' error.txt + # Test rdf validate target/graalvm-native-image/jelly-cli \ rdf validate out.jelly --compare-to-rdf-file in.nt diff --git a/build.sbt b/build.sbt index efdbdbb..1354bb4 100644 --- a/build.sbt +++ b/build.sbt @@ -36,6 +36,9 @@ lazy val graalOptions = Seq( "-H:+UsePredicates", // SkipFlow optimization -- will be default in GraalVM 25 // Make sure we don't include stuff that should be unreachable in the native image "-H:AbortOnMethodReachable=*UUID.randomUUID*", + // Include XML error messages + // Issue: https://github.com/Jelly-RDF/cli/issues/217 + "-H:IncludeResourceBundles=com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", ) lazy val TestSerial = config("test-serial") extend Test