Fork me on GitHub
#shadow-cljs
<
2023-01-18
>
scarytom21:01:17

is there a reason why no compiler warnings are printed when I run npx shadow-cljs release app but plenty are when I run npx shadow-cljs compile app?

thheller05:01:27

do you have an example? compile includes preloads and other development stuff, release does not. so if the warnings are in dev-only files they wouldn't show up in release.

scarytom08:01:45

The warnings are all of the WARNING #1 - :infer-warning type, and started showing up as a result of https://github.com/thheller/shadow-cljs/blob/master/CHANGELOG.md#22017---2023-01-04 to shadow-cljs. We have :compiler-options {:warnings-as-errors true} set on our :release but our CI system didn't fail as expected because the warnings are only showing up locally when we run shadow-cljs compile or watch

thheller10:01:23

hmm not sure why they wouldn't show up for release. there is no difference in how that is handled. what happens if you run release locally?

thheller14:01:48

do you have examples for me? maybe the recent changes I did now show some invalid warnings?

scarytom16:01:39

If I run the release locally they do not show up either. I'm not sure how easily I can create a reproducible example of this... I'll try some things

thheller16:01:49

can you give an example of a warning? did you maybe just disable the warnings for release builds?

scarytom16:01:14

they are all :infer-warning from reagent/with-let as per https://github.com/reagent-project/reagent/issues/585

scarytom17:01:11

I have reproduced it with a vanilla sandpit shadow-cljs app now, so not to do with our setup.

scarytom17:01:33

would it be handy if i shared the git repo for the example?

scarytom17:01:54

one sec whilst I commit and push it

scarytom17:01:45

there you go. README demonstrates the issue

thheller20:01:46

in release builds *assert* is bound to false, so the code with the problem is never used

thheller20:01:11

:compiler-options {:elide-asserts false} makes it show up, but you don't really want asserts in release build

scarytom20:01:37

That's a satisfying conclusion. Thanks for investigating.

scarytom20:01:17

do you have a feeling for the best way to get this issue with reagent fixed? I saw your comments on the GitHub issue, and I've volunteered to do a pull request... all these compiler warnings are irksome.

thheller20:01:07

well I could revert the change I did which made them show up in the first place

thheller20:01:18

but that would hide legit externs problems again

thheller20:01:55

unfortunately there is no easy way to detect "this was expanded by a library macro," type of thing I could use to disable the warning

scarytom20:01:57

I don't think you should revert your change, it seems legitimate.

scarytom20:01:23

over our entire codebase it is only this one reagent macro that causes an issue. There are bound to be some other similar problems elsewhere too, but they will all get fixed upstream eventually.