Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

WARNING with cljs.spec.test.alpha/instrument #308

Closed
arichiardi opened this issue Nov 9, 2017 · 4 comments · Fixed by #317
Closed

WARNING with cljs.spec.test.alpha/instrument #308

arichiardi opened this issue Nov 9, 2017 · 4 comments · Fixed by #317

Comments

@arichiardi
Copy link
Collaborator

I wanted to write down a peculiar WARNING that I receive in my lumo-repros repository (trigger it with ./scripts/build).

The namespace I am trying to compile is:

(ns speed-of-light.core
  "The entry point of this program"
  (:require [cljs.spec.test.alpha :as stest]))

(enable-console-print!)

(stest/instrument)

(defn -main
  [& args]
  (println "Hello world!")
  (process.exit 0))

(set! *main-cli-fn* `-main)

And the warning I receive is:

WARNING: Use of undeclared Var cljs.spec.test.alpha/instrument at line 8

The classpath returned by lumo.classpath/classpath is:

("/home/arichiardi/git/lumo-repros"
 "/home/arichiardi/git/lumo-repros/src"
 "/home/arichiardi/.m2/repository/org/clojure/test.check/0.10.0-alpha2/test.check-0.10.0-alpha2.jar")

So it looks like everything is in the right place.

@arichiardi
Copy link
Collaborator Author

I found that it seems like there are some warnings going on with boot dev, I don't know if the are the cause of not having the instrument symbol available. I guess the analisys cache should contain it, however, it seems like the cache I have in my out folder does not have it.

The warnings are:

Compiling out/cljs/spec/test/alpha.cljs
WARNING: Use of undeclared Var cljs.spec.test.alpha$macros/eval at line 112 cljs/spec/test/alpha.cljc
WARNING: Use of undeclared Var cljs.spec.test.alpha$macros/eval at line 135 cljs/spec/test/alpha.cljc
WARNING: Use of undeclared Var cljs.spec.test.alpha$macros/eval at line 245 cljs/spec/test/alpha.cljc

@arichiardi
Copy link
Collaborator Author

arichiardi commented Nov 17, 2017

So I have been digging:

cljs.user=> (def cache (ana/read-analysis-cache (ana/cache-file "out/cljs/spec/test/alpha.cljs" "out") "out/cljs/spec/test/alpha.cljs"))
...
cljs.user=> (filter #(clojure.string/includes? (str %) "cljs.spec") (keys (get-in cache [:cljs.analyzer/namespaces])))
(cljs.spec.alpha$macros
 cljs.spec.gen.alpha$macros
 cljs.spec.test.alpha
 cljs.spec.alpha
 cljs.spec.gen.alpha)

I would have expected to see cljs.spec.test.alpha$macros? Am I on the right track?

@arichiardi
Copy link
Collaborator Author

Also not embedded:

cljs.user=> (filter #(clojure.string/includes? (str %) "cljs.spec") (lumo.internal.embedded.keys))
("cljs/core$macros.cljc.cache._COLON_cljs.spec_SLASH_registry_ref.json"
 "cljs/core$macros.cljc.cache._COLON_cljs.spec_SLASH_speced_vars.json"
 "target/cljs/core$macros.cljc.cache._COLON_cljs.spec_SLASH_registry_ref.json"
 "target/cljs/core$macros.cljc.cache._COLON_cljs.spec_SLASH_speced_vars.json")

@arichiardi arichiardi changed the title Spurious WARNING with cljs.spec.test.alpha/instrument WARNING with cljs.spec.test.alpha/instrument Nov 17, 2017
@arichiardi
Copy link
Collaborator Author

Linked with #312

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

Successfully merging a pull request may close this issue.

1 participant