Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't run Dirac on MacOS, it keeps complaining about org.clojure/data.json - even though it is listed as a dependency #98

Open
pdelfino opened this issue Aug 25, 2022 · 3 comments · May be fixed by #99

Comments

@pdelfino
Copy link

Hi,

I am trying to install Dirac on a Macbook Air M1 running Monterey 12.5.

I am following the documentation which indicates:

curl -s https://raw.githubusercontent.com/binaryage/dirac/master/install > /tmp/dirac.install && sudo bash /tmp/dirac.install

The installation seems to have worked out since it exists on binaries:

   Pedros-MacBook-Air:bin pedro$ pwd
   /usr/local/bin

   Pedros-MacBook-Air:bin pedro$ ls -1
   dirac
   lein

Unfortunately, when I go to the 2nd step on manual which is running dirac, the error below is retrieved:

   Pedros-MacBook-Air:bin pedro$ dirac
   WARNING: update-vals already refers to: #'clojure.core/update-vals in namespace: clojure.tools.analyzer.utils, being replaced by: #'clojure.tools.analyzer.utils/update-vals
   WARNING: update-keys already refers to: #'clojure.core/update-keys in namespace: clojure.tools.analyzer.utils, being replaced by: #'clojure.tools.analyzer.utils/update-keys
   WARNING: update-vals already refers to: #'clojure.core/update-vals in namespace: clojure.tools.analyzer, being replaced by: #'clojure.tools.analyzer.utils/update-vals
   WARNING: update-keys already refers to: #'clojure.core/update-keys in namespace: clojure.tools.analyzer, being replaced by: #'clojure.tools.analyzer.utils/update-keys
   WARNING: update-vals already refers to: #'clojure.core/update-vals in namespace: clojure.tools.analyzer.passes, being replaced by: #'clojure.tools.analyzer.utils/update-vals
   WARNING: update-vals already refers to: #'clojure.core/update-vals in namespace: clojure.tools.analyzer.passes.uniquify, being replaced by: #'clojure.tools.analyzer.utils/update-vals
   Execution error (FileNotFoundException) at dirac.nrepl.compilation.direct/eval15283$loading (direct.clj:1).
   Could not locate clojure/data/json__init.class, clojure/data/json.clj or clojure/data/json.cljc on classpath.

Full report at:
/var/folders/fh/7d_1drwd2ps3zw03j9ftkqs80000gn/T/clojure-1010884132545121253.edn

Initially, I tried running it at home folder. I thought it would work out fine.

Then, I decided to run it inside a project folder that had the file clojure/data/json.clj
included in the the project.clj file. Unfortunately, even this approach did not work out.

Below you see a simplified version of the project.clj file:

(defproject abcd    ; Should be copied from shadow-cljs.edn
  :description "xxxx"
  :url "xxxx"

  :dependencies [[org.clojure/clojure "1.9.0"]
                 [org.clojure/clojurescript "1.10.339"]
                 [org.clojure/tools.nrepl "RELEASE"]
                 [binaryage/devtools ~devtools-version]
                 [binaryage/dirac ~dirac-version]
                 [org.clojure/data.json "2.4.0"]
                 [figwheel ~figwheel-version]
                 ;; Selmer for templating of .json config files
                 [selmer "1.12.50"]]

... (omitted content because it seems irrelevant) ...

  :profiles {:repl
             {:repl-options {:port             8230
                             :nrepl-middleware [dirac.nrepl/middleware]
                             :init             (do
                                                 (require 'dirac.agent)
                                                 (dirac.agent/boot!))


}}})

1 - I thought Dirac would work out even outside of the project folder. Is it necessary to be in the project folder?

2 - Why is Dirac complaining about the Json library even though it is listed as a dependency?
Is there any difference between clojure/data/json.clj (error message retrieved) and org.clojure/data.json (my dependency)?

Thanks!

@pdelfino pdelfino changed the title I can't run Dirac on MacOS I can't run Dirac on MacOS, it keeps complaining about org.clojure/data.json - even though it is listed as a dependency Aug 25, 2022
@slifin
Copy link

slifin commented Aug 26, 2022

There should be a better way of doing this but below worked for me:

Add this dependency to your ~/.clojure/deps.edn (create it if it doesn't exist)

{:deps {org.clojure/data.json {:mvn/version "2.4.0"}}}

Should load okay, I noticed that it also needs Google Chrome Canary installed

transducer added a commit to transducer/dirac that referenced this issue Aug 26, 2022
The dependency org.clojure/data.json was removed from ClojureScript in
version 1.11.51 of May 13th 2022. See release notes
https://clojurescript.org/news/2022-05-13-release:

Vendorization of tools.reader, data.json, and transit-clj
(...)
    After conferring with the Clojure Team, we decided to vendorize all
    these dependencies. This way we can AOT everything and be confident
    that we won’t create a conflict that can’t easily be fixed via
    normal dependency management. (...) The dependance on data.json has
    been removed

This commit adds an explicit dependency on clojure.data.json.

Fixes binaryage#98
@transducer transducer linked a pull request Aug 26, 2022 that will close this issue
@pdelfino
Copy link
Author

Thank you for trying to help!

{:deps {org.clojure/data.json {:mvn/version "2.4.0"}}}

There is something weird here. When I opened the file .clojure/deps.end, there was "code content" inside the file.
But, everything was comment-out:

;; The deps.edn file describes the information needed to build a classpath.
;;
;; When using the `clojure` or `clj` script, there are several deps.edn files
;; that are combined:
;; - install-level
;; - user level (this file)
;; - project level (current directory when invoked)
;;
;; For all attributes other than :paths, these config files are merged left to right.
;; Only the last :paths is kept and others are dropped.

{
  ;; Paths
  ;;   Directories in the current project to include in the classpath

  ;; :paths ["src"]

  ;; External dependencies
 
  ;; :deps {
  ;;   org.clojure/clojure {:mvn/version "1.11.1"}
  ;; }

  ;; Aliases
	;;   resolve-deps aliases (-R) affect dependency resolution, options:
	;;     :extra-deps - specifies extra deps to add to :deps
	;;     :override-deps - specifies a coordinate to use instead of that in :deps
	;;     :default-deps - specifies a coordinate to use for a lib if one isn't found
	;;   make-classpath aliases (-C) affect the classpath generation, options:
	;;     :extra-paths - vector of additional paths to add to the classpath
	;;     :classpath-overrides - map of lib to path that overrides the result of resolving deps

  ;; :aliases {
  ;;   :deps {:extra-deps {org.clojure/tools.deps.alpha {:mvn/version "0.14.1212"}}}
  ;;   :test {:extra-paths ["test"]}
  ;; }

  ;; Provider attributes

  ;; :mvn/repos {
  ;;   "central" {:url "https://repo1.maven.org/maven2/"}
  ;;   "clojars" {:url "https://repo.clojars.org/"}
  ;; }
}

Is this expected?

@pdelfino
Copy link
Author

Please, see my question about this problem on StackOverflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants