This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-06
Channels
- # announcements (3)
- # aws (3)
- # babashka (9)
- # beginners (87)
- # calva (3)
- # chlorine-clover (7)
- # cider (6)
- # clj-kondo (1)
- # cljs-dev (31)
- # cljsrn (7)
- # clojure (26)
- # clojure-berlin (5)
- # clojure-europe (84)
- # clojure-nl (3)
- # clojure-uk (13)
- # clojurescript (39)
- # core-async (4)
- # core-logic (3)
- # cursive (3)
- # datomic (10)
- # devcards (5)
- # duct (2)
- # emacs (3)
- # events (1)
- # fulcro (6)
- # jobs (4)
- # kaocha (12)
- # london-clojurians (1)
- # off-topic (21)
- # other-languages (2)
- # pathom (5)
- # pedestal (1)
- # re-frame (1)
- # reitit (3)
- # remote-jobs (6)
- # reveal (6)
- # sci (34)
- # shadow-cljs (99)
- # tools-deps (99)
after a discussion with @thheller (https://clojurians.slack.com/archives/C03S1L9DN/p1604658107070900) about some self-host macro issues I’ve run into, I found something that I think I can reproduce in cljs itself - https://github.com/clojure/clojurescript/compare/master...mhuebert:cljc-macros-require-test - does that look like it should work?
I was running fixed via ./script/test-self-host
on an older version of clojurescript, after rebasing master I’m seeingscript/bootstrap
SEVERE: /Users/mattmini/Documents/projects/clojurescript/builds/out-self/cljs/core.js:27: ERROR - Closure dependency methods(goog.provide, goog.require, etc) must be called at file scope.
cljs.core._STAR_target_STAR_ = goog.define("cljs.core._STAR_target_STAR_","default");
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
but the error above comes from mixing incompatible closure-compiler/closure-library versions
weird thing about that failing test: it is in a group of 4 related tests. if I move it to the last position in the group (after (ns foo.bar)\n(first [1 2 3])
), it passes
what voodoo. if I just copy it so it’s in both places (with a latch of 5), then both tests pass
so it looks like in selfhost cljs, calls to (ns …)
blow away existing ns data, which is different from clojure, where you can use (ns foo.bar)
to switch namespaces without removing existing mappings. this can explain the race conditions in tests that I was seeing. (not sure if it’s related to the original problem of unresolved aliases in macro namespaces.) https://github.com/mhuebert/clojurescript/pull/1/files#diff-7144cb9420ccfd2b33c6c96777c668bba2046694d2431c231d67357fc15008efR856
@braden.shepherdson that's why we don't update GCL or Closure Compiler very often
that said, it's on my plate to look at in the 3-4 weeks, and certainly before the end of the year
hm. I'm likely to discover other breaking changes, then, if I'm using master GCL and jscompiler.
patches welcome of course, but auditing everything that could go wrong is actually way more trouble than you may understand
I'll fiddle with it locally, and at least file a bug with the details. this AnonymousFunctionNamingPolicy
case specifically is an option being dropped, so it's easy enough to just stop setting it. I guess it's possible that there's downstream tooling that depends on setting it to something non-default, though I think this is a pretty obscure option.
I will also give it a try - Figwheel will also need a spin, I need to test Krell, yadda yadda
FWIW I took a look yesterday the offending code can just be removed. I doubt anyone ever used the related setting since source maps were introduced.
sure, I'm just pointing out that testing the new compiler/library takes some time now - it might be easy - might not - if things are working in shadow w/o other changes that's a good sign o' course
but shadow is on v20200830
without issues. I believe the september update just broke things because of the removal.
so it looks like in selfhost cljs, calls to (ns …)
blow away existing ns data, which is different from clojure, where you can use (ns foo.bar)
to switch namespaces without removing existing mappings. this can explain the race conditions in tests that I was seeing. (not sure if it’s related to the original problem of unresolved aliases in macro namespaces.) https://github.com/mhuebert/clojurescript/pull/1/files#diff-7144cb9420ccfd2b33c6c96777c668bba2046694d2431c231d67357fc15008efR856