Skip to content

Gracefully deal with jars containing .clj and .cljc for same namespace #155

@martinklepsch

Description

@martinklepsch

Instaparse 1.4.9 contains one .clj and one .cljc file for each namespace for backwards compatibility. This is done via cljsee which transforms .cljc to plain .clj files before packaging.

instaparse/abnf.clj
instaparse/abnf.cljc
instaparse/auto_flatten_seq.clj
instaparse/auto_flatten_seq.cljc
instaparse/cfg.clj
instaparse/cfg.cljc

Now we use clojure.tools.namespace.find/find-sources-in-dir to find namespaces in a directory and it will return duplicates in this situation resulting in a weird analysis result with some namespaces duplicated, eventually failing because we have a database constraint not to insert two namespaces with the same name for the same artifact/platform.

Probably all that's needed is wrapping the call in a (set ,,,).

Metadata

Metadata

Assignees

No one assigned

    Labels

    AnalysisAnalysing projects (Clojure/Script sources & Git)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions