Uploaded image for project: 'Clojure'
  1. CLJ-1578

1.7.0-alpha3 breakage due to symbol conflicts

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Completed
    • Affects versions: Release 1.7
    • Fix versions: Release 1.7
    • Labels:
      None
    • Approval:
      Ok
    • Patch:
      Code

      Description

      I've been trying to build core.matrix with 1.7.0-alpha3 and I get a failures due to symbol conflicts with clojure.core (specifically the new update function).

      java.lang.IllegalStateException: update already refers to: #'clojure.core.matrix.utils/update in namespace: clojure.core.matrix.impl.ndarray-magic
      	at clojure.lang.Namespace.warnOrFailOnReplace(Namespace.java:88)
      	at clojure.lang.Namespace.reference(Namespace.java:110)
      	at clojure.lang.Namespace.refer(Namespace.java:168)
      	at clojure.core$refer.doInvoke(core.clj:4071)
      	at clojure.lang.RestFn.invoke(RestFn.java:439)
      	at clojure.core.matrix.impl.ndarray_magic$eval9762$loading__5295__auto____9763.invoke(ndarray_magic.clj:1)
      	at clojure.core.matrix.impl.ndarray_magic$eval9762.invoke(ndarray_magic.clj:1)
      

      Simpler case to reproduce:

      (ns foo)
      (def inc dec) ;; gets a warning 
      (ns bar (:require [foo :refer :all])) ;; gets another warning
      (ns bar (:require [foo :refer :all])) ;; causes the exception (effectively a ns reload)
      

      Cause: In the case of a load, foo/inc is replacing clojure.core/inc and that causes the expected warning. In the case of a reload, clojure.core/inc is replacing foo/inc - this case is not currently handled and falls into the error case.

      Approach: In the case of clojure.core/inc replacing foo/inc (should only happen during a reload), ignore and issue neither warning or error.

      Patch: 0001-CLJ-1578-don-t-throw-when-a-core-Var-replaces-anothe.patch

      Screened by: Alex Miller

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mikera Mike Anderson
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: