Fork me on GitHub
Eamonn Sullivan06:01:30

No, but I think I figured out what I need to do. It works locally because of the ssh config set up. I will need to set up a docker container configured the same way, save that to an ECR and then specify that docker in the build. 🤞


Hi! How to solve > Cloning: > Error building classpath. Destination path "clj-http-lite" already exists and is not an empty directory > org.eclipse.jgit.api.errors.JGitInternalException: Destination path "clj-http-lite" already exists and is not an empty directory > at org.eclipse.jgit.api.CloneCommand.verifyDirectories( caused by a borkdude/clj-http-lite {:git/url "" ...} dependency? 🙏 i.e. where does it exist, so that I can delete it?


@holyjak rm -rf ~/.gitlibs

❤️ 3

well you don't have to rm the whole thing :)


but yes, that usually means there is a partial download in the ~/.gitlibs dir


if you're running into this often, consider using -Sthreads 1 on clj

👍 3

I usually do remove the whole thing because there are two things inside .gitlibs, repositories and some other things, so just to make sure, I bluntly get rid of it all ;)

Eamonn Sullivan13:01:08

I didn't know it was supposed to work without that error message. :thinking_face: Happens to me 100% of the time, so I do the same: just blow it all away. I didn't think to try single-threading. Also, I just recently discovered why I was getting cryptic error messages about an invalid privatekey, unless I removed my .ssh/config every time. My key format was too old. A regen (`ssh-keygen -p -m pem -f ...`) finally got rid of that for me, making this feature much more useful.


if that doesn't help, I'd be curious to hear about it. my belief right now is that this is a concurrency issue where parallel downloads happen and one is stomping on the other in the same dir

Eamonn Sullivan13:01:30

I will definitely try this next time. I'm currently trying to get this all to happen in a docker container, so I'll probably have lots of opportunities...


@UR71VR71S Forwarding the SSH agent for a dockerized build took me a while to grok. It requires the buildkit tools,

DOCKER_BUILDKIT=1 docker build --ssh default --tag ....
and some of the experimental options:
# syntax=docker/dockerfile:1.0.0-experimental
### -----------------------------------------------------------------------------
###                 PHASE 1:
### Build the application within a Docker image
FROM clojure:openjdk-8-tools-deps as builder
WORKDIR /home/app
COPY . .

### Install git so we can pull dependencies from GitHub repositories
RUN apt-get update -y
RUN apt-get install git

### Download public RSA keys for 
RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan  >> ~/.ssh/known_hosts

### Use seancorfield/depstar to create a POM and build the app into an uberjar
### This fetches dependencies AOT, so we don't need to fetch anything when the app starts
### Make sure your app specifies a (:gen-class) directive in the main namespace
### This will AOT compile the main namespace, and anything required in that namespace
RUN --mount=type=ssh clojure -Spom && \
    clojure -Sdeps '{:deps {seancorfield/depstar {:mvn/version "0.5.2"}}}' \
    -m hf.depstar.uberjar my-app.jar -C -m my-app.main

Eamonn Sullivan14:01:02

Thank you very much, @UCZ5ZDJKF! You probably saved me hours...


Anytime! It wasn’t a fun discovery process lol


you should write that down somewhere :)


feel free to make a wiki page at if you need a place


does anyone know if proxy username/password in ~/.m2/settings.xml are respected when fetching dependencies? From what I can tell the answer is no.

alexmiller15:01:35 is supported but I'm not familiar with any user/pw thing for that


let me glance at the code


there is code there with that intent (can't say I've tested that personally)


I'm not sure if this is relevant here, but deps.clj forwards proxy environment variables to the tools.deps JVM's java properties:


thanks @alexmiller i'll play with it and see if I come up with something more concrete


happy to look at fixes if something isn't working there (but I'm somewhat limited in ability to test)