Fork me on GitHub
#datomic
<
2020-10-05
>
onetom11:10:23

we have upgraded clojure cli tools x.x.x.590 to 1.10.1.697, 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"}

onetom12:10:46

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.

alexmiller13:10:06

Can you share your full deps.edn?

onetom13:10:32

{:paths
  ["src" ;"rsc" "classes"
 ]

  :deps
  {
   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"}
   }

  :mvn/repos
  {"datomic-cloud"
   {:url ""}}

  :aliases
  {:test
   {:extra-paths
    ["test"]

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

onetom13:10:55

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.

alexmiller13:10:54

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

onetom13:10:18

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

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

onetom13:10:22

these are the differences in the dependency tree:

$ diff -u <(/nix/store/0v7kwppxygj3wln9j104vfi1kx21fssj-clojure-1.10.1.590/bin/clojure -Srepro -Stree) <(/nix/store/9g4xqjpzi7vkr5a5n2q3fd1cyymvh68r-clojure-1.10.1.697/bin/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

alexmiller13:10:38

I'm looking at it, give me a bit

alexmiller14:10:33

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

onetom14:10:50

thank you!

onetom14:10:58

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

alexmiller23:10:43

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

alexmiller23:10:33

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!

kennytilton14:10:59

@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? :shrug:

favila15:10:09

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

favila15:10:47

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

favila15:10:17

instead of :find ?year :with ?language

nando15:10:58

That's a very helpful explanation.

nando15:10:29

@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.

kennytilton15:10:38

You remind me of this gem: https://ace.home.xs4all.nl/Literaria/Poem-Graves.html. 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.

nando15:10:23

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

timo16:10:51

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

timo17:10:40

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: https://docs.datomic.com/on-prem/peer-server.html

marshall17:10:22

@timok Datomic free does not support peer server

marshall17:10:39

^ no cost way to use datomic client library locally

Michael W17:10:47

I have it running a peer server here...

marshall17:10:10

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.

timo17:10:58

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

onetom22:10:13

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?