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

alexmiller13: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鈥檝e 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鈥檛 be certain. Anyway I鈥檝e just tried changing the bucket URL鈥檚 to be of the form s3:// and it now works. No idea what the difference is in the protocols; but I鈥檝e seen both forms over the years.

gerred17:02:21

s3p is for hadoop/presto it seems.

dominicm17:02:28

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

rickmoynihan17:02:46

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

alexmiller17:02:50

s3p has never been a documented supported protocol for clj

alexmiller17:02:23

So was working before by accident, not by intent

alexmiller17: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鈥檛 think anything of it when they worked

rickmoynihan17:02:34

Anyway it鈥檚 not a problem, I just thought I鈥檇 mention it incase it happens to others