From b9cf309404e54d7778afb6a039703a62627ddf64 Mon Sep 17 00:00:00 2001 From: Etienne Dusseault Date: Wed, 30 Jun 2021 12:37:03 +0800 Subject: [PATCH] don't run subprocesses in lavamoat if main process not run in lavamoat (#11417) --- development/build/task.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/development/build/task.js b/development/build/task.js index bc6f92005..b6e0f554b 100644 --- a/development/build/task.js +++ b/development/build/task.js @@ -68,9 +68,20 @@ function runInChildProcess(task) { ); } return instrumentForTaskStats(taskName, async () => { - const childProcess = spawn('yarn', ['build', taskName, '--skip-stats'], { - env: process.env, - }); + let childProcess; + // don't run subprocesses in lavamoat for dev mode if main process not run in lavamoat + if ( + taskName.includes('scripts:core:dev') && + !process.argv[0].includes('lavamoat') + ) { + childProcess = spawn('yarn', ['build:dev', taskName, '--skip-stats'], { + env: process.env, + }); + } else { + childProcess = spawn('yarn', ['build', taskName, '--skip-stats'], { + env: process.env, + }); + } // forward logs to main process // skip the first stdout event (announcing the process command) childProcess.stdout.once('data', () => {