clj-python / libpython-clj

Python bindings for Clojure
Eclipse Public License 2.0
1.05k stars 68 forks source link

added functions which print classpath and java args from aliases #228

Closed behrica closed 1 year ago

behrica commented 1 year ago

see here for discussion:

https://clojurians.zulipchat.com/#narrow/stream/215609-libpython-clj-dev/topic/bootstrap.20libpython-clj.20embedded

The new functions are meant to be used by clojurebridge to find out which java args (an later classpath) the JVM to be started needs.

cnuernber commented 1 year ago

I am not sure about this. I don't think every user wants to have a tools.build dependency in their project nor do they want some of the tools.build transitive dependencies such as slf4j-nop.

behrica commented 1 year ago

Yes, I know. Not sure there is an other way. Trying to solve : https://github.com/behrica/clojurebridge/issues/4

via "aliases" requires to "calculate the fullset of java args from a list of aliases".

This requires a library, unless we program it ourselves.

We do something similar with the classpath, but there we are lucky that clojure CLI does have a feature to resolve the classpath and print it. It does not have something similar for "java args"

behrica commented 1 year ago

There is maybe a workaround. I saw thet in the .cpache directory, clojure creates on startup a file with te resloved.jvm args.

running clj -A:jdk-17

gives

cat .cpcache/1141529163.jvm 
--add-modules
jdk.incubator.foreign
--enable-native-access=ALL-UNNAMED
cnuernber commented 1 year ago

I see your point. Not sure the best pathway - perhaps also issue to get clj to output the resolved jvm-opts.

behrica commented 1 year ago

I can execute the code directly from cljbridge via clj -e I think. So we can close it here.