leiningen

N.B. The maintainers are on #leiningen on Libera chat IRC. Go there for direct support/bug reports.
2019-08-13T03:13:59.031900Z

@frozenlock the Uberjar does end up there.

2019-08-13T03:17:33.033500Z

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

2019-08-13T03:27:13.034300Z

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

2019-08-13T03:34:15.034900Z

: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"]}

2019-08-13T03:34:22.035100Z

Then lein test-lifecycle

2019-08-13T03:35:05.035800Z

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

2019-08-13T03:56:19.036500Z

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

2019-08-13T03:57:50.037500Z

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

2019-08-13T04:02:31.038Z

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

👍 1
2019-08-13T15:44:59.038700Z

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

2019-08-13T16:05:42.039Z

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

2019-08-13T16:05:56.039400Z

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

2019-08-13T16:06:21.039900Z

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

2019-08-13T16:06:52.040500Z

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

2019-08-13T16:07:20.041100Z

eg.

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

2019-08-13T16:14:30.041500Z

Yes, it was the actual setup.

2019-08-13T16:15:53.041800Z

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

2019-08-13T16:16:00.042100Z

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

2019-08-13T16:17:13.042400Z

Leiningen 2.9.1 on Java 11.0.4 OpenJDK 64-Bit Server VM

2019-08-13T16:18:11.043300Z

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

2019-08-13T16:18:56.043500Z

Oh, more interesting then

2019-08-13T16:19:10.043900Z

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

2019-08-13T16:19:29.044300Z

that’s a deeper hole to trace through then hah

2019-08-13T16:21:07.045200Z

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

2019-08-13T16:22:12.046200Z

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

2019-08-13T16:23:01.046500Z

ok

2019-08-13T16:25:11.047100Z

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

2019-08-13T16:25:37.047700Z

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

2019-08-13T16:25:42.047900Z

Mostly this is speculation though

2019-08-13T16:26:39.048400Z

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

🥔 1
😛 1