Fork me on GitHub
#shadow-cljs
<
2022-03-29
>
Gleb Posobin08:03:57

Is there a way to make :advanced release mode deterministic? Mozilla's extension store is asking for a source that produces the minified build that I have supplied, but I can't provide it as the output of the release :advanced build is different on every run (without changing the source code). Even putting it in a docker container hasn't helped.

thheller17:03:52

unfortunately not possible. builds in general are not deterministic

thheller17:03:32

I guess a simple build could be somewhat deterministic if you remove all threading and always start with a fresh JVM

Gleb Posobin23:03:46

Sad. Just curious: what's the source of nondeterminism here? Does it help in some way somewhere?

Gleb Posobin04:03:45

Apparently closure compiler was striving to be deterministic in 2010: https://groups.google.com/g/closure-compiler-discuss/c/9pJ-tuGtnvM Though I guess now it is not. I wonder what has changed.

thheller06:03:03

hmm maybe the closure compiler is? haven't tried in a long time. the cljs compiler isn't though

thheller06:03:43

it uses (gensym) from clojure a whole lot. which uses an increasing integer to make the symbols unique. so some# becomes some_1234 or so

thheller06:03:06

when you add threads to the mix the way this increases is not determinisitic

thheller06:03:23

you can set :compiler-options {:parallel-build false} in your build config to turn off multithread during compilation

thheller06:03:16

maybe if you run everything in a container then the setup is similar enough to be deterministic?

Ted Ciafardini13:03:16

Anyone know how to properly get rid of this error message? I’ve tried a few things, like setting jvm-opts to ["--engine.WarnInterpreterOnly=false"] in my shadow-cljs.edn

shadow-cljs - config: /Users/esciaf/Projects/full-stack/shadow-cljs.edn
[To redirect Truffle log output to a file use one of the following options:
* '--log.file=<path>' if the option is passed using a guest language launcher.
* '-Dpolyglot.log.file=<path>' if the option is passed using the host Java launcher.
* Configure logging using the polyglot embedding API.]
[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation.
The guest application code will therefore be executed in interpreted mode only.
Execution only in interpreted mode will strongly impact the guest application performance.
For more information on using GraalVM see .
To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.

Ted Ciafardini13:03:28

Realizing maybe I didn’t give the full context of this stituation…. This happens when I run shadow-cljs watch blogg and my shadow-cljs.edn looks like this:

{:source-paths ["src/cljs"]
 :nrepl {:port 9888}
 :dependencies [[cider/cider-nrepl "0.21.0"]
                [cljs-ajax "0.8.0"]
                [reagent "1.0.0-alpha2"]
                [re-frame "1.3.0-rc3"]
                [binaryage/devtools "1.0.4"]]
 :builds {:blogg {:target :browser
                  :compiler-options {:output-feature-set :es6}
                  :output-dir "resources/public/js"
                  :asset-path "/js"
                  :modules {:main {:init-fn blogg.core/init}}
                  :devtools {:http-root "resources/public"
                             :http-port 4888}}}}

Karol Wójcik13:03:07

Can confirm the same issue.

thheller17:03:08

["--engine.WarnInterpreterOnly=false"] should be `["-Dpolyglot.engine.WarnInterpreterOnly =false"]`

thheller17:03:25

-D sets properties

thheller17:03:54

you can just ignore this though. it'll be gone soon

👍 1
lambdam16:03:54

Hello everyone, Is there something similar to deps.edn extra-paths for shadow-cljs.edn's :build field. (I wish to separate some paths for Node.js back and browser front)

neural17:03:30

As far i know dependencies goes only in :source-paths. Check section 5.2 of shadow manual! https://shadow-cljs.github.io/docs/UsersGuide.html#_dependencies

thheller17:03:38

@dam just keep all source-paths all the time. sources that are not required in a build are not included, so it doesn't hurt to have them all available

lambdam17:03:15

@thheller wonderful. Thanks.

mauricio.szabo22:03:34

Anybody using the react-native target of Shadow-CLJS? I'm seeing no filename or row at any stacktrace when it gets printed at the bundler. Is it normal? All is see is something like:

ERROR  Warning: blahblahblah for example
    in Pressable
    in Button (created by example.code/SomeElement)
    in RCTView (at View.js:32)
    in View (created by example.code/SomeElement)
    in RCTView (at View.js:32)
   ...

lambdam22:03:21

Another question. I try to configure the hot code reload on Node.js, but the behavior seems weird : • When launching the project, none of my functions seems to be executed on the REPL. • After configuring the project following the documentation (https://shadow-cljs.github.io/docs/UsersGuide.html#NodeHotCodeReload) the hooks do not seem to be called on file saving and new definitions of vars aren't considered when executing them. Did I miss something? Thanks