Skip to content

Conversation

varungandhi-src
Copy link
Contributor

execSync in NodeJS takes a maxBuffer argument; it will not dynamically allocate
the output. When doing pip show, we could run into an ENOBUFS error if the buffer
size was too small, as a part of path listing. This means there are two options:

  1. Use exec (or spawn): This requires CPS-ing the code all the way up to main.
  2. Use a bigger buffer.

We go with option 2 because it's not worth changing everything to callbacks
just for this. All the other I/O uses sync operations anyway.

For the bigger buffer case, we put in retry logic because that is 'free';
it doesn't make sense to provide a CLI flag for the user to customize this,
because what they'll do is look at the error and increase the value;
so we just do it for them.

Fixes #151

execSync in NodeJS takes a maxBuffer argument; it will not dynamically allocate
the output. When doing `pip show`, we could run into an ENOBUFS error if the buffer
size was too small, as a part of path listing. This means there are two options:

1. Use exec (or spawn): This requires CPS-ing the code all the way up to main.
2. Use a bigger buffer.

We go with option 2 because it's not worth changing everything to callbacks
just for this. All the other I/O uses sync operations anyway.

For the bigger buffer case, we put in retry logic because that is 'free';
it doesn't make sense to provide a CLI flag for the user to customize this,
because what they'll do is look at the error and increase the value;
so we just do it for them.
@varungandhi-src varungandhi-src merged commit 483c95b into scip Sep 1, 2025
4 checks passed
@varungandhi-src varungandhi-src deleted the vg/buf-size branch September 1, 2025 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gathering environment information fails consistently

1 participant