Fork me on GitHub
#tools-deps
<
2020-06-25
>
danielcompton09:06:35

Does tools-deps support specifying version ranges? I couldn’t see anything about it. It looks like it supports it when reading a POM as a transitive dependency

dominicm11:06:09

I'm pretty sure it doesn't

dominicm11:06:53

It just gets the highest version in the range

murtaza5214:06:20

I have put my aliases in the ~/.clojure/deps.edn file (I am suing the dot file from seancorfield), but when I try to call clj -A:new app test/one , I get the following error -

Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
app (No such file or directory)

Full report at:
/tmp/clojure-3392454598929432067.edn
It seems it is not able to find the alias, because when I inline the alias and call the command it works. Why is it not recognizing the ~/.clojure/deps.edn file ?

seancorfield15:06:12

@murtaza52 Did you also get this WARNINg about that error message?

WARNING: Specified aliases are undeclared: [:new]
What does clojure -Sdescribe show for you?

murtaza5215:06:44

~ >>> clojure -Sdescribe                                                    [1]
{:version "1.10.1.536"
 :config-files ["/usr/local/lib/clojure/deps.edn" "/home/murtaza52/.config/clojure/deps.edn" ]
 :config-user "/home/murtaza52/.config/clojure/deps.edn"
 :config-project "deps.edn"
 :install-dir "/usr/local/lib/clojure"
 :config-dir "/home/murtaza52/.config/clojure"
 :cache-dir "/home/murtaza52/.config/clojure/.cpcache"
 :force false
 :repro false
 :resolve-aliases ""
 :classpath-aliases ""
 :jvm-aliases ""
 :main-aliases ""
 :all-aliases ""}

murtaza5215:06:14

@seancorfield No I did not get that warning

murtaza5215:06:55

I moved the file /.clojure/deps.edn to /.config/clojure/deps.edn, but I am still getting the same output as above.

seancorfield15:06:46

How did you install the Clojure CLI tools? I've never seen it try to use ~/.config/clojure as the user-level location...

seancorfield15:06:38

What O/S is this on? What is your HOME environment variable? (`echo $HOME`)

murtaza5215:06:08

~ >>> echo $HOME /home/murtaza52

borkdude15:06:17

this is caused by xdg-config stuff on linux right

murtaza5215:06:23

This is manjaro linux

murtaza5215:06:00

sorry I m still lost, how should I fix it ? where does that deps.clj go ?

seancorfield15:06:21

It's a separate tool. He's just showing that the XDG thing is a problem.

murtaza5215:06:49

this is a new install of manjaro without a DE, I had installed it before with DE and it worked fine.

borkdude15:06:54

yeah, I should point to the bash script, this is a clojure port of it

borkdude15:06:06

can you do echo $XDG_CONFIG_HOME?

murtaza5215:06:11

this one just bspwm as the tiling manager

murtaza5215:06:52

~ >>> echo $XDG_CONFIG_HOME /home/murtaza52/.config

borkdude15:06:54

and then try with the -Sforce with your changes in place

borkdude15:06:09

yes, so it will look for /home/.../.config/clojure/deps.edn

murtaza5215:06:15

but in already has a dir called /.config/clojure , should I replace it with /.config/.clojure ?

borkdude15:06:14

no sorry, without the dot, it was a typo on my behalf

borkdude15:06:45

and then re-try your action with -Sforce

murtaza5215:06:07

what does sforce do ? yes it worked !

bananadance 3
borkdude15:06:18

it ignores a cached file

murtaza5215:06:55

cool thanks !

seancorfield15:06:15

New topic: tools.deps.alpha ignores :scope in a coordinate, yes? That's a Maven thing that Lein/Boot support but is not relevant for deps.edn...?

seancorfield16:06:39

Hahaha... well, someone opened a bug against depstar about it putting :scope "provided" dependencies into the JAR and when I created a quick test to check the classpath clojure -Spath in a new project with a :scope "provided" dependency, yes, it's on the classpath so this is t.d.a behavior.

souenzzo17:06:16

hello. I'm trying to use git deps with aws codecommit, inside a ec2 instance but I get Error building classpath. : Authentication is required but no CredentialsProvider has been registered but when I (inside the ec2 instance) git clone it works Anyone else using tools_deps + codecommit? (stacktrace on comment)

souenzzo17:06:26

Cloning: 
Error building classpath. : Authentication is required but no CredentialsProvider has been registered
org.eclipse.jgit.api.errors.TransportException: : Authentication is required but no CredentialsProvider has been registered
        at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:248)
        at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:306)
        at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:200)
        at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:89)
        at clojure.tools.gitlibs.impl$call_with_auth.invokeStatic(impl.clj:50)
        at clojure.tools.gitlibs.impl$call_with_auth.invoke(impl.clj:41)
        at clojure.tools.gitlibs.impl$git_clone_bare.invokeStatic(impl.clj:71)
        at clojure.tools.gitlibs.impl$git_clone_bare.invoke(impl.clj:68)
        at clojure.tools.gitlibs.impl$ensure_git_dir.invokeStatic(impl.clj:110)
        at clojure.tools.gitlibs.impl$ensure_git_dir.invoke(impl.clj:100)
        at clojure.tools.gitlibs$resolve.invokeStatic(gitlibs.clj:33)
        at clojure.tools.gitlibs$resolve.invoke(gitlibs.clj:29)
        at clojure.tools.gitlibs$procure.invokeStatic(gitlibs.clj:47)
        at clojure.tools.gitlibs$procure.invoke(gitlibs.clj:41)
        at clojure.tools.deps.alpha.extensions.git$eval999$fn__1001.invoke(git.clj:41)
        at clojure.lang.MultiFn.invoke(MultiFn.java:239)
        at clojure.tools.deps.alpha$expand_deps.invokeStatic(alpha.clj:189)
        at clojure.tools.deps.alpha$expand_deps.invoke(alpha.clj:169)
        at clojure.tools.deps.alpha$resolve_deps.invokeStatic(alpha.clj:237)
        at clojure.tools.deps.alpha$resolve_deps.invoke(alpha.clj:217)
        at clojure.tools.deps.alpha.script.make_classpath2$create_classpath.invokeStatic(make_classpath2.clj:55)
        at clojure.tools.deps.alpha.script.make_classpath2$create_classpath.invoke(make_classpath2.clj:47)
        at clojure.tools.deps.alpha.script.make_classpath2$run_core.invokeStatic(make_classpath2.clj:81)
        at clojure.tools.deps.alpha.script.make_classpath2$run_core.invoke(make_classpath2.clj:72)
        at clojure.tools.deps.alpha.script.make_classpath2$run.invokeStatic(make_classpath2.clj:101)
        at clojure.tools.deps.alpha.script.make_classpath2$run.invoke(make_classpath2.clj:95)
        at clojure.tools.deps.alpha.script.make_classpath2$_main.invokeStatic(make_classpath2.clj:146)
        at clojure.tools.deps.alpha.script.make_classpath2$_main.doInvoke(make_classpath2.clj:118)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.lang.Var.applyTo(Var.java:705)
        at clojure.core$apply.invokeStatic(core.clj:665)
        at clojure.main$main_opt.invokeStatic(main.clj:514)
        at clojure.main$main_opt.invoke(main.clj:510)
        at clojure.main$main.invokeStatic(main.clj:664)
        at clojure.main$main.doInvoke(main.clj:616)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.lang.Var.applyTo(Var.java:705)
        at clojure.main.main(main.java:40)
Caused by: org.eclipse.jgit.errors.TransportException: : Authentication is required but no CredentialsProvider has been registered
        at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:530)
        at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:345)
        at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:137)
        at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:123)
        at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1269)
        at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:237)
        ... 37 more

hiredman17:06:59

jgit may not support whatever authentication method git is using there

ghadi17:06:16

you need to use ssh auth, not https

souenzzo18:06:09

https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_ssh-keys.html To use ssh, i need to create a key and autorize it. That's the path @U050ECB92?

ghadi18:06:50

and put the key in an ssh-agent

souenzzo20:06:26

@U050ECB92 that't not aplicable once I'm trying to use LaunchConfig

murtaza5219:06:45

If I am using a template to generate a project, and the template has changed, will just using -Sforce force the new template to be retrieved ?

seancorfield19:06:53

No. The template is only used when the project is first created.

seancorfield19:06:17

After that, it's just "your project" and no longer related to the template.

murtaza5219:06:16

nope want to create a new project with the template, and the template was recently updated, how do I ensure that the updated template from clojars will be pulled for the new project ?

seancorfield19:06:56

By default, clj-new always uses the most recent stable version of a template.

seancorfield19:06:56

Per the clj-new documentation (README), you can override that behavior:

-S or --snapshot -- look for -SNAPSHOT version of the template (not just a release version)
-v or --verbose -- enable debugging -- be verbose! -vv and -vvv are increasingly verbose
-V or --version, followed by a version -- use this specific version of the template

dvingo22:06:16

@seancorfield I'm trying to debug the template @murtaza52 is using - is there a way to determine what clj-new will interpret as the "most recent version" I read through this: https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm#MAVEN8855 and this answer (https://stackoverflow.com/questions/13004443/how-does-maven-sort-version-numbers) led me to org.apache.maven.artifact.versioning.ComparableVersion I tried deploying new versions that I confirmed ComparableVersion should sort as "new" but I'm not seeing them when I try using the template

seancorfield22:06:23

@danvingo It will use whatever version t.d.a. would select if it were a dependency with a "RELEASE" version.

seancorfield22:06:35

What is the template you're trying to work with?

dvingo22:06:48

I wanted to use dates as the versions... I'm just learning about the wonderful world of maven version semantics

seancorfield22:06:48

I posted the options above that would let you do that.

seancorfield22:06:56

When I tried it -- having never looked at that template before -- here's what I got:

(! 709)-> clj -A:new dv.fulcro-template dvingo/example -vvv
Downloading: dv/fulcro-template/clj-template/maven-metadata.xml from clojars
Output from locating template:
Downloading: dv/fulcro-template/clj-template/2020-06-25-4/clj-template-2020-06-25-4.pom from clojars
Downloading: dv/fulcro-template/clj-template/2020-06-25-4/clj-template-2020-06-25-4.jar from clojars

Generating fresh 'clj new' dv.fulcro-template project.

dvingo22:06:11

ah thank you! sorry I overlooked that

seancorfield22:06:59

And here's how to pull down specific versions:

(! 714)-> clj -A:new dv.fulcro-template dvingo/example -V 2020-06-25-4
Generating fresh 'clj new' dv.fulcro-template project.

Thu Jun 25 15:09:24
(sean)-(jobs:0)-(~/clojure)
(! 715)-> clj -A:new dv.fulcro-template dvingo/example2 -V 2020.06.3
Generating fresh 'clj new' dv.fulcro-template project.

Thu Jun 25 15:09:55
(sean)-(jobs:0)-(~/clojure)
(! 716)-> clj -A:new dv.fulcro-template dvingo/example3 -V 2020-06-25-3
Generating fresh 'clj new' dv.fulcro-template project.

Thu Jun 25 15:10:29
(sean)-(jobs:0)-(~/clojure)
(! 717)-> clj -A:new dv.fulcro-template dvingo/example1 -V 1.0.0
Generating fresh 'clj new' dv.fulcro-template project.

Thu Jun 25 15:10:41
(sean)-(jobs:0)-(~/clojure)
(! 718)-> 

dvingo22:06:10

hmm, I'm on a machine that has prior versions of the template in .m2 and I'm not seeing what you're seeing:

$ clj -A:new dv.fulcro-template dvingo/example -vvv
Output from locating template:

Generating fresh 'clj new' dv.fulcro-template project.

seancorfield22:06:19

Well, you won't see any output if it doesn't have to download anything.

dvingo22:06:02

It at some point stopped downloading the newest versions:

Thu Jun 25, 2020 18:05:15:~/.m2/repository/dv/fulcro-template/clj-template ()
$ l
total 24
drwxr-xr-x  9 default  staff   288B Jun 25 18:12 ./
drwxr-xr-x  5 default  staff   160B Jun  3 13:01 ../
drwxr-xr-x  7 default  staff   224B Jun 23 21:47 2020-06-23-2/
drwxr-xr-x  7 default  staff   224B Jun 25 13:31 2020-06-24/
drwxr-xr-x  7 default  staff   224B Jun 25 13:56 2020-06-25/
drwxr-xr-x  7 default  staff   224B Jun 25 14:05 2020-06-25-2/
-rw-r--r--  1 default  staff   918B Jun 25 14:05 maven-metadata-clojars.xml
-rw-r--r--  1 default  staff    40B Jun 25 14:05 maven-metadata-clojars.xml.sha1
-rw-r--r--  1 default  staff   280B Jun 25 18:12 resolver-status.properties

seancorfield22:06:15

I think t.d.a. only checks once per day for releases.

seancorfield22:06:12

It's very unusual to have multiple releases on the same day. Even with snapshots.

seancorfield22:06:07

If you blow away ~/.m2/repository/dv/fulcro-template/clj-template then it should download whatever is the latest version.

dvingo22:06:10

yea that makes sense to save time for the usual case. I wasn't aware of how the interaction with maven occurred - thanks for the help! deleting the dir from the .m2 repo made it pull the latest

seancorfield22:06:21

Yup, that 🙂

seancorfield22:06:02

Like I said above, you can always use the -V / --version option to download a specific version.

dvingo22:06:30

right -thanks again!

seancorfield22:06:12

You may be able to use a version range like this -V '[0,)' but, again, Aether (the Maven-stuff underneath t.d.a.) may only check once a day.

seancorfield22:06:39

(FWIW, I downloaded 2020-06-25-2 per your directory listing above, then used [0,) and it did pull down 2020-06-25-4... @danvingo

seancorfield22:06:13

So it may be that the range checks every time? (maybe a Maven expert can confirm/deny that?)

dvingo22:06:36

gotcha - my main use case is template users and not wanting to have them specify versions i'll just use ComparableVersion at the repl before sending a new version 🙂

seancorfield22:06:51

(hard to tell -- having pulled down the -2 version, running it without a version still pulled down -4 for me, based on RELEASE instead)

seancorfield22:06:20

If you're not doing more than one release a day, I suspect you won't have a problem 🙂

dvingo22:06:30

perfect, thanks!

seancorfield22:06:11

One final thing @danvingo if you use the -S option, it uses a version range of (0.0.0,)

dvingo22:06:59

ahh good to know. I think the convention I wanted to use is working - 2020-06-25 compares -1 to 2020-06-25-1 and 2020-06-25-1 comes before 2020-06-25-2 so looks like the issue was maven not being checked by t.d.a. and not version sorting

seancorfield22:06:45

This is partly why I've moved to MAJOR.MINOR.COMMITS so I don't have to worry about that. COMMITS is always increasing.

dvingo22:06:19

makes sense - I just want to do my part to help kill semantic(less) versioning (I know you're not following that, per the note in the readme, but it still follows the syntax)

seancorfield22:06:31

Agreed. There are plenty of ways to do it. YYYY-MM-DD.SEQ is as good as any -- and there are plenty of libraries out there, even in the Java world, that use date/time versions instead of semantic(less) versioning (I like that term... Imma gonna stealz it!)