tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
zane 2020-10-14T03:10:30.349700Z

Can anyone think of a reason why someone might be getting USERAUTH fail when using clj to attempt to fetch a public repository via https? šŸ˜•

alexmiller 2020-10-14T03:22:41.350100Z

If you could share a repro that would help

zane 2020-10-14T18:36:46.359Z

To close this loop, he had this in his ~/.gitconfig:

[url "git@github.com:"]
Ā Ā insteadOf =Ā <https://github.com/>

zane 2020-10-14T18:37:02.359200Z

Thanks, @alexmiller and @seancorfield!

seancorfield 2020-10-14T18:37:54.359400Z

Was he OK with removing that to get clj to work?

seancorfield 2020-10-14T18:38:32.359600Z

(I'm kind of curious as to why anyone would want all <https://github.com/> URLs to switch the ssh access version?)

zane 2020-10-14T18:51:30.359800Z

Iā€™m curious too!

zane 2020-10-14T18:51:33.360Z

Heā€™s at his day job at the moment, so I wonā€™t know more (why he had that in there, if heā€™s OK removing it) until this evening, probably.

1
alexmiller 2020-10-14T19:01:10.360300Z

:thumbsup:

zane 2020-10-15T03:32:54.371600Z

Confirmed that that was the issue. Thanks again. šŸ‘:skin-tone-2:

zane 2020-10-14T03:24:18.350300Z

Sure thing.

clj -Sdeps '{:deps {probcomp/metaprob {:git/url "<https://github.com/probcomp/metaprob.git>" :sha "8dc9d09f747c1e29886bb9628a0110c6f6bc6f5a"}}}'

zane 2020-10-14T03:24:25.350500Z

Works for me. Fails for my colleague.

zane 2020-10-14T03:24:35.350700Z

Iā€™ll get you the exact message.

zane 2020-10-14T03:25:57.350900Z

Hereā€™s what heā€™s seeing: https://a.cl.ly/llu2n0yR

zane 2020-10-14T03:26:11.351200Z

Iā€™m confused as to why it appears to be attempting to fetch via git ssh.

alexmiller 2020-10-14T03:29:24.351400Z

well it's a git dep

seancorfield 2020-10-14T03:29:56.351600Z

FWIW, that command-line works fine for me on WSL2 (Ubuntu) on Windows 10 and also on macOS 10.12.

seancorfield 2020-10-14T03:31:01.351800Z

Can't test it on Powershell since I don't have the Clojure CLI installed on Windows natively any more.

alexmiller 2020-10-14T03:32:16.352Z

I agree though that it does look like it's trying to use ssh though

seancorfield 2020-10-14T03:32:22.352200Z

@alexmiller Where could the jgit stuff be getting auth from that might cause a failure with a public git repo?

alexmiller 2020-10-14T03:32:44.352400Z

it's not that that it's not getting auth but that it's looking for it in the first place

zane 2020-10-14T03:50:51.353Z

> well itā€™s a git dep Sorry, what I meant was: Iā€™m confused that it appears to be trying to fetch via SSH.

zane 2020-10-14T03:51:02.353200Z

Perhaps Iā€™m reading this output wrong?

alexmiller 2020-10-14T03:52:41.353600Z

is there any chance that they have a ~/.gitconfig with a url.<base>.insteadOf set?

alexmiller 2020-10-14T03:53:43.353800Z

that allows you to direct git to use a different url instead of the original one and can be used to swap https for ssh urls

seancorfield 2020-10-14T03:53:54.354Z

Or perhaps they have a deps.edn file in that directory that already specifies that library via git@github?

alexmiller 2020-10-14T03:54:38.354200Z

the -Sdeps is merged last so that shouldn't affect anything

seancorfield 2020-10-14T03:54:44.354400Z

(they're running that command in their downloads folder so who knows what is in there)

zane 2020-10-14T03:55:03.354600Z

Yeah, itā€™s possible.

zane 2020-10-14T03:55:16.354800Z

Iā€™ll ask.

alexmiller 2020-10-14T03:55:22.355Z

should look for [url "git@github.com:"] and then an insteadOf line in /.gitconfig - something like that

zane 2020-10-14T03:56:01.355300Z

Got it.

alexmiller 2020-10-14T04:00:13.355700Z

[url "git@github.com:"]
	insteadOf = <https://github.com/>

alexmiller 2020-10-14T04:00:19.355900Z

I was able to repro with that

zane 2020-10-14T04:00:22.356100Z

Seems like heā€™s signed off. Iā€™ll check back in when I can get ahold of him again.

zane 2020-10-14T04:00:33.356300Z

I see! Hopefully thatā€™s the culprit.

zane 2020-10-14T04:00:42.356500Z

Thanks for the help!

alexmiller 2020-10-14T04:01:00.356700Z

could even be more generic like:

alexmiller 2020-10-14T04:01:01.356900Z

[url "git://"]
        insteadOf = https://

alexmiller 2020-10-14T04:01:24.357100Z

can't say I've ever messed with that config before!

zane 2020-10-14T04:02:30.357300Z

Yeah, me either.

zane 2020-10-14T04:03:21.357500Z

The colleague having the issue is wanting to do some volunteer work on some of our private repositories, and I suspect he probably has a lot going on in his ~/.ssh/config from his job.

zane 2020-10-14T04:05:27.357900Z

From talking to Ghadi earlier I know how to set up a new machine for use with clj + private repositories, but Iā€™m not clear yet on how to configure a machine that has a lot of extant ~/.ssh/config settings.

alexmiller 2020-10-14T04:06:53.358100Z

well, the answer is probably ... it depends

zane 2020-10-14T04:07:08.358300Z

For instance, I know that because of JSch clj doesnā€™t play well with IdentityFile declarations, and should instead be set up to read keys from the ssh-agent, but I donā€™t think I can ask this person to change their ~/.ssh/config in a way that might impact their work setup.

zane 2020-10-14T04:08:09.358500Z

> it depends Yeah, I suppose thereā€™s no way out but through. Iā€™m going to have to understand what their existing ~/.ssh/config settings are doing in detail.

PB 2020-10-14T19:18:22.360700Z

What's the equivalent of lein install with deps.edn?

seancorfield 2020-10-14T19:29:12.361Z

clojure -X:deps mvn-install

šŸ™ 1
seancorfield 2020-10-14T19:29:44.361600Z

(you'll probably need to generate a pom.xml file first -- I can't remember)

seancorfield 2020-10-14T19:29:56.361900Z

Oh, and that's assuming you're on 1.10.1.697 or later.

dominicm 2020-10-14T19:33:28.363200Z

@alexmiller how safe is it to rely on tdeps putting src/main/clojure on the classpath indefinitely?

seancorfield 2020-10-14T19:34:36.363700Z

@dominicm I didn't think it did? :paths ["src"] is in the system deps

dominicm 2020-10-14T19:36:01.364300Z

Oops, via pom.xml*

alexmiller 2020-10-14T20:06:58.364800Z

I'm confused by what you mean

alexmiller 2020-10-14T20:07:31.364900Z

no, you don't - you can either rely on the pom inside the jar or supply the g/a/v externally

alexmiller 2020-10-14T20:07:43.365100Z

or supply the pom

1
dominicm 2020-10-14T20:21:13.366300Z

@alexmiller there's always src/main/clojure added when doing a local/root to a pom.xml right now.

alexmiller 2020-10-14T21:46:20.367800Z

So local dep with pom.xml

alexmiller 2020-10-14T21:46:36.368200Z

Not planning to change that

šŸ‘ 1