Fork me on GitHub
#tools-deps
<
2020-03-13
>
Lone Ranger16:03:19

I'm back with more git issues

Lone Ranger16:03:37

Cloning: :team/repo.git
Error building classpath. [email protected]: USERAUTH fail
org.eclipse.jgit.api.errors.TransportException: [email protected]: USERAUTH fail
	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)

Lone Ranger16:03:47

trying to help a coworker get it running

Lone Ranger16:03:50

this is on mac

Lone Ranger16:03:01

so far we've done the following

Lone Ranger16:03:49

if [ -z "$SSH_AUTH_SOCK" ] ; then
      eval `ssh-agent -s`
      ssh-add
      ssh-add -k ~/.ssh/id_rsa # add keys -- did this for all private keys
      # add github keys
      ssh-keyscan -H -t rsa  >> ~/.ssh/known_hosts 
  fi

Lone Ranger16:03:13

git clone :team/repo.git works

ghadi16:03:16

do they also have ~/.ssh/config entries? @goomba

Lone Ranger16:03:49

I haven't checked -- is that important?

Lone Ranger16:03:08

there is no ssh config

Lone Ranger16:03:45

just kidding my mistake, there is

Lone Ranger16:03:47

renamed stuff and it worked

Lone Ranger16:03:19

how on earth did you know that

Alex Miller (Clojure team)16:03:00

what error are you getting?

Lone Ranger16:03:29

org.eclipse.jgit.api.errors.TransportException: [email protected]: USERAUTH fail

Lone Ranger16:03:54

it was tied to the .ssh/config somehow

Lone Ranger16:03:02

(it's working now, thank you @ghadi)

ghadi16:03:17

JSch, the underlying library used, tries to read the .ssh/config for some things instead of consulting the running ssh-agent

Lone Ranger16:03:37

I notice that https://github.com/clojure/tools.gitlibs says it supports: • Full sha (40 chars) • Prefix sha (sufficiently unique in the repo) • Tag name • Branch name

Lone Ranger16:03:58

I don't suppose :git/url supports tags/branches, and/or would a PR to that effect be welcome?

Lone Ranger16:03:45

I'm using this extensively and I have 11 (and growing) repos (we're using enterprise git so I can't publish to clojars) and being able to tags/branches would be nice

Alex Miller (Clojure team)16:03:32

so as above tools.gitlibs does support tags or branches

Alex Miller (Clojure team)16:03:50

clj intentionally supports only full shas

Lone Ranger16:03:09

because tags/branches are mutable ?

Alex Miller (Clojure team)16:03:19

yes, it totally breaks classpath caching

dominicm17:03:26

Well, tags are meant to be immutable. You have to force push them.

Alex Miller (Clojure team)17:03:17

you see how somebody else could break your build with that though, right?

dominicm17:03:40

Oh yeah. I wasn't sure how defensive we were being really. I understand that one changes future builds, and one is cryptographically difficult to change future builds. If you want cryptographic protection then it's okay.

dominicm18:03:34

Maven central do that through policy, but there's no requirement that happens though (I think)

Lone Ranger16:03:00

gotcha... bummer

Lone Ranger16:03:40

I guess including a "force recalculate" directive would be out of the question?

Alex Miller (Clojure team)16:03:59

that does exist (-Sforce) but you would need to basically do it on every clj call

Alex Miller (Clojure team)16:03:56

I would not rule out some way to support this use case, but would want to start from the big picture

Lone Ranger16:03:01

gotcha. I'm just trying to make the workflow for this work in a less error-prone way.

Alex Miller (Clojure team)16:03:38

the other similar but different thing people have been poking at is monorepo with embedded local deps

Lone Ranger17:03:47

I'm gonna DM you the details that I can't put here on what the situation is

Alex Miller (Clojure team)17:03:18

another you might want to consider is using a private shared repo (either something like nexus or even a private s3 repo)

Lone Ranger17:03:04

so for each of those repos you see ... every time I make a commit, I need to update the shas. And then I need to update the READMEs for each one. And god forbid they have dependencies on one another --- need to do all that by hand

Alex Miller (Clojure team)17:03:19

I get it - I've used a private shared repo in this situation

Lone Ranger17:03:36

is that like a "private clojars"?

Lone Ranger17:03:51

ok -- that would be a much better solution, yes

Alex Miller (Clojure team)17:03:53

maven repos can be just a file system

Alex Miller (Clojure team)17:03:02

and private s3 repos are exactly that

Lone Ranger17:03:21

I did not know that. How do you specify an alternate .m2?

Alex Miller (Clojure team)17:03:42

nexus is actually an app and can do a lot more for you (like mirroring all your external deps in case maven central is unavailable or something)

Alex Miller (Clojure team)17:03:51

you don't need an alternate .m2

Alex Miller (Clojure team)17:03:15

if you're asking separately, you can use a :mvn/local-repo key in your deps.edn

Lone Ranger17:03:27

innnteresting

Lone Ranger17:03:53

okay, thank you, I'll look into that. 🙏

Alex Miller (Clojure team)17:03:41

for deployment, you'll need something to make artifacts and deploy (really just an s3 copy) and there are some clj tools out there https://github.com/clojure/tools.deps.alpha/wiki/Tools

Lone Ranger17:03:59

which category on tools would that be under?

Lone Ranger17:03:13

versioning and releasing?

Alex Miller (Clojure team)17:03:40

making an artifact -> packaging

Alex Miller (Clojure team)17:03:10

but I guess also some of versioning and releasing

Lone Ranger17:03:31

no I meant a tool for where to host

Lone Ranger17:03:44

i.e. nexus or similar

Alex Miller (Clojure team)17:03:25

oh, I don't think you'll find that theree

Lone Ranger17:03:53

just making sure I'm not crazy

Alex Miller (Clojure team)17:03:57

but you could look at any maven repository docs. https://www.deps.co/ is built by Daniel Compton from the Clojure community

Lone Ranger17:03:04

😛 well I am technically a little @goomba

Alex Miller (Clojure team)17:03:43

I think there's a thing built into git too?

Lone Ranger17:03:17

yay that's a tool I'm actually allowed to use!

Alex Miller (Clojure team)17:03:38

just googling, not sure that particular article is the platonic ideal

Alex Miller (Clojure team)17:03:25

there's some tool for this too that I can't remember the name of

dharrigan17:03:46

I use Nexus OSS

lilactown19:03:01

a user reported an error trying to use git deps for a lib I wrote: https://github.com/Lokeh/helix/issues/5#issuecomment-598850716 does anyone know offhand, based on the message, whether this is a user error or something with my lib?

borkdude19:03:33

maybe he can try -Sforce?

hiredman20:03:10

they should delete .gitlibs/libs/helix

hiredman20:03:49

or maybe .gitlibs/libs/Lokeh/helix