Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Arities must be distinct" error when using direct linking in Clojure 1.8 #339

Open
camsaul opened this issue Feb 13, 2016 · 2 comments
Open

Comments

@camsaul
Copy link
Contributor

camsaul commented Feb 13, 2016

I'm seeing an "Arities must be distinct" RuntimeException when running lein uberjar with direct linking (-Dclojure.compiler.direct-linking=true) enabled.

Caused by: java.lang.RuntimeException: Arities must be distinct
    at schema.core$make_fn_schema.invokeStatic(core.clj:1049)
    at metabase.driver.query_processor.expand$fn__20187.invokeStatic(expand.clj:101)
    ...

It's being triggered by a 2-arity s/defn function that looks like this:

(s/defn ^:ql ^:always-validate datetime-field :- FieldPlaceholder
  ([f _ unit] (datetime-field f unit))
  ([f unit]   (assoc (field f) :datetime-unit (normalize-token unit))))
@camsaul camsaul changed the title "Arities must be distinct" error when compiling jar in Clojure 1.8 "Arities must be distinct" error when using direct linking in Clojure 1.8 Feb 13, 2016
@w01fe
Copy link
Member

w01fe commented Feb 13, 2016

Thanks for the report. I don't see why it shouldn't work. I have no experience with direct linking and can't reproduce with this example, so if you could provide a test project that exhibits the error (or dig in further yourself) that would be a big help. Thanks again!

@w01fe
Copy link
Member

w01fe commented Feb 16, 2016

I looked into it and the issue seems to be that there are two copies of the
schema.core.One class floating around in this AOT compilation setting.

This causes the (instance? One ...) check in arity- to return false on
both arities (when it should return true on both), which causes the
assertion failure.

I've never used AOT myself so I'm not sure where to go from here, however.

On Tue, Feb 16, 2016 at 3:43 AM, Cam Saül [email protected] wrote:

Hey @w01fe https://github.com/w01fe if you take a look at
https://github.com/camsaul/metabase/blob/master/project.clj and run lein
uberjar you'll get the error


Reply to this email directly or view it on GitHub
#339 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants