Some new input - requiring manifold.stream
causes parents
to return nil.
Well this is disappointing:
$ java -jar project.jar -r
Clojure 1.10.0
user=> (require '[integrant.core :refer [composite-keyword]])
nil
user=> (def k (composite-keyword [:a/a :b/b]))
#'user/k
user=> (parents k)
#{:a/a :b/b}
user=> (require 'clojure.core)
nil
user=> (parents k)
nil
user=>
It's reproducible with java -jar project.jar -r
but not with clj --repl
.
How on Earth does this even work then? clojure.core
cannot be *not* required before since e.g. composite-keyword
uses stuff from it.
That's very interesting
How does the -r
flag work?
I mean when there's project.jar
. I can't reproduce the issue with just java -cp /usr/local/lib/clojure/libexec/clojure-tools-1.10.0.411.jar clojure.main -r
.
Is it possible that it has something to do with how onejar
works?
Definitely it's related to that
I'm just interested at this point - why use onejar at all? In what aspects was it better for you than uberjar? (note that I've never used any of them, but am probably about to)
Heads up btw, capsule is far more reliable than onejar in my opinion. It uses an approach a bit like lein trampoline.
Uberjars have two major issues for me: 1. They discard licenses, this is a violation of Apache v2 2. You have to do stupid things like merging xml & edn files with the same name. I didn't want to do that.
Huh, interesting. On the second point - if the files have the same path? How does onejar and capsule handle that? I'll check capsule out, thanks!
They can either return the first one they find (what io/resource does) or they can return all of them (this is how data_readers.clj works)
The easy solution here is to recommend capsule. This is a very unusual bug though.
For me the initial solution will be to use nothing at all. 🙂 Currently I use Heroku with automatic deployment from GitHub - I don't think having a single jar has any noticeable advantages here. But I'll definitely keep capsule in mind, thanks.
Skinny jars are the best :)
can confirm that capsule works fine.
The onejar thing is still a bit weird, the class loader is exactly as I'd expect. I'm going to have to dig into the internals of clojure and figure why this isn't working.
@malcolmsparks @jonpither if I join juxt can I make libraries and apps with long names as long as they are Anglo-Saxon or Medieval Icelandic words?
No
Against policy
ah well, so many plans thwarted 😉
it would have been fun @jonpither
I'll just have to stick with Mastodon and Witan then
(for me it is important that everything also have a backronym)
@p-himik I have a patch to onejar that fixes the bug :)
Great! I'll check it out when you push it.
edge master now works
Or did in my test anyway