Fork me on GitHub
#tools-deps
<
2019-10-25
>
borkdude10:10:51

can I specify a src folder for a local/root with a pom.xml (it's a boot project)

borkdude10:10:10

somehow the source path doesn't show up in the pom.xml and when I run clojure -Spath it returns src/main/clojure

borkdude10:10:36

the library is called dre.common and this is on my classpath: /Users/borkdude/dre/DocSearch/common/src/main/clojure

borkdude10:10:24

Adding "../common/src" to the extra-paths works, but not sure if that's the right way

delaguardo12:10:47

I have some problem trying to reposition library coordinates: Library A’s deps.edn file

{:deps {B {:mvn/version "1"}}}
Library B’s deps.edn file
{:deps {C {:mvn/version "1"}}}
Library C’s deps.edn file
{:deps {}}
All version exists and can be resolved Then I want to use git version of C library in A Updated deps.edn for lib A:
{:deps {B {:mvn/version "1"}
        C {:git/url ""
           :sha "commit-sha"}}}
I’m expecting git version to take precedence in resolved dependency tree. Instead I got an error: Error building classpath. Unable to compare versions for C: {:mvn/version "1", :deps/manifest :mvn} and {:git/url "", :sha "commit-sha", :deps/manifest :deps, :deps/root "/home/user/.gitlibs/libs/C/commit-sha"} Looks like a bug in clojure-cli for me. Happy to file a ticket if anybody can confirm (or agree) that this is a bug

Alex Miller (Clojure team)12:10:39

there is a ticket already I think for being unable to compare versions for the same library across different coordinate types

Alex Miller (Clojure team)12:10:17

I have not read the above carefully, just going by the error

delaguardo12:10:17

To summarize all above: main problem that I’m trying to override dependency coordinate by adding it in top-level dep.edn. That is working fine within the same coordinate type (maven and git) but fails when I need git dependency to overtake maven. So yes, I think adding ability to compare different coordinate types should solve it

skapoor10:10:35

Hi @U04V4KLKC, were you able to find a work around for this?

Alex Miller (Clojure team)12:10:47

yes, this has not yet been implemented

Alex Miller (Clojure team)12:10:58

although I've thought about it a lot and know what to do

delaguardo12:10:03

nice! thanks

delaguardo12:10:35

also I’m happy to help if you don’t mind to share you ideas around it

gphilipp13:10:03

Not sure if it’s of any interest to anybody, but I’ve this small one-liner which pretty-print an EDN form in the clipboard:

clojure -Sdeps '{:deps {mvxcvi/puget {:mvn/version "1.2.0"}}}' -e "(require '[puget.printer :as puget]) (puget/cprint (read-string (first *command-line-args*)))"  $(mktemp) "$(pbpaste)"
I’m not sure why the first arg needs to be a file since I’m using the -e option (maybe https://clojure.atlassian.net/browse/TDEPS-56) but well, it works.

borkdude14:10:45

@U050S183X if you're interested in a tool with milliseconds startup time:

$ jet --pretty <<< "$(pbpaste)"
{:a 1, :b 2, :c 3}

gphilipp14:10:15

Nice ! Is there an option for color highlighting, as this is why I’m using the command above ? For speed, I use https://github.com/kkinnear/zprint/blob/master/doc/filter.md#appcds-version with echo pbpaste | zprint, it’s also compiled with GraalVM.

borkdude14:10:05

jet doesn't have colors yet.

andy.fingerhut18:10:43

Is there some kind of option to clj/clojure commands to cause them to show the java commands they execute?

seancorfield19:10:47

bash -x clojure <args>

seancorfield19:10:14

(that shows "everything" but it does show the java command as well 🙂 )

seancorfield19:10:49

bash -x clojure
...
+ exec /usr/bin/java -Dclojure.libfile=.cpcache/1562564545.libs -classpath src:/Users/sean/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar:/Users/sean/.m2/repository/org/clojure/spec.alpha/0.2.176/spec.alpha-0.2.176.jar:/Users/sean/.m2/repository/org/clojure/core.specs.alpha/0.2.44/core.specs.alpha-0.2.44.jar clojure.main
Clojure 1.10.1
user=> 

seancorfield19:10:28

(you can't do bash -x clj ... because it doesn't pass -x into clojure when it runs it via rlwrap)

andy.fingerhut19:10:58

Huh, didn't know about -x option to bash. Looks generally useful for all bash scripts.

seancorfield19:10:10

Yeah, I use it a lot for debugging scripts.

andy.fingerhut20:10:28

I mean, I knew about the set -x command by editing my own bash scripts to debug them, and sometimes did that on things owned by root if I had the permission, but nice that it can also be done without editing the script.

sogaiu23:10:58

is there something comparable for powershell?