This gist reproduces a bug in Yarn v0.27.5.
The bug is caused by Yarn returning exit status 0 when a script inside the package.json "scripts" causes a segmentation fault.
This only happens when there is a single command in the script (e.g.: "test": "./segfault"
). When there are several commands in the script (e.g.: "test-alt": "true && ./segfault"
) it returns an exit status 1.
This bug causes errors to be unnoticed in CI builds, where everything seems to be OK.
Steps to reproduce:
- Download the gist.
- Execute
yarn run test ; echo "Exit status $?"
to reproduce the issue. - Execute
yarn run test-alt ; echo "Exit status $?"
to reproduce a workaround for the issue.