Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subprocess worker needs default for options #1777

Closed
warner opened this issue Sep 16, 2020 · 0 comments
Closed

subprocess worker needs default for options #1777

warner opened this issue Sep 16, 2020 · 0 comments
Labels
bug Something isn't working SwingSet package: SwingSet

Comments

@warner
Copy link
Member

warner commented Sep 16, 2020

We found the subprocess-worker tests (which were disabled) were breaking because startSubprocessWorker is called without arguments, but it assumes it will receive an options object. The simplest fix is to give it a default:

diff --git a/packages/SwingSet/src/spawnSubprocessWorker.js b/packages/SwingSet/src/spawnSubprocessWorker.js
index 9bc3e0ae..6d56558e 100644
--- a/packages/SwingSet/src/spawnSubprocessWorker.js
+++ b/packages/SwingSet/src/spawnSubprocessWorker.js
@@ -20,7 +20,7 @@ const supercode = require.resolve(
 // always be Node.
 const stdio = harden(['inherit', 'inherit', 'inherit', 'pipe', 'pipe']);

-export function startSubprocessWorker(options) {
+export function startSubprocessWorker(options = {}) {
   const execPath = options.execPath || process.execPath;
   const args = options.args || ['-r', 'esm', supercode];
   const proc = spawn(execPath, args, { stdio });

however we should look at the two places from which that is called and build a more uniform signature, maybe startSubprocessWorker(execPath, options = {}).

@warner warner added bug Something isn't working SwingSet package: SwingSet labels Sep 16, 2020
warner added a commit that referenced this issue Sep 17, 2020
warner added a commit that referenced this issue Sep 17, 2020
@warner warner closed this as completed in afeced8 Sep 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SwingSet package: SwingSet
Projects
None yet
Development

No branches or pull requests

1 participant