cherry

ikitommi 2024-04-20T12:23:55.866179Z

When updating malli dependencies, Cherry got updated from 0c4e0d1de534a4cf910ed7079638dbcfec8ec8b7 to 3f78c7e03e1b940c0cbc05e8c5bc76f8295055cb, breaking the sci-tests. Seems like the namespace aliases don’t work as expected. Using this config:

(defn -default-sci-options []
  {:preset :termination-safe
   :aliases {'str 'clojure.string
             'm 'malli.core}
   :namespaces {'malli.core {'properties properties
                             'type type
                             'children children
                             'entries entries}}})
any ideas what has changed and how to mitigate?

borkdude 2024-04-20T12:24:57.348379Z

interesting...

borkdude 2024-04-20T12:25:26.473089Z

can you log an issue with SCI? I'll take a look on Monday

borkdude 2024-04-20T12:25:43.503129Z

preferably a SCI-only repro if possible

ikitommi 2024-04-20T12:28:26.500289Z

I’ll do that

borkdude 2024-04-22T09:05:02.679679Z

@ikitommi alright, I'll wait for the issue

borkdude 2024-04-22T09:06:35.038829Z

@ikitommi is it about this failing test? https://github.com/metosin/malli/actions/runs/8764828329/job/24055235948 I don't see how this is related to SCI though

borkdude 2024-04-22T09:09:14.825029Z

it's probably a cherry issue, I'll take a look later today

ikitommi 2024-04-22T09:19:12.372359Z

forgot, wrote it to cherry: https://github.com/squint-cljs/cherry/issues/130

ikitommi 2024-04-22T09:19:35.808929Z

it’s just using SCI under Cherry.

borkdude 2024-04-22T09:20:11.516399Z

SCI under cherry?

borkdude 2024-04-22T09:20:22.655179Z

I'm confused

ikitommi 2024-04-22T12:04:51.966879Z

the failing code uses m/eval, e.g.

(m/eval "(m/properties [int? {:district 9}])")
doesn’t work anymore with cherry.

borkdude 2024-04-22T12:12:11.035329Z

yes, but how does that relate to SCI?

borkdude 2024-04-22T12:12:34.298949Z

I'll take a look regardless, doesn't matter

ikitommi 2024-04-22T13:35:44.225259Z

thanks! m/eval uses SCI to evaluate the code, to be honest, I have no idea how that works with cherry.

borkdude 2024-04-22T13:36:51.094859Z

it only uses SCI if you enable SCI. If you enable cherry, m/eval evaluates through cherry only:

(defn eval
  ([code] (eval code nil))
  ([code _opts]
   (cond (or (symbol? code)
             (seq? code))
         (cherry/eval-form code cherry-opts)
         (string? code)
         (cherry/eval-string code cherry-opts)
         :else code)))

(set! malli.core/eval eval)

borkdude 2024-04-22T13:37:00.968359Z

That code is in malli.cherry

👌 1
borkdude 2024-04-22T13:37:08.532669Z

I'll take a look right now

borkdude 2024-04-22T14:45:39.396299Z

should be fixed with cherry main branch now, sorry for the inconvenience