fbonetti / elm-rails

View helpers for incorporating Elm modules into Rails views
MIT License
75 stars 20 forks source link

Workaround for slow elm compilations on CI #27

Closed botandrose closed 6 years ago

botandrose commented 6 years ago

Travis was experiencing absurdly lengthy elm-make times for the trivial Elm code in the acceptance test, in the order of twenty minutes. Turns out this is caused to Elm's compiler trying to parallelize over more cores than is prudent, due to idiosyncrasies in Travis's shared environment.

We have to work around this, since Evan only merges and releases bugfixes every few years (if you're lucky). We do so by wrapping elm-make in a wrapper that lies about the number of available cpus, hardcoding it to 2. As a result, CI times drop from ~30m to ~5m.

Solution copied from: https://github.com/elm-lang/elm-compiler/issues/1473#issuecomment-245704142