Fork me on GitHub
#babashka
<
2022-06-27
>
dharrigan08:06:40

Does babashka (via deps.clj) support s3:// mvn repos?

borkdude08:06:14

@U11EL3P9U bb just uses the same tools jar that the bash clojure script uses, so it should

dharrigan08:06:01

Hmm, okay, interesting. Will delve further, as I'm trying to write a little bb script that pulls in a local/deps on a project that uses some internal dependencies served up via s3. Natch, when launching the project for real, via clj it's fine and dependencies are fetched. Will delve further.

borkdude08:06:48

@U11EL3P9U Where did you declare the mvn/repo thing then for bb?

dharrigan08:06:01

in the deps.edn in the sourced project

borkdude08:06:23

bb doesn't use deps.edn unless you tell it to, e.g via. current/deps {:local/root "."}

dharrigan08:06:25

I've also tried putting them in the bb.edn

dharrigan08:06:31

yes, that's what I'm using

borkdude08:06:33

bb.edn should work as well, I think

dharrigan08:06:16

{:deps {local/deps {:local/root "/home/david/development/workspaces/foo/projects/bar"}}

 :mvn/repos {"foo-releases" {:url ""}
             "foo-snapshots" {:url ""}}}

dharrigan08:06:30

that's the bb.edn

dharrigan09:06:02

in the bar project in the deps.edn is also the same mvn/repos key (and values)

borkdude09:06:30

I think that should work

dharrigan09:06:50

I'm getting a stack dump that has this Exception in thread "main" java.io.FileNotFoundException: /home/david/.clojure/.cpcache/CBDC5BED1688AFDD81A8178754C8EA2C.cp (No such file or directory)

dharrigan09:06:58

will investigate further.

borkdude09:06:01

Can you try --force?

borkdude09:06:09

bb --force ...

dharrigan09:06:23

bb print-deps --format classpath --force

borkdude09:06:29

And what about rm -rf ~/.clojure/.cpcache

borkdude09:06:40

No, force has to go first, it's a global option

borkdude09:06:55

bb --force print-deps ...

dharrigan09:06:33

Well, that just returns an error

dharrigan09:06:35

Type:     java.lang.Exception
Message:  File does not exist: print-deps

borkdude09:06:06

Hmm, bad command line handling there then. Try rm -rf ~/.clojure/.cpcache

dharrigan09:06:17

tried that, still having an error

borkdude09:06:36

can you put up a repro repo - then I'll have a check locally

borkdude09:06:53

what happens if you do bb clojure -Spath ?

dharrigan09:06:09

I'll do some digging first. I want to rule out PEBKAC.

👍 1
dharrigan09:06:45

(doing a repo would be tricky, you'll need to host a jar on s3 bucket, then have authentication etc... to mimic what we use)

borkdude09:06:12

well, even if the authentication fails, it would be a sign that it would try to use those mvn repos

borkdude09:06:17

which would be good

dharrigan09:06:22

I'll be in touch if I can't figure it out. I'm probably just missing a step in the magic incantation.

Kamuela11:06:24

Anyone seeing Cannot run program "xdg-open": error=2, No such file or directory when trying to run http-server in a Docker container?

1
borkdude11:06:01

I'm not sure why that would happen. I don't see any reference to xdg-open in here? https://github.com/babashka/http-server/blob/main/src/babashka/http_server.clj

borkdude11:06:17

Perhaps you're doing a clojure.java.browse in your code as well?

borkdude11:06:52

well, there it is then

Kamuela11:06:05

I was using an old example and refashioning it a bit

Kamuela11:06:33

The offending line is (browse/browse-url (format ":%s/" port))

Kamuela11:06:42

And I'll be honest and say I'm not quite sure what that's doing

borkdude11:06:08

it tries to open a browser

Kamuela11:06:56

Ok that makes a ton of sense now

Kamuela11:06:28

Removing that dependency fixed everything. Thank you

👍 1
Kamuela20:06:05

Managed to sneak some Clojure into CI via babashka as a mock server for integration tests :face_with_finger_covering_closed_lips:

😇 4
💯 1
clojure-spin 3
🤐 3
🚀 1
🥷 4