Discuss GraalVM related topics. Use clojure 1.10.2 or newer for all new projects. Contribute to and GraalVM slack:
Ben Sless 2021-04-18T12:10:56.109100Z

Is there a straightforward way of getting the generated executable's location at run time?

Ben Sless 2021-04-18T12:12:01.109200Z

How would you define minimal startup time? Have you tested how much you can cut from startup time by using direct linking, AOT, removing metadata, etc?

chrisn 2021-04-18T15:16:13.110Z

(System/getProperty "user.dir") - What happens with that?

borkdude 2021-04-18T15:25:39.110700Z

@chris441 He means the executable that is currently being executed. E.g. when you run bb -e '(+ 1 2 3)', you want to see /usr/local/bin/bb or so

chrisn 2021-04-18T15:26:13.111200Z

Ah, got it

borkdude 2021-04-18T15:26:20.111500Z

Someone in the GraalVM slack told me that Graal has an API for this

borkdude 2021-04-18T15:26:32.111700Z

(GraalVM slack =

borkdude 2021-04-18T15:26:38.111900Z

but I haven't found it

borkdude 2021-04-18T15:27:26.112500Z

One use case for this is to have an upgrade command so an executable can update itself (not sure if that's a good idea, but exploring the possibilities)

chrisn 2021-04-18T16:09:31.112900Z

Does the answer need to be cross platform? What platform is the query on?

chrisn 2021-04-18T16:09:42.113200Z

For unix there are PID-related ways to do this.

borkdude 2021-04-18T16:10:44.113400Z

yes, cross platform

borkdude 2021-04-18T16:11:21.113700Z

should be somewhere available

borkdude 2021-04-18T16:13:11.114200Z

user=> (org.graalvm.nativeimage.ProcessProperties/getExecutableName)
Execution error (Error) at org.graalvm.nativeimage.impl.ImageSingletonsSupport/checkInstalled (
The class ImageSingletons can only be used when building native images, i.e., when using the native-image command.

borkdude 2021-04-18T16:13:29.114600Z

should be able to run this within a graalvm native image

borkdude 2021-04-18T16:15:52.114900Z

wow, the exec method looks interesting:

borkdude 2021-04-18T16:17:52.115200Z

@lukaszkorecki That's what you asked recently ^

lukasz 2021-04-19T13:55:08.118200Z

Yes, that's the one!

borkdude 2021-04-18T19:27:05.117200Z

$ ./bb -e '(do (prn (org.graalvm.nativeimage.ProcessProperties/getProcessID)) (org.graalvm.nativeimage.ProcessProperties/exec (fs/path "/bin/bash") (into-array String [""])))'
bash-3.2$ ps aux | grep 28122
borkdude         28124   0.0  0.0  4399112    904 s015  S+    9:23PM   0:00.00 grep 28122
borkdude         28122   0.0  0.0  4431696   1600 s015  S     9:23PM   0:00.03 TERM_SESSION_ID=w2t2p0:5035ECFF-A5DD-4DF9-9A67-6C736151E9AF
What is it called again when a process replaces itself with another process? This is what happens here ^

borkdude 2021-04-18T19:28:01.117700Z

Getting the executable name:

$ ./bb -e '(org.graalvm.nativeimage.ProcessProperties/getExecutableName)'