Build (skipped the middle since it was boring)
(…)
The build hangs at this point and eventually circle times out (no output for 10 minutes) and kills the build.
Circle.yml file (relevant portions):
machine: pre: - mkdir -p ~/.yarn-cache environment: RAILS_ENV: test RACK_ENV: test NODE_ENV: test dependencies: override: - nvm install v4.4.6 # default version in image of 0.x.y can't run yarn - nvm alias default v4.4.6 - sudo apt-key adv --keyserver pgp.mit.edu --recv D101F7899D41F3C3 - echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list - sudo apt-get update -qq - sudo apt-get install -y -qq yarn - mkdir -p node_modules && rm -r node_modules/ - yarn install --pure-lockfile # this is the step that hangs cache_directories: - "~/.yarn-cache"
Tightest reproducible case
- The tightest reproducible case I could come up with was:
- SSH into the node
-
/bin/dash
since that’s the shell used by Circle to run commands apparently. (Note: no errors seen when using bash shell, which is the default upon ssh’ing in) yarn install --pure-lockfile
Expectd: yarn install
succeeds
Actual: yarn install
fails as above.
Some approaches attempted (none succeeded):
- Change the line in circle.yml to push it toward bash (
- /bin/bash -c "yarn install --pure-lockfile"
) - Redirect all output to /dev/null (
- yarn install --pure-lockfile >/dev/null 2>/dev/null
) - Turn off emoji (
yarn install --no-emoji --pure-lockfile
)
My very ugly hack to bring this temporarily operational was:
- Set the install command to
- sleep 150 && yarn install
- SSH into the node during build, stay in bash shell
- Wait until the sleep is entered, run
yarn install
to completion
Cache is now seeded and future builds run without errors. Rebuilding without cache re-introduces the failure.
Any other suggestions on why dash/yarn would not be playing nice together? Nothing obvious appeared when looking through the yarnpkg issues on github.