Finally identify and eliminate the root cause of npm/npm#5082
.
- on the machines available to me, doesn't happen at all
- happens during tarball creation, so can be triggered with
npm pack
(and doesn't require a full npm publish) - doesn't just happen for
index.js
- requires a pre-existing, shared cache
- files are being included after being run through fstream-npm and fstream-ignore's exclusion rules
- is two race condtions
- the source of #5082 is something that causes files to not be included in the packed tarball
- another one happens even more rarely within the npm cache and is linked to multiple runs of npm operating on the same package simultaneously
- is occurring in either
fstream
,fstream-npm
,fstream-ignore
,node-tar
, or npm'slib/utils/tar.js
- seems to be happening more in Node.js 6.0.0:
- https://twitter.com/SamVerschueren/status/725308337169006597
- https://twitter.com/sindresorhus/status/725351897629077504
- Bisecting says the commit in Node.js core that made this occur more frequently is b488b19eaf
- is happening when a file that explicitly shouldn't be ignored is nevertheless not making it into the tarball
add all basic scenarios- ~~create a stress-testing harness that will run the tests concurrently ~10 or so times~~
- instrument npm to figure out where the entries are getting dropped
git clone https://github.com/othiym23/eliminate-5082
cd eliminate-5082
npm it