Fork me on GitHub

we have upgraded clojure cli tools x.x.x.590 to, then the following error appeared:

$ clj -Srepro -e "(require 'datomic.client.api)"
WARNING: When invoking clojure.main, use -M
Execution error (FileNotFoundException) at clojure.core.async.impl.ioc-macros/eval774$loading (ioc_macros.clj:12).
Could not locate clojure/tools/analyzer__init.class, clojure/tools/analyzer.clj or clojure/tools/analyzer.cljc on classpath.
i think im on the latest dependencies in my ./deps.edn file:
org.clojure/clojure                     {:mvn/version "1.10.1"}
  com.datomic/client-cloud                {:mvn/version "0.8.102"}
  com.datomic/ion                         {:mvn/version "0.9.48"}


I tried it with both nixpkgs.jdk8 and jdk11. I tried it with and without the deps overrides recommended by the latest ion-dev push operation. the error is always the same. I have no other dependencies specified and still get this error. I guess I can specify this missing dependecy explicitly, but it feels like I'm doing something wrong, if such a bare bones ion project doesn't work out of the box.


Can you share your full deps.edn?


  ["src" ;"rsc" "classes"

   org.clojure/clojure                     {:mvn/version "1.10.1"}
   com.datomic/client-cloud                {:mvn/version "0.8.102"}
   com.datomic/ion                         {:mvn/version "0.9.48"}
   ;org.clojure/data.json                   {:mvn/version "0.2.6"}
   ;http-kit/http-kit                       {:mvn/version "2.5.0"}
   ;metosin/reitit-ring                     {:mvn/version "0.5.6"}
   ;org.clojure/tools.analyzer              {:mvn/version "1.0.0"}

   ;; Deps to avoid conflicts with Datomic Cloud
   ;; commons-codec/commons-codec             #:mvn{:version "1.13"},
   ;; com.fasterxml.jackson.core/jackson-core #:mvn{:version "2.10.1"},
   ;; com.amazonaws/aws-java-sdk-core         #:mvn{:version "1.11.826"},
   ;; com.cognitect/transit-clj               #:mvn{:version "0.8.319"},
   ;; com.cognitect/s3-creds                  #:mvn{:version "0.1.23"},
   ;; com.amazonaws/aws-java-sdk-kms          #:mvn{:version "1.11.826"},
   ;; com.amazonaws/aws-java-sdk-s3           #:mvn{:version "1.11.826"}

   {:url ""}}


    {nubank/matcher-combinators {:mvn/version "3.1.3"}
     lambdaisland/kaocha        {:mvn/version "1.0.700"}}}}


i tried brew install clojure and run /usr/local/bin/clojure directly; same result. i haven't tried it under linux yet, but it feels like a tools.deps.alpha issue.


I don't think the os matters so no reason to do that


i just retried again on a different machine: no error:

$ /nix/store/0v7kwppxygj3wln9j104vfi1kx21fssj-clojure- -Srepro -e "(require 'datomic.client.api)"
analyzer error:
$ /nix/store/9g4xqjpzi7vkr5a5n2q3fd1cyymvh68r-clojure- -Srepro -e "(require 'datomic.client.api)"


these are the differences in the dependency tree:

$ diff -u <(/nix/store/0v7kwppxygj3wln9j104vfi1kx21fssj-clojure- -Srepro -Stree) <(/nix/store/9g4xqjpzi7vkr5a5n2q3fd1cyymvh68r-clojure- -Srepro -Stree)
--- /dev/fd/63	2020-10-05 21:48:46.147069426 +0800
+++ /dev/fd/62	2020-10-05 21:48:46.147513695 +0800
@@ -31,10 +31,6 @@
     com.datomic/client-api 0.8.54
       org.clojure/core.async 0.5.527
         org.clojure/tools.analyzer.jvm 0.7.2
-          org.clojure/tools.analyzer 0.6.9
-          org.clojure/tools.reader 1.0.0-beta4
-          org.clojure/core.memoize 0.5.9
-          org.ow2.asm/asm-all 4.2
     com.cognitect/http-client 0.1.105
       org.eclipse.jetty/jetty-http 9.4.27.v20200227
         org.eclipse.jetty/jetty-io 9.4.27.v20200227


I'm looking at it, give me a bit

👍 1
❤️ 1

this is a tools.deps bug - it's pretty subtle and will take me a bit to isolate and fix properly but adding a top level dep on org.clojure/core.async 0.5.527 should be a sufficient workaround for the moment


thank you!


with that core.async, it worked on my side too


hey, a new prerelease of clj is out if you'd like to test it -, will promote to stable after a bit more use


and I guess I implied but should say that it fixes this problem - thanks for the report, it would have been challenging to find this otherwise!

👍 1

@nando I am a Datomic noob myself, but I got curious about the proposed enhanced doc (+1 on that, btw) and how :with might work and ran a little experiment:

(d/q '[:find  ?year
         :with ?language
         :where [?artist :artist/name "Bob Dylan"]
         [?release :release/artists ?artist]
         [?release :release/year ?year]
         [?release :release/language ?language]]
    db) ;; => [[1968] [1973] [1969] [1970] [1971]]
So to my unwitting eyes, the :with per se does not block collapsing of duplicates: rather, one must concoct a :with clause based on domain knowledge to force a bag with the desired population over which to aggregate. Maybe? 🤷


The columns in the initial set are with+find, (in this case ?year ?language), then aggregation happens, then the :with columns are removed (in this case ?language) leaving a bag


maybe it’s easier to think of it as :find ?year ?language :removing ?language


instead of :find ?year :with ?language


That's a very helpful explanation.


@hiskennyness I can only respond by saying that I think :with is a very important clause to understand, and I'm not sure I fully understand it yet. Your example is the first I've seen targeting an attribute rather than an entity id. I don't have sufficient grasp of the inner workings of datomic or concept behind :with to make a guess how that works, but I'm easily confused.


You remind me of this gem: I have been toying with doing a ground-up Datomic for the Easily Confused tutorial series, maybe I should do it as I struggle up my own learning curve.


If you do a tutorial series, of course please send the link!

👍 1

how do I create a client with datomic.client.api with datomic free?


can I even use datomic.client.api with datomic free?

Michael W17:10:05

Yes you have to run a peer server with datomic free to do that. See:


@timok Datomic free does not support peer server


^ no cost way to use datomic client library locally

Michael W17:10:47

I have it running a peer server here...


Datomic Pro Starter, which is free (no cost) does include peer server

Michael W17:10:40

Ok so I am running that not free then. Sorry for the confusion.


alright, thanks...will try dev-local then


i would like to implement some cognito triggers, using ions. how can i see what payload does an api service calls an ion with? can i "log" such info to some standard location easily? for example, where can i see, if i just clojure.pprint/pprint something in an ion?