Fork me on GitHub
#tools-deps
<
2019-11-05
>
Alex Miller (Clojure team)04:11:05

if anyone has clj on windows and can check https://ask.clojure.org/index.php/8820/why-does-not-merge-deps-across-multiple-aliases-in-tools-deps, that would be cool. I tried it with this deps.edn on mac and couldn't repro:

{:aliases
 {:a {:extra-deps {org.clojure/data.xml {:mvn/version "0.2.0-alpha6"}}}
  :b {:extra-deps {org.clojure/data.json {:mvn/version "0.2.6"}}}}}

seancorfield04:11:01

Taking a look...

seancorfield04:11:47

There's definitely something odd going on:

PS C:\var\www\async.http\sketch> clojure -R:a -R:b -Spath
src;C:\Users\seanc\.m2\repository\org\clojure\clojure\1.10.1\clojure-1.10.1.jar;C:\Users\seanc\.m2\repository\org\clojure\data.xml\0.2.0-alpha6\data.xml-0.2.0-alpha6.jar;C:\Users\seanc\.m2\repository\org\clojure\data.json\0.2.6\data.json-0.2.6.jar;C:\Users\seanc\.m2\repository\org\clojure\spec.alpha\0.2.176\spec.alpha-0.2.176.jar;C:\Users\seanc\.m2\repository\org\clojure\core.specs.alpha\0.2.44\core.specs.alpha-0.2.44.jar;C:\Users\seanc\.m2\repository\org\clojure\data.codec\0.1.0\data.codec-0.1.0.jar
PS C:\var\www\async.http\sketch> clojure -A:a -A:b -Spath
src;C:\Users\seanc\.m2\repository\org\clojure\clojure\1.10.1\clojure-1.10.1.jar;C:\Users\seanc\.m2\repository\org\clojure\data.xml\0.2.0-alpha6\data.xml-0.2.0-alpha6.jar;C:\Users\seanc\.m2\repository\org\clojure\data.json\0.2.6\data.json-0.2.6.jar;C:\Users\seanc\.m2\repository\org\clojure\spec.alpha\0.2.176\spec.alpha-0.2.176.jar;C:\Users\seanc\.m2\repository\org\clojure\core.specs.alpha\0.2.44\core.specs.alpha-0.2.44.jar;C:\Users\seanc\.m2\repository\org\clojure\data.codec\0.1.0\data.codec-0.1.0.jar
PS C:\var\www\async.http\sketch> clojure -Sforce -A:a -A:b -Spath
WARNING: Specified aliases are undeclared: [:a ]
src;C:\Users\seanc\.m2\repository\org\clojure\clojure\1.10.1\clojure-1.10.1.jar;C:\Users\seanc\.m2\repository\org\clojure\data.json\0.2.6\data.json-0.2.6.jar;C:\Users\seanc\.m2\repository\org\clojure\spec.alpha\0.2.176\spec.alpha-0.2.176.jar;C:\Users\seanc\.m2\repository\org\clojure\core.specs.alpha\0.2.44\core.specs.alpha-0.2.44.jar
PS C:\var\www\async.http\sketch> clojure -Sforce -R:a -R:b -Spath
WARNING: Specified aliases are undeclared: [:a ]
src;C:\Users\seanc\.m2\repository\org\clojure\clojure\1.10.1\clojure-1.10.1.jar;C:\Users\seanc\.m2\repository\org\clojure\data.json\0.2.6\data.json-0.2.6.jar;C:\Users\seanc\.m2\repository\org\clojure\spec.alpha\0.2.176\spec.alpha-0.2.176.jar;C:\Users\seanc\.m2\repository\org\clojure\core.specs.alpha\0.2.44\core.specs.alpha-0.2.44.jar
PS C:\var\www\async.http\sketch>

seancorfield04:11:50

I got the same results from -R and -A tho' in all cases (including -A:a:b and -R:a:b, not shown) but with -Sforce, the first alias is somehow not found...

seancorfield04:11:08

After running that -Sforce variant, running the command without -Sforce is now behaving as if :a was not included.

Alex Miller (Clojure team)04:11:38

that extra space in [:a ] is probably important - I presume that's causing the alias not to be found there

seancorfield04:11:18

PS C:\var\www\async.http\sketch> clojure -R:a:b -Spath
src;C:\Users\seanc\.m2\repository\org\clojure\clojure\1.10.1\clojure-1.10.1.jar;C:\Users\seanc\.m2\repository\org\clojure\data.json\0.2.6\data.json-0.2.6.jar;C:\Users\seanc\.m2\repository\org\clojure\spec.alpha\0.2.176\spec.alpha-0.2.176.jar;C:\Users\seanc\.m2\repository\org\clojure\core.specs.alpha\0.2.44\core.specs.alpha-0.2.44.jar
PS C:\var\www\async.http\sketch> clojure -R:b:a -Spath
src;C:\Users\seanc\.m2\repository\org\clojure\clojure\1.10.1\clojure-1.10.1.jar;C:\Users\seanc\.m2\repository\org\clojure\data.json\0.2.6\data.json-0.2.6.jar;C:\Users\seanc\.m2\repository\org\clojure\data.xml\0.2.0-alpha6\data.xml-0.2.0-alpha6.jar;C:\Users\seanc\.m2\repository\org\clojure\spec.alpha\0.2.176\spec.alpha-0.2.176.jar;C:\Users\seanc\.m2\repository\org\clojure\core.specs.alpha\0.2.44\core.specs.alpha-0.2.44.jar;C:\Users\seanc\.m2\repository\org\clojure\data.codec\0.1.0\data.codec-0.1.0.jar
Note that swapping the aliases produces the correct result (since it's treated as a new invocation)

seancorfield04:11:27

Then I ran it with -Sforce -R:a:b and got the correct behavior back. So I'm suspecting a problem with parsing options if -Sforce is used?

seancorfield04:11:09

Yeah, almost certainly something about -Sforce messing up alias parsing or combining somehow based on further experiments.

seancorfield04:11:29

That's with PS 1.10.1.469 BTW.

seancorfield04:11:59

And it's peculiar to the PS script. The exact same sequences of commands on Linux just work.

seancorfield04:11:03

(how did he get .483 on Windows? I tried scoop update clojure and it thinks .469 is the latest... maybe the wiki page has not been updated?)

Alex Miller (Clojure team)04:11:15

I updated the wiki page

Alex Miller (Clojure team)04:11:08

I don't anything about the scoop thing though

seancorfield04:11:20

Yeah, the scoop script is supposed to use that link in that page to pick up a newer version...

Alex Miller (Clojure team)04:11:56

I wouldn't expect these to differ in this though

Alex Miller (Clojure team)04:11:06

so it's likely same in 483

seancorfield04:11:19

Fair enough. Now I'm still puzzled about the scoop update process 🙂 I'll open an issue...

Alex Miller (Clojure team)04:11:27

I assume these are bugs in the ps script

seancorfield04:11:48

Interesting. Now I've managed to get this in a clean folder without using -Sforce:

PS C:\var\www\async.http\sketch> clojure -A:a -A:b
WARNING: Specified aliases are undeclared: [:a ]
Clojure 1.10.1
user=>

seancorfield04:11:04

That makes a bit more sense given the report on ask...

Alex Miller (Clojure team)04:11:55

[:a ] has an extra space which I assume is the problem

seancorfield04:11:13

I suspect the default conversion for multi-element collections is to have spaces between the elements.

Alex Miller (Clojure team)04:11:49

the tools.deps code splits on colons, so could easily end up with keywords with spaces in them

seancorfield04:11:52

So

$ToolsArgs += "-R$($ResolveAliases -join '')"
etc

seancorfield04:11:21

Yup, that's the fix. I just updated my .psm1 script to have that and it works as expected now.

seancorfield04:11:53

All of those $ToolsArgs += lines need that...

Alex Miller (Clojure team)04:11:33

ok, there's a windows build out there at .486 now

seancorfield04:11:54

Wiki page updated?

Alex Miller (Clojure team)05:11:55

heading to bed, thx for the help

4
andy.fingerhut05:11:16

I tried installing Homebrew then brew install clojure on a couple of Ubuntu Linux VMs with different versions, and they both installed version 1.10.1.478 still. brew update clojure on my Mac upgraded to 1.10.1.483, so perhaps Homebrew Linux is taking longer to update package info somewhere?

seancorfield03:11:21

@U0CMVHBL2 FWIW, I installed brew on Ubuntu (actually WSL on Windows 10), and then brew install clojure installed 1.10.1.483.

andy.fingerhut03:11:25

Cool. I will check on an Ubuntu Linux system again soon and report back, to see if it gets the latest version now.

andy.fingerhut05:11:22

Strangely enough, though, brew install clojure worked fine on those Linux machines, with no problem finding a working version of ruby executable to do what it needed to install the clojure thingy (replace "thingy" with correct Homebrew term, whatever that is)

Alex Miller (Clojure team)12:11:54

Maybe Linux brew is downstream somehow

seancorfield21:11:56

Another Windows glitch? Can someone else on Windows PowerShell confirm/deny this for me?

PS C:\Users\sean> clojure -Sdescribe
{:version "1.10.1.486"
 :config-files ["C:\Users\sean\scoop\modules\ClojureTools\deps.edn" "C:\Users\sean\.clojure\deps.edn" "deps.edn"]
 :config-user "C:\Users\sean\.clojure\deps.edn"
 :config-project "deps.edn"
when run in a folder that does not have deps.edn it still reports it in describe and as the :config-project path. The macOS/Linux version displays it as :config-project (which still seems wrong) but correctly omits it from the :config-files path.

Alex Miller (Clojure team)21:11:36

The behavior in Mac is right - it’s telling you where it’s looking

Alex Miller (Clojure team)21:11:52

config-files is not actually used now

Alex Miller (Clojure team)21:11:59

The Clojure code will do the right thing if it’s missing

seancorfield22:11:39

OK, so a small glitch in the PS script but not an important one.

seancorfield22:11:20

macOS

(! 720)-> clojure -Sdescribe
{:version "1.10.1.483"
 :config-files ["/usr/local/Cellar/clojure/1.10.1.483/deps.edn" "/Users/sean/.clojure/deps.edn" ]
 :config-user "/Users/sean/.clojure/deps.edn"
 :config-project "deps.edn"

seancorfield22:11:14

Given that tooling should no longer be running clojure -Sdescribe via (clojure-env), and such tooling was broken on Windows anyway(!), I agree that nothing really needs to be done. It's just slightly odd to look at.

Alex Miller (Clojure team)22:11:36

config-files is not even passed to the script anymore

4