Fork me on GitHub
#tools-deps
<
2020-02-21
>
teodorlu08:02:40

Hey! 👋 Any idea on why this doesn't work?

$ clj -e '(doc ns-map)'
Syntax error compiling at (REPL:1:1).
Unable to resolve symbol: doc in this context

Full report at:
/tmp/clojure-135646063998456412.edn

dominicm08:02:49

You need to require clojure.repl, doc is defined there, not in core

dominicm08:02:06

user.clj requires clojure.repl for you

Alex Miller (Clojure team)13:02:24

No, Clojure.main does this in the repl setup

vlaaad09:02:59

I would guess it would be more correct to say that starting repl requires clojure.repl for you

vlaaad09:02:01

I would guess even more correct thing to say that clojure.main/repl-requires are required when you start a repl https://github.com/clojure/clojure/blob/38524061dcb14c598c239be87184b3378ffc5bac/src/clj/clojure/main.clj#L355

dominicm09:02:18

Quite right, I'm not sure why I thought otherwise. Brain fart.

Wes Hall13:02:45

Making some increasingly half-hearted attempt to get DynamoDBLocal running to start embedded for tests, but it seems to depend on sqllite4java which exists in the mvn repos but with <packaging>dylib</packaging>. Am I right in assuming that tools-deps doesn't have support for downloading dylib dependencies?

kszabo13:02:19

I prefer to use docker-compose to set up local service dependencies:

version: '2'
services:
  dynamodb-local:
    image: 'dwmkerr/dynamodb'

kszabo13:02:11

but this is not related to #tools-deps this way

Wes Hall14:02:25

@thenonameguy Yeah, I will probably move to something like that. Dynamo local, at least in theory, does support embedded running so should be possible to throw up an in-memory version in a text fixture and tear it down afterwards, but the dependency on sqllite (and thus native libraries), is a bit of a hurdle. I'll probably give up, but just thought I would check that I am not missing a route I could at least try, but I think the docker-compose option is probably the way to go. Thanks.

Wes Hall14:02:11

Downloading native (thus platform dependent) libraries, is a bit awful anyway, I wouldn't be surprised if it's not supported.

teodorlu14:02:47

@vlaaad @dominicm @alexmiller thanks for the help clearing that up! I realize why doc shouldn't work above, and I get the expected result when I require it as I "should" do.

$ clj -e "(require '[clojure.repl :refer [doc]]) (doc ns-map)"
-------------------------
clojure.core/ns-map
([ns])
  Returns a map of all the mappings for the namespace.

rickmoynihan17:02:48

Not sure if this is a known regression or not… but I was using some private S3 buckets as mvn repos; with a URL of the form s3p://<bucket>/<directory>/ I’ve been using this for years (previously with leiningen) and found earlier in the week that I could no longer resolve deps via the clj tool. I suspect this was caused by the recent changes in t.d.a to using the cognitect aws lib; but I can’t be certain. Anyway I’ve just tried changing the bucket URL’s to be of the form s3:// and it now works. No idea what the difference is in the protocols; but I’ve seen both forms over the years.

gerred17:02:21

s3p is for hadoop/presto it seems.

gerred17:02:02

not an official protocol. AWS has a few other protocols for similar reasons (with EMR specially): s3a and s3n come to mind.

gerred17:02:58

so maybe this was only a wagon thing.

gerred17:02:48

it looks like it's even gone from newer versions of Wagon

rickmoynihan17:02:18

yeah iirc tools.deps used the s3 wagon until recently

gerred17:02:04

oh no it's still there

dominicm17:02:28

Alex did ask to know if anything broke. I think compatibility was the intention.

rickmoynihan17:02:46

Yeah that’s why I’m mentioning it. The (end user) fix is trivial (just change to use s3://) once you know what the problem is though.

Alex Miller (Clojure team)17:02:50

s3p has never been a documented supported protocol for clj

Alex Miller (Clojure team)17:02:23

So was working before by accident, not by intent

Alex Miller (Clojure team)17:02:49

s3p is an invention of the spring aws wagon

rickmoynihan17:02:06

Ah interesting, I think I just copied my URLs from lein and didn’t think anything of it when they worked

rickmoynihan17:02:34

Anyway it’s not a problem, I just thought I’d mention it incase it happens to others