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

I'm back with more git issues

unbalanced16: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)

unbalanced16:03:47

trying to help a coworker get it running

unbalanced16:03:50

this is on mac

unbalanced16:03:01

so far we've done the following

unbalanced16: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

unbalanced16:03:13

git clone :team/repo.git works

ghadi16:03:16

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

unbalanced16:03:49

I haven't checked -- is that important?

unbalanced16:03:08

there is no ssh config

unbalanced16:03:45

just kidding my mistake, there is

unbalanced16:03:47

renamed stuff and it worked

unbalanced16:03:19

how on earth did you know that

alexmiller16:03:00

what error are you getting?

unbalanced16:03:29

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

unbalanced16:03:54

it was tied to the .ssh/config somehow

unbalanced16: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

unbalanced16: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

unbalanced16:03:58

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

unbalanced16: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

alexmiller16:03:32

so as above tools.gitlibs does support tags or branches

alexmiller16:03:50

clj intentionally supports only full shas

unbalanced16:03:09

because tags/branches are mutable ?

alexmiller16:03:19

yes, it totally breaks classpath caching

dominicm17:03:26

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

alexmiller17: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)

unbalanced16:03:00

gotcha... bummer

unbalanced16:03:40

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

alexmiller16:03:59

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

alexmiller16:03:56

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

unbalanced16:03:01

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

alexmiller16:03:38

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

unbalanced17:03:47

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

alexmiller17:03:18

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

unbalanced17: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

alexmiller17:03:19

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

unbalanced17:03:36

is that like a "private clojars"?

unbalanced17:03:51

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

alexmiller17:03:53

maven repos can be just a file system

alexmiller17:03:02

and private s3 repos are exactly that

unbalanced17:03:21

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

alexmiller17: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)

alexmiller17:03:51

you don't need an alternate .m2

alexmiller17:03:15

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

unbalanced17:03:27

innnteresting

unbalanced17:03:53

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

alexmiller17: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

unbalanced17:03:59

which category on tools would that be under?

unbalanced17:03:13

versioning and releasing?

alexmiller17:03:40

making an artifact -> packaging

alexmiller17:03:10

but I guess also some of versioning and releasing

unbalanced17:03:31

no I meant a tool for where to host

unbalanced17:03:44

i.e. nexus or similar

alexmiller17:03:25

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

unbalanced17:03:53

just making sure I'm not crazy

alexmiller17:03:57

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

unbalanced17:03:04

😛 well I am technically a little @goomba

alexmiller17:03:54

those are common ones

alexmiller17:03:43

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

unbalanced17:03:17

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

alexmiller17:03:38

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

alexmiller17: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