Open revintec opened 9 months ago
also, can I debug the native-image driver itself? ideally not have to use gdb maybe debug a java version of it(not the aot compiled version)?
You can: run native-image --debug-attach[=port]
and attach your IDE
@petermz maybe I didn't do it correctly? but that seems only able to debug the child build process, not the native-image bootstrap driver itself. as cited from my original post:
2. I've tried to debug the driver using
native-image --debug-attach ...
but this can only debug the build process, not the native-image bootstrap driver itself(GvmEE-Java20-23.0/lib/svm/bin/native-image: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked
)
Hi Thank you for your suggestion, I shared it with the Dev team and we'll take a look into it whenever possible. Tracked internally at GR 48898
@oubidar-Abderrahim Hi, is there any update on this?
We don't have this implemented right now, it seems like a nice feature but it's very unlikely that we will find time to implement that at the moment. We've added this feature to our backlog for future releases.
running GraalVM 23.0 with native-image, should be a relatively new version as of writing also no relevant feature seems present in github master source branch, nor documentation can be found
Is your feature request related to a problem? Please describe. native-image driver provides a way to customize build arguments, using
META-INF/native-image/native-image.properties
resource files. however there seems no (easy) way to do variable substitution in this file. namely, I'd like using sth. like:JavaArgs = --patch-module java.base=$HOME/shade.jar
// or${HOME}
Describe the solution you'd like. provide a way to do property file variable substitution, e.g.:
-VHOME=xxx
+JavaArgs = $HOME/abc
=JavaArgs = xxx/abc
HOME=xxx
+-EHOME
+JavaArgs = $HOME/abc
=JavaArgs = xxx/abc
-VHOME=...
and-EHOME
to no availnative-image --debug-attach ...
but this can only debug the build process, not the native-image bootstrap driver itself(GvmEE-Java20-23.0/lib/svm/bin/native-image: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked
)Describe who do you think will benefit the most. all GraalVM contributors, developers of libraries and frameworks which depend on GraalVM, could benefit from this as build argument is now more flexible. previously the embedded build argument in property file is rigid, but now it can be treated as a template, thus can be further augmented using
-V
,-E
or some other flags/environment variablesDescribe alternatives you've considered. write the relevant argument each and every time in command line fully or inside a bash.sh script, not ideal
Additional context. as I'm unable to debug the code, I can only statically analyze the source file :( it seems the relevant feature already exists(
-V
and-E
s), but I'm unable to grasp the usage, nor find the documentation https://github.com/oracle/graal/blob/ff84a77e57a4692b65680aa0a6a1afad79b2c035/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/DefaultOptionHandler.java#L169https://github.com/oracle/graal/blob/ff84a77e57a4692b65680aa0a6a1afad79b2c035/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java#L678
Express whether you'd like to help contributing this feature this feature should require minimal/no code change, or simply a documentation update, thus I'd like not to open a code PR