rescript-compiler icon indicating copy to clipboard operation
rescript-compiler copied to clipboard

rescript format -all fails with a socket error

Open bloodyowl opened this issue 4 years ago • 2 comments

$ rescript format -all
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: read ENOTCONN
    at tryReadStart (net.js:574:20)
    at Socket._read (net.js:585:5)
    at Socket.Readable.read (_stream_readable.js:481:10)
    at Socket.read (net.js:625:39)
    at new Socket (net.js:377:12)
    at Object.Socket (net.js:269:41)
    at createSocket (internal/child_process.js:314:14)
    at ChildProcess.spawn (internal/child_process.js:433:23)
    at spawn (child_process.js:553:9)
    at Object.execFile (child_process.js:237:17)
Emitted 'error' event on Socket instance at:
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -57,
  code: 'ENOTCONN',
  syscall: 'read'
}

bloodyowl avatar Jun 17 '21 11:06 bloodyowl

How many files are there in your project? It might be my naive implementation of rescript format which can not handle so many files concurrently. Basically it do an async shell call per file. contributions to the fix is welcome

bobzhang avatar Jun 20 '21 00:06 bobzhang

I've got ~2.6K files (res & resi).

I'd be glad to contribute, I'm going to try formatting by chunks of n files sequentially and see on my project where the limit would fit nicely.

bloodyowl avatar Jun 20 '21 06:06 bloodyowl

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 10 '23 10:06 stale[bot]