Skip to content

Editing a nostrand namespace renumbers every committed stdlib DLL #64

Description

@skydread1

Problem

Add a single anonymous fn to nostrand/nostrand/core.clj (a namespace with no stdlib code), rebuild, and every committed clojure.* and compiler DLL drifts, though no stdlib source changed:

;; nostrand/nostrand/core.clj
(def -probe #(identity %))
$ bb build
$ bb check-drift
drift detected   # ~147 clojure.* / compiler DLLs modified

The only content difference in each DLL is one type-name counter, bumped by one:

clojure.core.clj.dll:  <magic>nostrand_core$<fn>__49  ->  __50

bb build compiles each namespace with the ambient *ns* = nostrand.core, so every file's first form is named under it before its own in-ns runs. That name's suffix comes from magic.util/*gensym-map*, which is never reset, so it accumulates across the build and encodes nostrand.core's fn count. #43's reset-global-gensym-counter! resets RT._id per file-writing compile but not *gensym-map*.

Suggestion

Reset magic.util/*gensym-map* at the start of each file-writing compile in magic.api/compile-file, guarded to :write-files like the existing RT._id reset.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions