Open Beanow opened 5 years ago
The workaround: https://github.com/sfosc/sourcecred/commit/45dd1bf32eb7069c2294f119ab02e2fb524e09d6
Working build output: https://drone.sfosc.robin-it.com/sfosc/sourcecred/31/1/2
I was able to reproduce it more reliably using the attached scores file. sfosc-sfosc-scores.zip
$ widgets/bin/contributor-wall-svg.js > sfosc-sfosc-contributors.svg < sfosc-sfosc-scores.json
# No problem
$ cat sfosc-sfosc-scores.json | widgets/bin/contributor-wall-svg.js > sfosc-sfosc-contributors.svg
# No problem
$ echo "$(cat sfosc-sfosc-scores.json)" | widgets/bin/contributor-wall-svg.js > sfosc-sfosc-contributors.svg
# Error: EAGAIN: resource temporarily unavailable, read
I've got a script where I'm directly piping
sourcecred score
into widgets'bin/contributor-wall-svg.js
here: https://github.com/sfosc/sourcecred/blob/70dbdb6621cbaa4a2a6280a8f9d53b584d0b10f8/scripts/rebuild-site.sh#L76In some cases (like the current sfosc/sfosc repo) this causes an EAGAIN error, both locally and on the CI build: https://drone.sfosc.robin-it.com/sfosc/sourcecred/30/1/2
Strangely enough it can be resolved by writing the scores to a file and using the
<
operator to read this file instead of|
to pipe directly from thesourcecred scores
output.I can't explain why this is happening exactly yet, my suspicion is it may be related to how piping gets buffered vs reading from files. Either way the current read from stdin seems brittle.