This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-08
Channels
- # bangalore-clj (5)
- # beginners (6)
- # boot (66)
- # cider (48)
- # cljsrn (14)
- # clojure (699)
- # clojure-austin (2)
- # clojure-berlin (1)
- # clojure-boston (5)
- # clojure-dev (3)
- # clojure-india (7)
- # clojure-italy (24)
- # clojure-nl (5)
- # clojure-russia (33)
- # clojure-spec (30)
- # clojure-uk (64)
- # clojure-ukraine (22)
- # clojurescript (123)
- # clojurewest (1)
- # cursive (18)
- # datascript (44)
- # datomic (12)
- # dirac (46)
- # figwheel (1)
- # gsoc (5)
- # hoplon (6)
- # immutant (29)
- # instaparse (1)
- # juxt (26)
- # lein-figwheel (5)
- # leiningen (4)
- # luminus (8)
- # mount (56)
- # off-topic (60)
- # om (67)
- # om-next (1)
- # onyx (8)
- # proton (28)
- # re-frame (125)
- # ring (3)
- # ring-swagger (3)
- # specter (22)
- # testing (2)
- # unrepl (1)
- # untangled (91)
I’m seeing a problem with a project where:
1. lein clean
&& lein test
works fine
2. lein clean
&& lein compile
&& lein trampoline test
works fine
3. lein clean
&& lein trampoline test
results in failures in some tests involving types defined using deftype
The project.clj
contains :aot :all
. Removing :aot :all
makes the error go away.
I suspect what’s happening is that the first JVM compiles the files, then the second JVM loads the files, and now the classes are different somehow…something to do w/ classloaders? I’m certainly not a JVM expert.
Has anyone else encountered this issue?
Apparently it is due to different classloaders:
Classloader of kafka.serdes.avro_schema.GenericAvroMap: #object[clojure.lang.DynamicClassLoader 0x7a9c84a5 clojure.lang.DynamicClassLoader@7a9c84a5]
Classloader of marshalled value: #object[sun.misc.Launcher$AppClassLoader 0x4e0e2f2a sun.misc.Launcher$AppClassLoader@4e0e2f2a]
;;; nothing overriden in test profile
;;; lein clean works, with-profile test clean works
(defproject clean-override-lein-bug "0.0.1-SNAPSHOT"
:description "Is this a bug?"
:clean-targets ^{:protect false} ["resources"]
:profiles {:test {;; :clean-targets ^{:protect false} ["resources"]
}})
;; $ lein with-profile test clean
;; => 0
;; $ lein clean
;; => 0
;;; clean-targets overridden with metadata in test profile
;;; lein clean works, with-profile test clean fails
(defproject clean-override-lein-bug "0.0.1-SNAPSHOT"
:description "Is this a bug?"
:clean-targets ^{:protect false} ["resources"]
:profiles {:test {:clean-targets ^{:protect false} ["resources"]
}})
;; $ lein clean
;; => 0
;; $ lein with-profile test clean
;; Deleting non-target project paths ["resources%s"] is not allowed.
;; Check :clean-targets or override this behavior by adding metadata ->
;; :clean-targets ^{:protect false} [...targets...]
;; Error encountered performing task 'clean' with profile(s): 'test'
;; Deleting non-target project paths ["resources%s"] is not allowed.
;; Check :clean-targets or override this behavior by adding metadata ->
;; :clean-targets ^{:protect false} [...targets...]
;;; clean-targets specified at root with no metadata, redefined in test
;;; profile with metadata
;;; lein clean fails, with-profile test clean fails
(defproject clean-override-lein-bug "0.0.1-SNAPSHOT"
:description "Is this a bug?"
:clean-targets ["resources"]
:profiles {:test {:clean-targets ^{:protect false} ["resources"]
}})
;; $ lein clean
;; Deleting non-target project paths ["resources%s"] is not allowed.
;; Check :clean-targets or override this behavior by adding metadata ->
;; :clean-targets ^{:protect false} [...targets...]
;; $ lein with-profile test clean
;; Deleting non-target project paths ["resources%s"] is not allowed.
;; Check :clean-targets or override this behavior by adding metadata ->
;; :clean-targets ^{:protect false} [...targets...]
;; Error encountered performing task 'clean' with profile(s): 'test'
;; Deleting non-target project paths ["resources%s"] is not allowed.
;; Check :clean-targets or override this behavior by adding metadata ->
;; :clean-targets ^{:protect false} [...targets...]
;;; metatdata set in root, value overridden in profile.
;;; lein clean works, with-profile test clean fails
(defproject clean-override-lein-bug "0.0.1-SNAPSHOT"
:description "Is this a bug?"
:clean-targets ^{:protect false} ["resources"]
:profiles {:test {:clean-targets ["resources"]}})
;; $ lein clean
;; $ lein with-profile test clean
;; Deleting non-target project paths ["resources%s"] is not allowed.
;; Check :clean-targets or override this behavior by adding metadata ->
;; :clean-targets ^{:protect false} [...targets...]
;; Error encountered performing task 'clean' with profile(s): 'test'
;; Deleting non-target project paths ["resources%s"] is not allowed.
;; Check :clean-targets or override this behavior by adding metadata ->
;; :clean-targets ^{:protect false} [...targets...]