oracle / graal

GraalVM compiles Java applications into native executables that start instantly, scale fast, and use fewer compute resources 🚀
https://www.graalvm.org
Other
20.24k stars 1.62k forks source link

[GR-30071] Built image can't find included resource #3249

Open marinier opened 3 years ago

marinier commented 3 years ago

Describe the issue I created configuration files for my application via multiple methods, one of which was using the native agent. The agent added many entries to my configuration, including this one in resource-config.json:

    {"pattern":"\\Qtcl/lang/library/init.tcl\\E"}, 

I am able to build the native image (working around various issues, like the one reported in #3246 -- see this commit for what I changed to get things to build). However, when I run the executable, I immediately get an exception that it is unable to find the resource I noted above.

The missing resource is actually coming from a runtime dependency (jsoar-tcl), so I wonder if that has something to do with it? (I tried changing it to a compile-time dependency, but that did not make a difference.)

Steps to reproduce the issue Please include both build steps as well as run steps

  1. git clone --depth 1 --branch graalvm-native-image-missing-resource https://github.com/soartech/jsoar.git
  2. cd jsoar
  3. mvn install
  4. cd jsoar-repl\target
  5. jsoar-repl.exe

Describe GraalVM and your environment: java version "11.0.10" 2021-01-19 LTS Java(TM) SE Runtime Environment GraalVM EE 21.0.0 (build 11.0.10+8-LTS-jvmci-21.0-b06) Java HotSpot(TM) 64-Bit Server VM GraalVM EE 21.0.0 (build 11.0.10+8-LTS-jvmci-21.0-b06, mixed mode, sharing)

OS: Windows 10 (10.0.19042 Build 19042)
Architecture: x64

More details

**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.8.2
** Copyright (c) 2020 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

C:\Users\bob.marinier>cd git

C:\Users\bob.marinier\git>mkdir test

C:\Users\bob.marinier\git>cd test

C:\Users\bob.marinier\git\test>git clone --depth 1 --branch graalvm-native-image-missing-resource https://github.com/soartech/jsoar.git
Cloning into 'jsoar'...
remote: Enumerating objects: 3575, done.
remote: Counting objects: 100% (3575/3575), done.
remote: Compressing objects: 100% (2920/2920), done.
remote: Total 3575 (delta 624), reused 2623 (delta 493), pack-reused 0
Receiving objects: 100% (3575/3575), 3.92 MiB | 13.76 MiB/s, done.
Resolving deltas: 100% (624/624), done.
Note: switching to '0f10945f0c67aa0ce38f19ed973dc7bcf012594e'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

Updating files: 100% (3361/3361), done.

C:\Users\bob.marinier\git\test>cd jsoar

C:\Users\bob.marinier\git\test\jsoar>mvn install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] com.soartech:jsoar                                                 [pom]
[INFO] jsoar-core                                                         [jar]
[INFO] jsoar-tcl                                                          [jar]
[INFO] jsoar-repl                                                         [jar]
[INFO]
[INFO] -------------------------< com.soartech:jsoar >-------------------------
[INFO] Building com.soartech:jsoar 4.0.4-SNAPSHOT                         [1/4]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ jsoar ---
[INFO] Installing C:\Users\bob.marinier\git\test\jsoar\pom.xml to C:\Users\bob.marinier\.m2\repository\com\soartech\jsoar\4.0.4-SNAPSHOT\jsoar-4.0.4-SNAPSHOT.pom
[INFO]
[INFO] ----------------------< com.soartech:jsoar-core >-----------------------
[INFO] Building jsoar-core 4.0.4-SNAPSHOT                                 [2/4]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jsoar-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 17 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ jsoar-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 461 source files to C:\Users\bob.marinier\git\test\jsoar\jsoar-core\target\classes
[INFO] /C:/Users/bob.marinier/git/test/jsoar/jsoar-core/src/main/java/org/jsoar/runtime/TinyDebugger.java: Some input files use or override a deprecated API.
[INFO] /C:/Users/bob.marinier/git/test/jsoar/jsoar-core/src/main/java/org/jsoar/runtime/TinyDebugger.java: Recompile with -Xlint:deprecation for details.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ jsoar-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 173 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ jsoar-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 138 source files to C:\Users\bob.marinier\git\test\jsoar\jsoar-core\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M4:test (default-test) @ jsoar-core ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ jsoar-core ---
[INFO] Building jar: C:\Users\bob.marinier\git\test\jsoar\jsoar-core\target\jsoar-core-4.0.4-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ jsoar-core ---
[INFO] Installing C:\Users\bob.marinier\git\test\jsoar\jsoar-core\target\jsoar-core-4.0.4-SNAPSHOT.jar to C:\Users\bob.marinier\.m2\repository\com\soartech\jsoar-core\4.0.4-SNAPSHOT\jsoar-core-4.0.4-SNAPSHOT.jar
[INFO] Installing C:\Users\bob.marinier\git\test\jsoar\jsoar-core\pom.xml to C:\Users\bob.marinier\.m2\repository\com\soartech\jsoar-core\4.0.4-SNAPSHOT\jsoar-core-4.0.4-SNAPSHOT.pom
[INFO]
[INFO] -----------------------< com.soartech:jsoar-tcl >-----------------------
[INFO] Building jsoar-tcl 4.0.4-SNAPSHOT                                  [3/4]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jsoar-tcl ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ jsoar-tcl ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 5 source files to C:\Users\bob.marinier\git\test\jsoar\jsoar-tcl\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ jsoar-tcl ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ jsoar-tcl ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 6 source files to C:\Users\bob.marinier\git\test\jsoar\jsoar-tcl\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M4:test (default-test) @ jsoar-tcl ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ jsoar-tcl ---
[INFO] Building jar: C:\Users\bob.marinier\git\test\jsoar\jsoar-tcl\target\jsoar-tcl-4.0.4-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ jsoar-tcl ---
[INFO] Installing C:\Users\bob.marinier\git\test\jsoar\jsoar-tcl\target\jsoar-tcl-4.0.4-SNAPSHOT.jar to C:\Users\bob.marinier\.m2\repository\com\soartech\jsoar-tcl\4.0.4-SNAPSHOT\jsoar-tcl-4.0.4-SNAPSHOT.jar
[INFO] Installing C:\Users\bob.marinier\git\test\jsoar\jsoar-tcl\pom.xml to C:\Users\bob.marinier\.m2\repository\com\soartech\jsoar-tcl\4.0.4-SNAPSHOT\jsoar-tcl-4.0.4-SNAPSHOT.pom
[INFO]
[INFO] ----------------------< com.soartech:jsoar-repl >-----------------------
[INFO] Building jsoar-repl 4.0.4-SNAPSHOT                                 [4/4]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jsoar-repl ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ jsoar-repl ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\Users\bob.marinier\git\test\jsoar\jsoar-repl\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ jsoar-repl ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\bob.marinier\git\test\jsoar\jsoar-repl\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ jsoar-repl ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M4:test (default-test) @ jsoar-repl ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ jsoar-repl ---
[INFO] Building jar: C:\Users\bob.marinier\git\test\jsoar\jsoar-repl\target\jsoar-repl-4.0.4-SNAPSHOT.jar
[INFO]
[INFO] --- native-image-maven-plugin:21.0.0:native-image (default) @ jsoar-repl ---
[INFO] ImageClasspath Entry: com.soartech:jsoar-core:jar:4.0.4-SNAPSHOT:compile (file:///C:/Users/bob.marinier/git/test/jsoar/jsoar-core/target/jsoar-core-4.0.4-SNAPSHOT.jar)
[INFO] ImageClasspath Entry: commons-beanutils:commons-beanutils:jar:1.9.4:compile (file:///C:/Users/bob.marinier/.m2/repository/commons-beanutils/commons-beanutils/1.9.4/commons-beanutils-1.9.4.jar)
[INFO] ImageClasspath Entry: commons-collections:commons-collections:jar:3.2.2:compile (file:///C:/Users/bob.marinier/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar)
[INFO] ImageClasspath Entry: org.xerial:sqlite-jdbc:jar:3.34.0:compile (file:///C:/Users/bob.marinier/.m2/repository/org/xerial/sqlite-jdbc/3.34.0/sqlite-jdbc-3.34.0.jar)
[INFO] ImageClasspath Entry: org.slf4j:jcl-over-slf4j:jar:1.7.30:compile (file:///C:/Users/bob.marinier/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.30/jcl-over-slf4j-1.7.30.jar)
[INFO] ImageClasspath Entry: org.apache.commons:commons-math3:jar:3.6.1:compile (file:///C:/Users/bob.marinier/.m2/repository/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar)
[INFO] ImageClasspath Entry: com.github.cliftonlabs:json-simple:jar:3.1.1:compile (file:///C:/Users/bob.marinier/.m2/repository/com/github/cliftonlabs/json-simple/3.1.1/json-simple-3.1.1.jar)
[INFO] ImageClasspath Entry: org.springframework:spring-core:jar:5.3.3:compile (file:///C:/Users/bob.marinier/.m2/repository/org/springframework/spring-core/5.3.3/spring-core-5.3.3.jar)
[INFO] ImageClasspath Entry: org.springframework:spring-jcl:jar:5.3.3:compile (file:///C:/Users/bob.marinier/.m2/repository/org/springframework/spring-jcl/5.3.3/spring-jcl-5.3.3.jar)
[INFO] ImageClasspath Entry: info.picocli:picocli:jar:4.6.1:compile (file:///C:/Users/bob.marinier/.m2/repository/info/picocli/picocli/4.6.1/picocli-4.6.1.jar)
[INFO] ImageClasspath Entry: commons-io:commons-io:jar:2.8.0:compile (file:///C:/Users/bob.marinier/.m2/repository/commons-io/commons-io/2.8.0/commons-io-2.8.0.jar)
[INFO] ImageClasspath Entry: org.graalvm.js:js:jar:21.0.0:runtime (file:///C:/Users/bob.marinier/.m2/repository/org/graalvm/js/js/21.0.0/js-21.0.0.jar)
[INFO] ImageClasspath Entry: org.graalvm.regex:regex:jar:21.0.0:runtime (file:///C:/Users/bob.marinier/.m2/repository/org/graalvm/regex/regex/21.0.0/regex-21.0.0.jar)
[INFO] ImageClasspath Entry: org.graalvm.truffle:truffle-api:jar:21.0.0:runtime (file:///C:/Users/bob.marinier/.m2/repository/org/graalvm/truffle/truffle-api/21.0.0/truffle-api-21.0.0.jar)
[INFO] ImageClasspath Entry: org.graalvm.sdk:graal-sdk:jar:21.0.0:runtime (file:///C:/Users/bob.marinier/.m2/repository/org/graalvm/sdk/graal-sdk/21.0.0/graal-sdk-21.0.0.jar)
[WARNING] jar:file:///C:/Users/bob.marinier/.m2/repository/org/graalvm/sdk/graal-sdk/21.0.0/graal-sdk-21.0.0.jar!/META-INF/native-image/org.graalvm.polyglot/native-image.properties does not match recommended META-INF/native-image/${groupId}/${artifactId}/native-image.properties layout.
[WARNING] jar:file:///C:/Users/bob.marinier/.m2/repository/org/graalvm/sdk/graal-sdk/21.0.0/graal-sdk-21.0.0.jar!/META-INF/native-image/org.graalvm.home/native-image.properties does not match recommended META-INF/native-image/${groupId}/${artifactId}/native-image.properties layout.
[INFO] ImageClasspath Entry: com.ibm.icu:icu4j:jar:67.1:runtime (file:///C:/Users/bob.marinier/.m2/repository/com/ibm/icu/icu4j/67.1/icu4j-67.1.jar)
[INFO] ImageClasspath Entry: org.graalvm.js:js-scriptengine:jar:21.0.0:runtime (file:///C:/Users/bob.marinier/.m2/repository/org/graalvm/js/js-scriptengine/21.0.0/js-scriptengine-21.0.0.jar)
[INFO] ImageClasspath Entry: com.soartech:jsoar-tcl:jar:4.0.4-SNAPSHOT:runtime (file:///C:/Users/bob.marinier/git/test/jsoar/jsoar-tcl/target/jsoar-tcl-4.0.4-SNAPSHOT.jar)
[INFO] ImageClasspath Entry: com.github.dronox:jtcl:jar:2.9.4:runtime (file:///C:/Users/bob.marinier/.m2/repository/com/github/dronox/jtcl/2.9.4/jtcl-2.9.4.jar)
[INFO] ImageClasspath Entry: org.scala-lang:scala-library:jar:2.12.7:runtime (file:///C:/Users/bob.marinier/.m2/repository/org/scala-lang/scala-library/2.12.7/scala-library-2.12.7.jar)
[INFO] ImageClasspath Entry: org.codehaus.janino:janino:jar:3.0.11:runtime (file:///C:/Users/bob.marinier/.m2/repository/org/codehaus/janino/janino/3.0.11/janino-3.0.11.jar)
[INFO] ImageClasspath Entry: org.codehaus.janino:commons-compiler:jar:3.0.11:runtime (file:///C:/Users/bob.marinier/.m2/repository/org/codehaus/janino/commons-compiler/3.0.11/commons-compiler-3.0.11.jar)
[INFO] ImageClasspath Entry: com.google.guava:guava:jar:30.1-jre:compile (file:///C:/Users/bob.marinier/.m2/repository/com/google/guava/guava/30.1-jre/guava-30.1-jre.jar)
[INFO] ImageClasspath Entry: com.google.guava:failureaccess:jar:1.0.1:compile (file:///C:/Users/bob.marinier/.m2/repository/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar)
[INFO] ImageClasspath Entry: com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile (file:///C:/Users/bob.marinier/.m2/repository/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar)
[INFO] ImageClasspath Entry: com.google.code.findbugs:jsr305:jar:3.0.2:compile (file:///C:/Users/bob.marinier/.m2/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar)
[INFO] ImageClasspath Entry: org.checkerframework:checker-qual:jar:3.5.0:compile (file:///C:/Users/bob.marinier/.m2/repository/org/checkerframework/checker-qual/3.5.0/checker-qual-3.5.0.jar)
[INFO] ImageClasspath Entry: com.google.errorprone:error_prone_annotations:jar:2.3.4:compile (file:///C:/Users/bob.marinier/.m2/repository/com/google/errorprone/error_prone_annotations/2.3.4/error_prone_annotations-2.3.4.jar)
[INFO] ImageClasspath Entry: com.google.j2objc:j2objc-annotations:jar:1.3:compile (file:///C:/Users/bob.marinier/.m2/repository/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar)
[INFO] ImageClasspath Entry: org.slf4j:slf4j-api:jar:1.7.30:compile (file:///C:/Users/bob.marinier/.m2/repository/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar)
[INFO] ImageClasspath Entry: com.soartech:jsoar-repl:jar:4.0.4-SNAPSHOT (file:///C:/Users/bob.marinier/git/test/jsoar/jsoar-repl/target/jsoar-repl-4.0.4-SNAPSHOT.jar)
[INFO] Executing: C:\Users\bob.marinier\graalvm-ee-java11-21.0.0\lib\svm\bin\native-image.exe -cp C:\Users\bob.marinier\git\test\jsoar\jsoar-core\target\jsoar-core-4.0.4-SNAPSHOT.jar;C:\Users\bob.marinier\.m2\repository\commons-beanutils\commons-beanutils\1.9.4\commons-beanutils-1.9.4.jar;C:\Users\bob.marinier\.m2\repository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;C:\Users\bob.marinier\.m2\repository\org\xerial\sqlite-jdbc\3.34.0\sqlite-jdbc-3.34.0.jar;C:\Users\bob.marinier\.m2\repository\org\slf4j\jcl-over-slf4j\1.7.30\jcl-over-slf4j-1.7.30.jar;C:\Users\bob.marinier\.m2\repository\org\apache\commons\commons-math3\3.6.1\commons-math3-3.6.1.jar;C:\Users\bob.marinier\.m2\repository\com\github\cliftonlabs\json-simple\3.1.1\json-simple-3.1.1.jar;C:\Users\bob.marinier\.m2\repository\org\springframework\spring-core\5.3.3\spring-core-5.3.3.jar;C:\Users\bob.marinier\.m2\repository\org\springframework\spring-jcl\5.3.3\spring-jcl-5.3.3.jar;C:\Users\bob.marinier\.m2\repository\info\picocli\picocli\4.6.1\picocli-4.6.1.jar;C:\Users\bob.marinier\.m2\repository\commons-io\commons-io\2.8.0\commons-io-2.8.0.jar;C:\Users\bob.marinier\.m2\repository\org\graalvm\js\js\21.0.0\js-21.0.0.jar;C:\Users\bob.marinier\.m2\repository\org\graalvm\regex\regex\21.0.0\regex-21.0.0.jar;C:\Users\bob.marinier\.m2\repository\org\graalvm\truffle\truffle-api\21.0.0\truffle-api-21.0.0.jar;C:\Users\bob.marinier\.m2\repository\org\graalvm\sdk\graal-sdk\21.0.0\graal-sdk-21.0.0.jar;C:\Users\bob.marinier\.m2\repository\com\ibm\icu\icu4j\67.1\icu4j-67.1.jar;C:\Users\bob.marinier\.m2\repository\org\graalvm\js\js-scriptengine\21.0.0\js-scriptengine-21.0.0.jar;C:\Users\bob.marinier\git\test\jsoar\jsoar-tcl\target\jsoar-tcl-4.0.4-SNAPSHOT.jar;C:\Users\bob.marinier\.m2\repository\com\github\dronox\jtcl\2.9.4\jtcl-2.9.4.jar;C:\Users\bob.marinier\.m2\repository\org\scala-lang\scala-library\2.12.7\scala-library-2.12.7.jar;C:\Users\bob.marinier\.m2\repository\org\codehaus\janino\janino\3.0.11\janino-3.0.11.jar;C:\Users\bob.marinier\.m2\repository\org\codehaus\janino\commons-compiler\3.0.11\commons-compiler-3.0.11.jar;C:\Users\bob.marinier\.m2\repository\com\google\guava\guava\30.1-jre\guava-30.1-jre.jar;C:\Users\bob.marinier\.m2\repository\com\google\guava\failureaccess\1.0.1\failureaccess-1.0.1.jar;C:\Users\bob.marinier\.m2\repository\com\google\guava\listenablefuture\9999.0-empty-to-avoid-conflict-with-guava\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;C:\Users\bob.marinier\.m2\repository\com\google\code\findbugs\jsr305\3.0.2\jsr305-3.0.2.jar;C:\Users\bob.marinier\.m2\repository\org\checkerframework\checker-qual\3.5.0\checker-qual-3.5.0.jar;C:\Users\bob.marinier\.m2\repository\com\google\errorprone\error_prone_annotations\2.3.4\error_prone_annotations-2.3.4.jar;C:\Users\bob.marinier\.m2\repository\com\google\j2objc\j2objc-annotations\1.3\j2objc-annotations-1.3.jar;C:\Users\bob.marinier\.m2\repository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;C:\Users\bob.marinier\git\test\jsoar\jsoar-repl\target\jsoar-repl-4.0.4-SNAPSHOT.jar --no-fallback --allow-incomplete-classpath --language:js --report-unsupported-elements-at-runtime --initialize-at-build-time=org.jsoar.kernel.Production --initialize-at-build-time=org.jsoar.kernel.memory.RecognitionMemory --initialize-at-build-time=org.jsoar.kernel.ProductionType --initialize-at-build-time=org.jsoar.kernel.DecisionCycle --initialize-at-build-time=org.slf4j.LoggerFactory --initialize-at-build-time=org.jsoar.kernel.learning.rl.ReinforcementLearning --initialize-at-build-time=org.jsoar.kernel.epmem.DefaultEpisodicMemory --initialize-at-build-time=org.jsoar.kernel.smem.DefaultSemanticMemory --initialize-at-build-time=org.jsoar.kernel.learning.Chunker --initialize-at-build-time=org.jsoar.kernel.parser.original.LexemeType --initialize-at-build-time=org.jsoar.kernel.Decider --initialize-at-build-time=org.jsoar.kernel.symbols.Symbols --initialize-at-build-time=org.jsoar.kernel.Phase --initialize-at-build-time=org.jsoar.kernel.io.InputOutputImpl -H:+ReportExceptionStackTraces --native-image-info --verbose -O0 -Dfile.encoding=UTF-8 -H:Class=org.jsoar.repl.Repl -H:Name=jsoar-repl
Executing [
'C:\Users\bob.marinier\graalvm-ee-java11-21.0.0\bin\java.exe' \
-XX:+UseParallelGC \
-XX:+UnlockExperimentalVMOptions \
-XX:+EnableJVMCI \
-Dtruffle.TrustAllTruffleRuntimeProviders=true \
-Dtruffle.TruffleRuntime=com.oracle.truffle.api.impl.DefaultTruffleRuntime \
-Dgraalvm.ForcePolyglotInvalid=true \
-Dgraalvm.locatorDisabled=true \
-Dsubstratevm.IgnoreGraalVersionCheck=true \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.aarch64=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.amd64=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.code.site=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.code.stack=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.code=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.common=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.amd64=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.sparc=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.runtime=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.services=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.sparc=ALL-UNNAMED \
--add-exports=org.graalvm.truffle/com.oracle.truffle.api=ALL-UNNAMED \
--add-opens=jdk.internal.vm.compiler/org.graalvm.compiler.debug=ALL-UNNAMED \
--add-opens=jdk.internal.vm.compiler/org.graalvm.compiler.nodes=ALL-UNNAMED \
--add-opens=jdk.unsupported/sun.reflect=ALL-UNNAMED \
--add-opens=java.base/jdk.internal.module=ALL-UNNAMED \
--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED \
--add-opens=java.base/jdk.internal.reflect=ALL-UNNAMED \
--add-opens=java.base/java.io=ALL-UNNAMED \
--add-opens=java.base/java.lang=ALL-UNNAMED \
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED \
--add-opens=java.base/java.lang.invoke=ALL-UNNAMED \
--add-opens=java.base/java.lang.ref=ALL-UNNAMED \
--add-opens=java.base/java.net=ALL-UNNAMED \
--add-opens=java.base/java.nio=ALL-UNNAMED \
--add-opens=java.base/java.nio.file=ALL-UNNAMED \
--add-opens=java.base/java.security=ALL-UNNAMED \
--add-opens=java.base/javax.crypto=ALL-UNNAMED \
--add-opens=java.base/java.util=ALL-UNNAMED \
--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED \
--add-opens=java.base/sun.security.x509=ALL-UNNAMED \
--add-opens=java.base/jdk.internal.logger=ALL-UNNAMED \
--add-opens=org.graalvm.sdk/org.graalvm.nativeimage.impl=ALL-UNNAMED \
--add-opens=org.graalvm.sdk/org.graalvm.polyglot=ALL-UNNAMED \
--add-opens=org.graalvm.truffle/com.oracle.truffle.polyglot=ALL-UNNAMED \
--add-opens=org.graalvm.truffle/com.oracle.truffle.api.impl=ALL-UNNAMED \
-XX:+UseJVMCINativeLibrary \
-Xss10m \
-Xms1g \
-Duser.country=US \
-Duser.language=en \
-Djava.awt.headless=true \
-Dorg.graalvm.version=21.0.0 \
-Dorg.graalvm.config= \
-Dcom.oracle.graalvm.isaot=true \
-Djava.system.class.loader=com.oracle.svm.hosted.NativeImageSystemClassLoader \
-Xshare:off \
--module-path \
'C:\Users\bob.marinier\graalvm-ee-java11-21.0.0\lib\truffle\truffle-api.jar' \
-Dtruffle.TruffleRuntime=com.oracle.svm.truffle.api.SubstrateTruffleRuntime \
-Dgraalvm.ForcePolyglotInvalid=false \
-Dpolyglot.image-build-time.PreinitializeContexts=js \
-Xmx15032385536 \
-Djdk.internal.lambda.disableEagerInitialization=true \
-Djdk.internal.lambda.eagerlyInitialize=false \
-Djava.lang.invoke.InnerClassLambdaMetafactory.initializeLambdas=false \
-Dsubstratevm.ImageIncludeBuiltinModules=org.graalvm.truffle \
-Dfile.encoding=UTF-8 \
'-javaagent:C:\Users\bob.marinier\graalvm-ee-java11-21.0.0\lib\svm\builder\svm.jar' \
-cp \
'C:\Users\bob.marinier\graalvm-ee-java11-21.0.0\lib\svm\builder\objectfile.jar;C:\Users\bob.marinier\graalvm-ee-java11-21.0.0\lib\svm\builder\pointsto.jar;C:\Users\bob.marinier\graalvm-ee-java11-21.0.0\lib\svm\builder\svm-enterprise.jar;C:\Users\bob.marinier\graalvm-ee-java11-21.0.0\lib\svm\builder\svm.jar' \
'com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus' \
-imagecp \
'C:\Users\bob.marinier\graalvm-ee-java11-21.0.0\lib\svm\library-support-enterprise.jar;C:\Users\bob.marinier\graalvm-ee-java11-21.0.0\lib\svm\library-support.jar;C:\Users\bob.marinier\graalvm-ee-java11-21.0.0\languages\regex\tregex.jar;C:\Users\bob.marinier\graalvm-ee-java11-21.0.0\languages\js\graaljs.jar;C:\Users\bob.marinier\graalvm-ee-java11-21.0.0\languages\js\icu4j.jar;C:\Users\bob.marinier\graalvm-ee-java11-21.0.0\languages\js\trufflenode.jar;C:\Users\bob.marinier\git\test\jsoar\jsoar-core\target\jsoar-core-4.0.4-SNAPSHOT.jar;C:\Users\bob.marinier\.m2\repository\commons-beanutils\commons-beanutils\1.9.4\commons-beanutils-1.9.4.jar;C:\Users\bob.marinier\.m2\repository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;C:\Users\bob.marinier\.m2\repository\org\xerial\sqlite-jdbc\3.34.0\sqlite-jdbc-3.34.0.jar;C:\Users\bob.marinier\.m2\repository\org\slf4j\jcl-over-slf4j\1.7.30\jcl-over-slf4j-1.7.30.jar;C:\Users\bob.marinier\.m2\repository\org\apache\commons\commons-math3\3.6.1\commons-math3-3.6.1.jar;C:\Users\bob.marinier\.m2\repository\com\github\cliftonlabs\json-simple\3.1.1\json-simple-3.1.1.jar;C:\Users\bob.marinier\.m2\repository\org\springframework\spring-core\5.3.3\spring-core-5.3.3.jar;C:\Users\bob.marinier\.m2\repository\org\springframework\spring-jcl\5.3.3\spring-jcl-5.3.3.jar;C:\Users\bob.marinier\.m2\repository\info\picocli\picocli\4.6.1\picocli-4.6.1.jar;C:\Users\bob.marinier\.m2\repository\commons-io\commons-io\2.8.0\commons-io-2.8.0.jar;C:\Users\bob.marinier\.m2\repository\org\graalvm\js\js\21.0.0\js-21.0.0.jar;C:\Users\bob.marinier\.m2\repository\org\graalvm\regex\regex\21.0.0\regex-21.0.0.jar;C:\Users\bob.marinier\.m2\repository\org\graalvm\truffle\truffle-api\21.0.0\truffle-api-21.0.0.jar;C:\Users\bob.marinier\.m2\repository\org\graalvm\sdk\graal-sdk\21.0.0\graal-sdk-21.0.0.jar;C:\Users\bob.marinier\.m2\repository\com\ibm\icu\icu4j\67.1\icu4j-67.1.jar;C:\Users\bob.marinier\.m2\repository\org\graalvm\js\js-scriptengine\21.0.0\js-scriptengine-21.0.0.jar;C:\Users\bob.marinier\git\test\jsoar\jsoar-tcl\target\jsoar-tcl-4.0.4-SNAPSHOT.jar;C:\Users\bob.marinier\.m2\repository\com\github\dronox\jtcl\2.9.4\jtcl-2.9.4.jar;C:\Users\bob.marinier\.m2\repository\org\scala-lang\scala-library\2.12.7\scala-library-2.12.7.jar;C:\Users\bob.marinier\.m2\repository\org\codehaus\janino\janino\3.0.11\janino-3.0.11.jar;C:\Users\bob.marinier\.m2\repository\org\codehaus\janino\commons-compiler\3.0.11\commons-compiler-3.0.11.jar;C:\Users\bob.marinier\.m2\repository\com\google\guava\guava\30.1-jre\guava-30.1-jre.jar;C:\Users\bob.marinier\.m2\repository\com\google\guava\failureaccess\1.0.1\failureaccess-1.0.1.jar;C:\Users\bob.marinier\.m2\repository\com\google\guava\listenablefuture\9999.0-empty-to-avoid-conflict-with-guava\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;C:\Users\bob.marinier\.m2\repository\com\google\code\findbugs\jsr305\3.0.2\jsr305-3.0.2.jar;C:\Users\bob.marinier\.m2\repository\org\checkerframework\checker-qual\3.5.0\checker-qual-3.5.0.jar;C:\Users\bob.marinier\.m2\repository\com\google\errorprone\error_prone_annotations\2.3.4\error_prone_annotations-2.3.4.jar;C:\Users\bob.marinier\.m2\repository\com\google\j2objc\j2objc-annotations\1.3\j2objc-annotations-1.3.jar;C:\Users\bob.marinier\.m2\repository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;C:\Users\bob.marinier\git\test\jsoar\jsoar-repl\target\jsoar-repl-4.0.4-SNAPSHOT.jar' \
'-H:Path=C:\Users\bob.marinier\git\test\jsoar\jsoar-repl\target' \
-H:ClassInitialization=org.graalvm.polyglot:build_time \
-H:Features=org.graalvm.home.HomeFinderFeature \
-H:JNIConfigurationResources=META-INF/native-image/com.soartech/jsoar-repl/jni-config.json \
-H:ReflectionConfigurationResources=META-INF/native-image/com.soartech/jsoar-repl/reflect-config.json \
-H:ResourceConfigurationResources=META-INF/native-image/com.soartech/jsoar-repl/resource-config.json \
-H:+AllowIncompleteClasspath \
-H:Features=com.oracle.svm.truffle.TruffleFeature,org.graalvm.home.HomeFinderFeature \
-H:MaxRuntimeCompileMethods=1700 \
-H:ClassInitialization=org.graalvm.launcher:build_time,com.oracle.truffle:build_time \
-H:-RemoveSaturatedTypeFlows \
-H:MaxRuntimeCompileMethods=900 \
-H:MaxRuntimeCompileMethods=9200 \
-H:ClassInitialization=com.oracle.truffle.js:build_time,com.oracle.js.parser:build_time,com.oracle.truffle.trufflenode:build_time,com.oracle.truffle.regex:build_time \
-H:ClassInitialization=com.ibm.icu:run_time \
-H:ReflectionConfigurationResources=com/oracle/truffle/js/runtime/resources/reflect-config.json \
-H:ResourceConfigurationResources=com/oracle/truffle/js/runtime/resources/resource-config.json \
-H:+ReportUnsupportedElementsAtRuntime \
-H:ClassInitialization=org.jsoar.kernel.Production:build_time \
-H:ClassInitialization=org.jsoar.kernel.memory.RecognitionMemory:build_time \
-H:ClassInitialization=org.jsoar.kernel.ProductionType:build_time \
-H:ClassInitialization=org.jsoar.kernel.DecisionCycle:build_time \
-H:ClassInitialization=org.slf4j.LoggerFactory:build_time \
-H:ClassInitialization=org.jsoar.kernel.learning.rl.ReinforcementLearning:build_time \
-H:ClassInitialization=org.jsoar.kernel.epmem.DefaultEpisodicMemory:build_time \
-H:ClassInitialization=org.jsoar.kernel.smem.DefaultSemanticMemory:build_time \
-H:ClassInitialization=org.jsoar.kernel.learning.Chunker:build_time \
-H:ClassInitialization=org.jsoar.kernel.parser.original.LexemeType:build_time \
-H:ClassInitialization=org.jsoar.kernel.Decider:build_time \
-H:ClassInitialization=org.jsoar.kernel.symbols.Symbols:build_time \
-H:ClassInitialization=org.jsoar.kernel.Phase:build_time \
-H:ClassInitialization=org.jsoar.kernel.io.InputOutputImpl:build_time \
-H:+ReportExceptionStackTraces \
-H:+DumpTargetInfo \
-H:Optimize=0 \
-H:Class=org.jsoar.repl.Repl \
-H:Name=jsoar-repl \
-H:FallbackThreshold=0 \
'-H:CLibraryPath=C:\Users\bob.marinier\graalvm-ee-java11-21.0.0\lib\svm\clibraries\windows-amd64' \

]
[jsoar-repl:14308]    classlist:   2,398.98 ms,  1.19 GB
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[jsoar-repl:14308]        (cap):   2,294.88 ms,  1.20 GB
[jsoar-repl:14308]        setup:   4,706.66 ms,  1.20 GB
# Building image for target platform: org.graalvm.nativeimage.Platform$WINDOWS_AMD64
# Using native toolchain:
#   Name: C/C++ Optimizing Compiler (cl)
#   Vendor: microsoft
#   Version: 19.28.29334
#   Target architecture: x64
#   Path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX64\x64\cl.exe
# Using CLibrary: com.oracle.svm.core.c.libc.NoLibC
[jsoar-repl:14308]     (clinit):   1,767.21 ms,  5.67 GB
# Static libraries:
#   ..\..\..\..\..\graalvm-ee-java11-21.0.0\lib\svm\clibraries\windows-amd64\libchelper.lib
#   ..\..\..\..\..\graalvm-ee-java11-21.0.0\lib\static\windows-amd64\prefs.lib
#   ..\..\..\..\..\graalvm-ee-java11-21.0.0\lib\static\windows-amd64\net.lib
#   ..\..\..\..\..\graalvm-ee-java11-21.0.0\lib\static\windows-amd64\nio.lib
#   ..\..\..\..\..\graalvm-ee-java11-21.0.0\lib\static\windows-amd64\java.lib
#   ..\..\..\..\..\graalvm-ee-java11-21.0.0\lib\static\windows-amd64\fdlibm.lib
#   ..\..\..\..\..\graalvm-ee-java11-21.0.0\lib\static\windows-amd64\zip.lib
#   ..\..\..\..\..\graalvm-ee-java11-21.0.0\lib\svm\clibraries\windows-amd64\jvm.lib
# Other libraries: version
[jsoar-repl:14308]   (typeflow):  31,036.46 ms,  5.67 GB
[jsoar-repl:14308]    (objects):  27,237.82 ms,  5.67 GB
[jsoar-repl:14308]   (features):   5,268.45 ms,  5.67 GB
[jsoar-repl:14308]     analysis:  69,049.17 ms,  5.67 GB
[jsoar-repl:14308]     universe:   2,078.13 ms,  5.67 GB
10120 method(s) included for runtime compilation
[jsoar-repl:14308]      (parse):   5,893.36 ms,  5.93 GB
[jsoar-repl:14308]    (compile):  34,072.35 ms,  7.93 GB
[jsoar-repl:14308]      compile:  43,877.78 ms,  7.93 GB
[jsoar-repl:14308]        image:  12,546.14 ms,  8.14 GB
[jsoar-repl:14308]        write:   1,647.02 ms,  8.14 GB
[jsoar-repl:14308]      [total]: 137,980.45 ms,  8.14 GB
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ jsoar-repl ---
[INFO] Installing C:\Users\bob.marinier\git\test\jsoar\jsoar-repl\target\jsoar-repl-4.0.4-SNAPSHOT.jar to C:\Users\bob.marinier\.m2\repository\com\soartech\jsoar-repl\4.0.4-SNAPSHOT\jsoar-repl-4.0.4-SNAPSHOT.jar
[INFO] Installing C:\Users\bob.marinier\git\test\jsoar\jsoar-repl\pom.xml to C:\Users\bob.marinier\.m2\repository\com\soartech\jsoar-repl\4.0.4-SNAPSHOT\jsoar-repl-4.0.4-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for com.soartech:jsoar 4.0.4-SNAPSHOT:
[INFO]
[INFO] com.soartech:jsoar ................................. SUCCESS [  0.180 s]
[INFO] jsoar-core ......................................... SUCCESS [  7.285 s]
[INFO] jsoar-tcl .......................................... SUCCESS [  0.504 s]
[INFO] jsoar-repl ......................................... SUCCESS [02:20 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:28 min
[INFO] Finished at: 2021-02-26T10:42:21-05:00
[INFO] ------------------------------------------------------------------------

C:\Users\bob.marinier\git\test\jsoar>cd jsoar-repl\target

C:\Users\bob.marinier\git\test\jsoar\jsoar-repl\target>jsoar-repl.exe
cannot read resource "/tcl/lang/library/init.tcl"
tcl.lang.TclException: cannot read resource "/tcl/lang/library/init.tcl"
        at tcl.lang.Interp.evalResource(Interp.java:2958)
        at tcl.lang.Interp.evalResource(Interp.java:2903)
        at tcl.lang.Interp.<init>(Interp.java:642)
        at org.jsoar.tcl.SoarTclInterface.<init>(SoarTclInterface.java:135)
        at org.jsoar.tcl.SoarTclInterface.findOrCreate(SoarTclInterface.java:111)
        at org.jsoar.tcl.SoarTclInterfaceFactory.create(SoarTclInterfaceFactory.java:24)
        at org.jsoar.kernel.Agent.createInterpreter(Agent.java:429)
        at org.jsoar.kernel.Agent.getInterpreter(Agent.java:405)
        at org.jsoar.kernel.rhs.functions.StandardFunctions.<init>(StandardFunctions.java:131)
        at org.jsoar.kernel.Agent.<init>(Agent.java:255)
        at org.jsoar.runtime.ThreadedAgentManager.create(ThreadedAgentManager.java:42)
        at org.jsoar.runtime.ThreadedAgent.create(ThreadedAgent.java:140)
        at org.jsoar.runtime.ThreadedAgent.create(ThreadedAgent.java:115)
        at org.jsoar.repl.Repl.<init>(Repl.java:36)
        at org.jsoar.repl.Repl.main(Repl.java:23)
Exception in thread "main" tcl.lang.TclRuntimeError: unexpected TclException: tcl.lang.TclException: cannot read resource "/tcl/lang/library/init.tcl"
        at tcl.lang.Interp.<init>(Interp.java:647)
        at org.jsoar.tcl.SoarTclInterface.<init>(SoarTclInterface.java:135)
        at org.jsoar.tcl.SoarTclInterface.findOrCreate(SoarTclInterface.java:111)
        at org.jsoar.tcl.SoarTclInterfaceFactory.create(SoarTclInterfaceFactory.java:24)
        at org.jsoar.kernel.Agent.createInterpreter(Agent.java:429)
        at org.jsoar.kernel.Agent.getInterpreter(Agent.java:405)
        at org.jsoar.kernel.rhs.functions.StandardFunctions.<init>(StandardFunctions.java:131)
        at org.jsoar.kernel.Agent.<init>(Agent.java:255)
        at org.jsoar.runtime.ThreadedAgentManager.create(ThreadedAgentManager.java:42)
        at org.jsoar.runtime.ThreadedAgent.create(ThreadedAgent.java:140)
        at org.jsoar.runtime.ThreadedAgent.create(ThreadedAgent.java:115)
        at org.jsoar.repl.Repl.<init>(Repl.java:36)
        at org.jsoar.repl.Repl.main(Repl.java:23)
marinier commented 3 years ago

The library that is trying to load this resource, jtcl is using it's own ClassLoader, TclClassLoader and I suspect this is somehow messing up native image's ability to load this resource. I'm not sure if that makes it a native image bug or a jtcl bug, but it does work when running as a Java app.