Fork me on GitHub
#juxt
<
2019-02-21
>
p-himik05:02:55

Some new input - requiring manifold.stream causes parents to return nil.

p-himik05:02:23

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=> 

p-himik05:02:48

It's reproducible with java -jar project.jar -r but not with clj --repl.

p-himik06:02:13

How on Earth does this even work then? clojure.core cannot be *not* required before since e.g. composite-keyword uses stuff from it.

dominicm06:02:39

That's very interesting

p-himik06:02:24

How does the -r flag work?

p-himik06:02:52

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.

p-himik06:02:00

Is it possible that it has something to do with how onejar works?

dominicm06:02:17

Definitely it's related to that

p-himik06:02:20

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)

dominicm06:02:52

Heads up btw, capsule is far more reliable than onejar in my opinion. It uses an approach a bit like lein trampoline.

dominicm06:02:31

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.

p-himik06:02:38

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!

dominicm06:02:54

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)

dominicm07:02:26

The easy solution here is to recommend capsule. This is a very unusual bug though.

p-himik07:02:58

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.

dominicm07:02:36

Skinny jars are the best :)

dominicm08:02:51

can confirm that capsule works fine.

👍 5
dominicm09:02:02

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.

otfrom15:02:02

@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?

jonpither15:02:41

Against policy

otfrom15:02:33

ah well, so many plans thwarted 😉

otfrom15:02:40

it would have been fun @jonpither

otfrom15:02:54

I'll just have to stick with Mastodon and Witan then

otfrom15:02:11

(for me it is important that everything also have a backronym)

dominicm17:02:10

@p-himik I have a patch to onejar that fixes the bug :)

p-himik17:02:54

Great! I'll check it out when you push it.

dominicm18:02:22

edge master now works

dominicm18:02:41

Or did in my test anyway