This repository has been archived by the owner on Sep 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Odd bug reading from stdin #14
Labels
bug
Something isn't working
Comments
Beanow
added a commit
to sfosc/sourcecred
that referenced
this issue
Aug 7, 2019
The workaround: Working build output: |
I was able to reproduce it more reliably using the attached scores file. $ 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 |
Beanow
added a commit
to sfosc/sourcecred
that referenced
this issue
Aug 22, 2019
Locally generating SVGs had the same EAGAIN bug. See sourcecred/widgets#14
Beanow
added a commit
to sfosc/sourcecred
that referenced
this issue
Aug 22, 2019
Locally generating SVGs had the same EAGAIN bug. See sourcecred/widgets#14
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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#L76
In 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.
The text was updated successfully, but these errors were encountered: