Fork me on GitHub
#tools-deps
<
2018-12-06
>
kirill.salykin09:12:33

hi, I am trying to build skinny jar with pack and got this error:

Exception in thread "main" java.lang.IllegalArgumentException: No matching clause: [nil :jar]
	at mach.pack.alpha.skinny$run_steps.invokeStatic(skinny.clj:107)
	at mach.pack.alpha.skinny$run_steps.invoke(skinny.clj:99)
	at mach.pack.alpha.skinny$_main.invokeStatic(skinny.clj:175)
	at mach.pack.alpha.skinny$_main.doInvoke(skinny.clj:158)
	at clojure.lang.RestFn.invoke(RestFn.java:397)
	at clojure.lang.AFn.applyToHelper(AFn.java:152)
	at clojure.lang.RestFn.applyTo(RestFn.java:132)
	at clojure.lang.Var.applyTo(Var.java:702)
	at clojure.core$apply.invokeStatic(core.clj:657)
	at clojure.main$main_opt.invokeStatic(main.clj:317)
	at clojure.main$main_opt.invoke(main.clj:313)
	at clojure.main$main.invokeStatic(main.clj:424)
	at clojure.main$main.doInvoke(main.clj:387)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:702)
	at clojure.main.main(main.java:37)

kirill.salykin09:12:58

but jar is created

kirill.salykin09:12:08

please advice what I am doing wrong

kirill.salykin09:12:41

pack version:

{pack/pack.alpha {:git/url ""
                                       :sha "ddbbdbd4001c75647deddaad0f8bb7dc954fcb6f"}}

kirill.salykin09:12:29

UPD: I switched to latest version in master and everything seems to work

kirill.salykin09:12:35

one thing tho - skinnyjar stucks if target directory contains prev version…

dominicm09:12:13

@kirill.salykin master is a pretty big rewrite of pack. This bug isn't terribly surprising 😊 What do you mean by "contains previous version"?

kirill.salykin09:12:36

if you run it twice in a row

kirill.salykin09:12:50

rm -rf ./target/*
clojure -A:pack mach.pack.alpha.skinny

dominicm09:12:10

@kirill.salykin what is the output in the case that it gets stuck? I expect a thread will error something?

kirill.salykin09:12:24

no output, just takes a lot of time

kirill.salykin09:12:35

more then 1 minute on machine

kirill.salykin09:12:45

i was not patient to wait longer…

dominicm09:12:50

Hmm. I'll try and debug that today. I'm not sure what could cause that.

kirill.salykin09:12:11

if you clean the target directory - everything works perfectly

dominicm09:12:47

Maybe there's something accidentally recursive.

kirill.salykin09:12:30

shall I create the issue?

dominicm10:12:13

Feel free, I'll try and get round to it today 🙂

kirill.salykin10:12:09

will do, thanks for your help!

dominicm10:12:15

@kirill.salykin I'm unable to reproduce what you're seeing 😟 I might need some more context, maybe it only happens under certain deps.edn files or something?

kirill.salykin10:12:55

I’ll try to create some minimal repro case

kirill.salykin10:12:01

thanks for looking

dominicm10:12:44

I'll mirror this on github 🙂 Not sure which channel you prefer for tracking this

dominicm10:12:18

fwiw, I tested against pack itself like this: clojure -m mach.pack.alpha.skinny --lib-dir /tmp/lib --project-path skinny.jar

kirill.salykin10:12:07

maybe it is something in our project

dominicm10:12:33

What does your :pack alias look like?

kirill.salykin11:12:44

hm

:pack {:extra-deps {pack/pack.alpha {:git/url ""
                                       :sha "4a00565dce29225a1dd2a810c438b90b14f9e111"}}
         :main-opts ["-m"]}}}

kirill.salykin11:12:54

I am bit confused with empty main-opts

kirill.salykin11:12:05

lemme try w/o main-opts at all

dominicm11:12:22

@kirill.salykin it really just saves you from typing -m 😄

kirill.salykin11:12:39

so it doesnt matter?

dominicm11:12:22

not particularly 🙂

kirill.salykin11:12:31

works on empty project I assume it is something within my project

dominicm11:12:36

if you can track down what's within your project, I'd be interested

kirill.salykin12:12:58

I’ll try, but later. It seems not urgent, also it is nice to clean target directory anyway (for outdated libs for instance) so not with rm -rf target/* it just works

kirill.salykin12:12:33

btw, pack dies if target directory not created

kirill.salykin14:12:12

Question regarding juxt/pack, do I understand correctly that using --lib-type keep with skinny-jar should keep clojure file in jar? the issue I see now that git dependency packed as empty jar (there is no gen-class) and clojure complaints that can find file on classpath

dominicm14:12:59

@kirill.salykin --lib-type keep means that any dependencies that are jars, will stay as jars, and git dependencies which are directories, will stay as directories.

kirill.salykin14:12:06

is it by design that git dependency packed into empty jar? or do I missing something in config?

dominicm14:12:39

that sounds wrong. I haven't seen that in my testing

kirill.salykin14:12:29

will try to create something that can reproduce the issue

dominicm14:12:12

@kirill.salykin my mistake, I've reproduced

dominicm14:12:14

working on it

mccraigmccraig14:12:16

i've got a lein-modules based project in a monorepo which has common deps in the top-level project.clj and per-module deps in each module subdirs own project.clj. it builds and tests all modules in a sensible (poset) order and correctly outputs versioned jars for each module - is there a way of achieving similar behaviour for deps.edn based project ?

dominicm14:12:50

@mccraigmccraig what's poset order? I would just loop over each directory with bash & use pack 😄

mccraigmccraig14:12:18

it figures out the correct order itself, based on the dependency graph

dominicm14:12:56

@kirill.salykin I've figured it out, dumb typo

dominicm14:12:47

@kirill.salykin Try 24863d1ff5a54bb7cc783ff62272212b51c8b316

kirill.salykin14:12:37

wow, it blazingly fast, thanks! trying

dominicm14:12:05

@kirill.salykin I go on holiday soon, and I've wrapped up work 🙂 I have a few spare cycles.

kirill.salykin14:12:07

yay! works! thanks

kirill.salykin15:12:50

btw, stuck issue seems fixed as well

dominicm15:12:38

oh, hmm :thinking_face:

dominicm15:12:40

¯\(ツ)

rpkarlsson19:12:07

I ran into some trouble using java9+ and Cider with deps. Deps builds abbreviated paths ("src", as specified in :paths) instead of full paths ("/home/rpkarlsson/Projects/mc-kartan/src/") as other classpath builders seem to do. Cider with java1.8 and lower determines the classpath in a different manner and is not effected by this. Are abbreviated paths something that could potentially lead to other problems and because of that should be fixed in deps or should abbreviated paths be expected in tooling? More info at: https://github.com/clojure-emacs/cider/issues/2533

dottedmag22:12:01

I've got the spaces work in :main-opts

timgilbert23:12:46

Looks reasonable to me, personally, though I'd prefer newlines to NUL characters.

pesterhazy23:12:01

¯\(ツ)

pesterhazy23:12:33

I’m not playing the game of uploading competing patches

Alex Miller (Clojure team)23:12:10

if there are competing approaches, please summarize the tradeoffs

Alex Miller (Clojure team)23:12:27

I need that to make decisions and I will have a slice of time to do so soon