Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to decrease Elm compile time on Circle CI or Travis CI?

elm compilation is very slow on ci (circle/travis). I personally suffer from >30m build times on circle for a rather small elm project. https://github.com/elm-lang/elm-compiler/issues/1473 suggests "CPU count detection is the problem" and recommends using libsysconfcpus to return 1 CPU in lieu of the actual detected amount. Is there another way to mitigate this long compilation time?

like image 506
sjt003 Avatar asked Jan 12 '17 00:01

sjt003


2 Answers

From https://elmlang.slack.com/archives/general/p1484149451013255

@rtfeldman:

there's a known speed problem with both Circle and Travis because they misreport their number of CPUs, but there's a workaround: add the equivalent of these to your Circle config:

  • https://github.com/elm-community/elm-test/blob/master/.travis.yml#L6
  • https://github.com/elm-community/elm-test/blob/master/.travis.yml#L22-L30
  • https://github.com/elm-community/elm-test/blob/master/.travis.yml#L39-L41 (edited)

they basically swap out elm-make for a script that runs elm-make with sysconfcpus -n 2 so that elm-make becomes aware of the actual number of CPUs available

I talked with the Circle folks a bit about this, and the tl;dr is that they're not interested in fixing it, but it may fix itself in a future release of some upstream stuff they're using

like image 148
rofrol Avatar answered Jan 03 '23 00:01

rofrol


Consider setting:

sudo: true

in your .travis.yml. It cut a Haskell build of mine from 18 minutes down to 3.

like image 32
Colin Woodbury Avatar answered Jan 03 '23 02:01

Colin Woodbury