Fork me on GitHub
#leiningen
<
2019-08-13
>
mikerod03:08:59

@frozenlock the Uberjar does end up there.

frozenlock03:08:33

@mikerod I forgot to mention: with profiles. :target-path in a profile is respected for compilation, but not for the uberjar.

mikerod03:08:13

@frozenlock which profile is it? How are you running the uberjar task to include this profile?

frozenlock03:08:15

:target-path "target/%s"
  
  :profiles {:uberjar {:aot         :all
                       :omit-source true
                       :auto-clean  false}
             :dev     {:plugins [[lein-shell "0.5.0"]]}
             
             ;; profiles to generate test uberjars
             :updater-test  {:uberjar-name "updater.jar"
                             :target-path  "target/test/lifecycle/updater"
                             :main         updater.updater}
             :main-app-test {:uberjar-name "main-app.jar"
                             :target-path  "target/test/lifecycle/main_app"
                             :main         updater.updater}}

  :aliases
  {"test-lifecycle" ["do" "clean," "with-profile" "updater-test:main-app-test" "uberjar"]}

frozenlock03:08:22

Then lein test-lifecycle

frozenlock03:08:05

Uberjars are put into target/uberjar instead of target/test/....

mikerod03:08:19

@frozenlock maybe because the profiles aren’t marked with :leaky

mikerod03:08:50

But I don’t really expect necessarily you’d have to. But it’s possible.

frozenlock04:08:31

Thanks, I'll try that first thing in the morning!

👍 4
frozenlock15:08:59

Follow-up : adding ^:leaky fixes the issue. Thanks!

mikerod16:08:42

@frozenlock ok, good. it’s a bit frustrating to me still

mikerod16:08:56

I was thinking/hoping that with-profile would be unconditionally respected

mikerod16:08:21

this was your actual project.clj setup right? you weren’t using “composite” or “partially composite” profiles too?

mikerod16:08:52

like did you have a :profiles that composite-style merged in :updater-test and/or :main-app-test?

mikerod16:08:20

eg.

:profiles 
{:test [:updater-test {<stuff>}] ...}

frozenlock16:08:30

Yes, it was the actual setup.

mikerod16:08:53

ok, so it just still strips out profiles, even when you gave them with-profiles

mikerod16:08:00

what version of lein too? just to be cleear @frozenlock

frozenlock16:08:13

Leiningen 2.9.1 on Java 11.0.4 OpenJDK 64-Bit Server VM

frozenlock16:08:11

Just to be clear: everything in the profile appears to be kept (including uberjar-name), but the generated uberjar is in the wrong directory.

mikerod16:08:56

Oh, more interesting then

mikerod16:08:10

but ok, so :leaky maybe just giving it higher priority in some profile merge step later

mikerod16:08:29

that’s a deeper hole to trace through then hah

mikerod16:08:07

@frozenlock sorry to drill with questions, but did the “normal” jar file end up in the correct :target-path, but not the uberjar? or did both jars ignore your :target-path?

frozenlock16:08:12

Normal jars behave as expected. It's really just the uberjar that was ending at the wrong (uberjar profile) :target-path.

mikerod16:08:11

I don’t know the whole reason still, but I suspect it’s because the :uberjar profile is perhaps auto-marked as :leaky

mikerod16:08:37

and perhaps it already somehow inherits the :target-path from the root, and that ends up taking priority in the profile merging

mikerod16:08:42

Mostly this is speculation though

mikerod16:08:39

I don’t see :leaky playing a role in the merge fn’s though, so I don’t think that’s correct - boo

😛 4
🥔 4