@relayflows/sdk 2.0.40 → 2.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -125,10 +125,17 @@ process.exit(result.status===0?0:1);`;
125
125
  // The other gate that spawns a child. Its `wc` stderr was piped and then
126
126
  // discarded, so a broken or absent `wc` was reported as a word count out
127
127
  // of bounds. A bounded suffix of what it said travels with the cause.
128
+ //
129
+ // EPIPE is not "could not run": it means wc ran and exited before
130
+ // reading all of `input` (it crashed, was killed, or never reads
131
+ // stdin). spawnSync still reports its status, signal and output, so
132
+ // those decide the verdict. Whether the write raced wc's exit is
133
+ // timing, so it must not change the verdict; reporting it hid what wc
134
+ // did (#611).
128
135
  body = `const result=cp.spawnSync('wc',['-w'],{input:text,encoding:'utf8',env:{...process.env,LC_ALL:'C'}});
129
136
  const noise=(result.stderr||'').trim().slice(-200);
130
137
  const said=noise===''?'':': '+noise;
131
- if(result.error)fail('could not run wc -w: '+(result.error.code||result.error.message)+said);
138
+ if(result.error&&result.error.code!=='EPIPE')fail('could not run wc -w: '+(result.error.code||result.error.message)+said);
132
139
  if(result.signal)fail('wc -w was terminated by '+result.signal+said);
133
140
  if(result.status!==0)fail('wc -w exited '+result.status+said);
134
141
  const count=result.stdout.trim();