mranderson
mranderson copied to clipboard
clojure.core require handled badly
Namespaces can require clojure.core
in their ns form. While rare, that was actually used as a workaround for a now-fixed Cloverage issue.
...when mranderson would find such a require, it would rewrite it to something very different (cider.nrepl.inlined-deps-corerrb-vector.v0v1v2.clojure.core
), causing an error when trying to run the emitted code (because that namespace libspec would not be backed by an existing file).
This can be seen in the CircleCI build as of https://github.com/clojure-emacs/cider-nrepl/commit/c9b2f61875f41785e0373a3a7e0269701c20d720 (and can be repro'd locally by running make smoketest
)
Probably fixing this bug (which is rare to hit) would also make the overall code more robust.
Cheers - V
Maybe not that rare @vemv when used in conjunction with (:refer-clojure :exclude ...)
?
A contrived example, but you get the idea:
(ns foobar
(:refer-clojure :exclude [assoc])
(:require [clojure.core :as c]))
(defn assoc [m k v]
(c/assoc m (name k) v))
Would the above be problematic?
Only one way to know!
I'm facing this one again
Here's the ns that causes it:
https://github.com/clj-commons/claypoole/blob/4e8440a61178778d36dd30d1f026ade4bf12d2ec/src/clj/com/climate/claypoole/impl.clj#L14-L16
My build:
https://app.circleci.com/pipelines/github/clojure-emacs/cider-nrepl/775/workflows/b12679f3-7c6a-4fd1-8d2b-1882ab809432/jobs/9618
Message:
{:clojure.main/message
"Syntax error (FileNotFoundException) compiling at (cider/nrepl/inlined/deps/claypoole/v1v2v2/com/climate/claypoole.clj:1:1).\nCould not locate cider/nrepl/inlined/deps/corerrb_vector/v0v1v2/clojure/core__init.class, cider/nrepl/inlined/deps/corerrb_vector/v0v1v2/clojure/core.clj or cider/nrepl/inlined/deps/corerrb_vector/v0v1v2/clojure/core.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.\n",
oi @vemv
could not repro your problem, I assume it is my bad but can you test a fix on above branch (fix-76
)?
Thanks! Is it available as snapshot?
it is now as https://clojars.org/thomasa/mranderson/versions/0.5.4-fix76
@benedekfazekas could you tag the git repo with v0.5.4-fix76
? that way my rewrite-clj tests can easily pick up this latest release for canary testing.
that would be a bit tricky i am away from my laptop for more than a week and the phone app does not seem to have this option. it is on a branch tho does that help maybe?
Oh you published from a branch? I can skip until you publish something from master.
@lread bump shall I merge this? or your problem went away?
sorry, wrong bump @lread I meant to bump @vemv
I'll try to get back to this soon!
On Wed, Aug 16, 2023 at 10:35 AM Benedek Fazekas @.***> wrote:
sorry, wrong bump @lread https://github.com/lread I meant to bump @vemv https://github.com/vemv
— Reply to this email directly, view it on GitHub https://github.com/benedekfazekas/mranderson/issues/76#issuecomment-1680193142, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI354UXHPTNFS5RQCDMTETXVSA6TANCNFSM6AAAAAARCTBJXE . You are receiving this because you were mentioned.Message ID: @.***>