Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bb --version could run without a JVM #1686

Open
ieugen opened this issue Apr 11, 2024 · 1 comment
Open

bb --version could run without a JVM #1686

ieugen opened this issue Apr 11, 2024 · 1 comment

Comments

@ieugen
Copy link
Contributor

ieugen commented Apr 11, 2024

This surprised me.
I did not expect bb to require JVM.

version
1.3.183

platform

Was Windows but might be the same on others.

problem

bb fails to run without a JVM and throws exception.
if there is a bb.edn with deps .

No bb command works I believe.

This was discussed https://clojurians.slack.com/archives/CLX41ASCS/p1712827785933789

repro

# create a container
 docker run -ti debian bash 
# install curl
apt update && apt install -y curl vim 

# install bb via install scritp

# create a bb.edn file with
cat bb.edn
{:min-bb-version "1.0.0"
 :paths ["script"]
 :deps {amperity/vault-clj {:mvn/version "1.1.3"}
        io.github.ieugen/compoje {:git/sha "4fad03af73ac80ec6a25794c410f3a4abef46311"}}
}

# run bb
root@e0c7668bed59:/# bb
Exception in thread "main" java.lang.Exception: Couldn't find 'java'. Please set JAVA_HOME.
	at borkdude.deps$get_java_cmd.invokeStatic(deps.clj:281)
	at borkdude.deps$_main.invokeStatic(deps.clj:902)
	at borkdude.deps$_main.doInvoke(deps.clj:882)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invokeStatic(core.clj:667)
	at babashka.impl.deps$add_deps$fn__27345$fn__27346.invoke(deps.clj:113)
	at clojure.lang.AFn.applyToHelper(AFn.java:152)
	at clojure.lang.AFn.applyTo(AFn.java:144)
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$with_bindings_STAR_.invokeStatic(core.clj:1990)
	at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1990)
	at clojure.lang.RestFn.invoke(RestFn.java:425)
	at babashka.impl.deps$add_deps$fn__27345.invoke(deps.clj:113)
	at babashka.impl.deps$add_deps.invokeStatic(deps.clj:113)
	at babashka.main$exec$fn__32212.invoke(main.clj:872)
	at clojure.lang.AFn.applyToHelper(AFn.java:152)
	at clojure.lang.AFn.applyTo(AFn.java:144)
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$with_bindings_STAR_.invokeStatic(core.clj:1990)
	at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1990)
	at clojure.lang.RestFn.invoke(RestFn.java:425)
	at babashka.main$exec.invokeStatic(main.clj:824)
	at babashka.main$main.invokeStatic(main.clj:1201)
	at babashka.main$main.doInvoke(main.clj:1148)
	at clojure.lang.RestFn.invoke(RestFn.java:397)
	at clojure.lang.AFn.applyToHelper(AFn.java:152)
	at clojure.lang.RestFn.applyTo(RestFn.java:132)
	at clojure.core$apply.invokeStatic(core.clj:667)
	at babashka.main$_main$f__32337__auto____32347.invoke(main.clj:1240)
	at clojure.lang.AFn.run(AFn.java:22)
	at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
	at [email protected]/java.lang.Thread.run(Thread.java:1583)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:833)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:211)
Exception in thread "main" java.lang.NullPointerException
	at clojure.lang.RT.intCast(RT.java:1221)
	at babashka.main$_main.invokeStatic(main.clj:1240)
	at babashka.main$_main.doInvoke(main.clj:1226)
	at clojure.lang.RestFn.invoke(RestFn.java:397)
	at clojure.lang.AFn.applyToHelper(AFn.java:152)
	at clojure.lang.RestFn.applyTo(RestFn.java:132)
	at babashka.main.main(Unknown Source)
	at [email protected]/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)

expected behavior

  • bb should run ?!
  • bb should display a friendlier error
  • bb should not depend on JVM :D

I don't think any bb command works.

@borkdude borkdude changed the title babashka fails to run without a JVM in some circumstances bb --version shouldn't require a JVM to run Apr 11, 2024
@borkdude
Copy link
Collaborator

bb --version could run without a JVM, but anything that requires the dependencies to be in place will still require it. Will fix --version to run without a JVM and will check if there are more commands that could run without a JVM

@borkdude borkdude changed the title bb --version shouldn't require a JVM to run bb --version could run without a JVM Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants