Skip to content

Commit

Permalink
Faster builds by limiting visible CPUs
Browse files Browse the repository at this point in the history
As described in this elm compiler issue:
elm/compiler#1473
  • Loading branch information
davcamer committed Aug 12, 2018
1 parent 8c189ac commit 4222b87
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ before_install:

install:
- ./install_protobuf
- ./install_sysconfcpus
- export PATH=$PATH:$PWD/protoc/bin
- go get -t -v ./protoc-gen-elm
- protoc --version
Expand Down
10 changes: 10 additions & 0 deletions install_sysconfcpus
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -ex

echo "Install libsysconfcpus to compensate for slow elm builds"
# More at: https://github.com/elm/compiler/issues/1473
git clone https://github.com/obmarg/libsysconfcpus.git
cd libsysconfcpus
./configure && make && sudo make install
cd ..
8 changes: 7 additions & 1 deletion protoc-gen-elm/elm_tests/run_elm_tests
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@ readonly ROOT="$(dirname "$0")"

(
cd ${ROOT}
elm-test
# If sysconfcpus is on path, as on travis, then limit the number of
# visible CPUs to 1 to work around the elm problems with many CPUs.
if [ -x "$(command -v sysconfcpus)" ]; then
sysconfcpus -n 1 elm-test
else
elm-test
fi
)

0 comments on commit 4222b87

Please sign in to comment.