-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
run-main only works on namespaces relative to where jank is #162
Comments
Thanks for the detailed report. Looks to me like we're not finding the module at all when we walk through the module paths. I'd also expect a Getting @Samy-33 in on this. |
Not reproducible on arch:
|
Followed this process on Mac M1:
➜ pwd
/Users/saket/Documents/oliv/tmp
➜ tree test
test
└── jank.jank
1 directory, 1 file
➜ cat test/jank.jank
(ns test.jank)
(defn count-up [max]
(loop [count 0]
(if (= count max)
(println "Done!")
(do
(println (str "Counting " count))
(recur (inc count))))))
(defn -main [& args]
(count-up 5))
➜ jank --module-path $(pwd) run-main test.jank
Bottom of clojure.core
Counting 0
Counting 1
Counting 2
Counting 3
Counting 4
Done!
➜ |
Issue replicated: ➜ jank --module-path "$(pwd)" compile test.jank
Bottom of clojure.core
➜ jank --module-path "$(pwd)" run-main test.jank
Bottom of clojure.core
Exception: can't intern var; namespace doesn't exist: test.jank
➜
@elken, can you confirm the same behaviour on your mac?
Note: |
Surprisingly, ➜ dev git:(main) ✗ pwd
/Users/saket/Documents/oss/jank/compiler+runtime/dev
➜ dev git:(main) ✗ tree .
.
├── classes
│ └── core.o
└── src
├── core.jank
└── jank-lein
└── core.clj
4 directories, 3 files
➜ dev git:(main) ✗ cat src/core.jank
(ns core)
(defn -main [& args]
(println "Hello world"))
(println "Bottom of core")
➜ dev git:(main) ✗ which jank
/opt/homebrew/bin/jank
➜ dev git:(main) ✗ jank --module-path src repl
Bottom of clojure.core
clojure.core=> (require 'core)
Bottom of core
nil
clojure.core=> (in-ns 'core)
nil
core=> (-main)
Hello world
nil
core=>
|
The Homebrew Formual is on Thanks @elken for helping with reproduction and homebrew wizardry. |
I think it was #155 that fixed it, it's the only obvious change since boehm was merged in |
Apologies if this is already raised, I had a quick look but came up nought.
So one of the testers I asked to demo my homebrew package found out that
jank run-main
only seems to work when the module is relative to wherejank
is installed. (I'm on macos, so ignore the fact it says/private/tmp
instead of/tmp
, they're the same path)In this screenshot, there is a file in
test/jank.jank
with the below contentsDoesn't work with the homebrew output build above. If I navigate to my local build instead, it does work
Then if I try and call this build (I thought maybe my homebrew build didn't set something up right), it fails as before
Hopefully this is enough to go on! Thanks as always 😄
The text was updated successfully, but these errors were encountered: