This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-18
Channels
- # announcements (1)
- # babashka (16)
- # beginners (39)
- # calva (17)
- # cider (21)
- # cljs-dev (1)
- # clojars (2)
- # clojure (39)
- # clojure-australia (1)
- # clojure-europe (1)
- # clojure-spec (7)
- # conjure (1)
- # cursive (6)
- # datomic (2)
- # depstar (5)
- # graalvm (20)
- # instaparse (11)
- # meander (4)
- # pathom (4)
- # pedestal (3)
- # polylith (18)
- # re-frame (13)
- # reagent (4)
- # reitit (3)
- # shadow-cljs (2)
- # spacemacs (14)
- # vrac (1)
Is there a straightforward way of getting the generated executable's location at run time?
@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
(GraalVM slack = https://app.slack.com/client/TN37RDLPK)
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)
https://www.graalvm.org/sdk/javadoc/index.html?org/graalvm/nativeimage/ProcessProperties.html
user=> (org.graalvm.nativeimage.ProcessProperties/getExecutableName)
Execution error (Error) at org.graalvm.nativeimage.impl.ImageSingletonsSupport/checkInstalled (ImageSingletonsSupport.java:69).
The class ImageSingletons can only be used when building native images, i.e., when using the native-image command.
:)wow, the exec method looks interesting: https://www.graalvm.org/sdk/javadoc/index.html?org/graalvm/nativeimage/ProcessProperties.html
@lukaszkorecki That's what you asked recently ^
$ ./bb -e '(do (prn (org.graalvm.nativeimage.ProcessProperties/getProcessID)) (org.graalvm.nativeimage.ProcessProperties/exec (fs/path "/bin/bash") (into-array String [""])))'
28122
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 ^