Skip to content

Commit afde791

Browse files
author
Benjamin Pasero
authored
build - set no-sandbox everywhere (microsoft#81096)
1 parent c3d611c commit afde791

6 files changed

Lines changed: 12 additions & 8 deletions

File tree

build/azure-pipelines/linux/product-build-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ steps:
100100

101101
- script: |
102102
set -e
103-
DISPLAY=:10 ./scripts/test.sh --build --tfs --no-sandbox "Unit Tests"
103+
DISPLAY=:10 ./scripts/test.sh --build --tfs "Unit Tests"
104104
displayName: Run unit tests
105105
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
106106

resources/linux/code-url-handler.desktop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Name=@@NAME_LONG@@ - URL Handler
33
Comment=Code Editing. Redefined.
44
GenericName=Text Editor
5-
Exec=@@EXEC@@ --open-url %U
5+
Exec=@@EXEC@@ --no-sandbox --open-url %U
66
Icon=@@ICON@@
77
Type=Application
88
NoDisplay=true

resources/linux/code.desktop

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Name=@@NAME_LONG@@
33
Comment=Code Editing. Redefined.
44
GenericName=Text Editor
5-
Exec=@@EXEC@@ --unity-launch %F
5+
Exec=@@EXEC@@ --no-sandbox --unity-launch %F
66
Icon=@@ICON@@
77
Type=Application
88
StartupNotify=false
@@ -14,5 +14,5 @@ Keywords=vscode;
1414

1515
[Desktop Action new-empty-window]
1616
Name=New Empty Window
17-
Exec=@@EXEC@@ --new-window %F
17+
Exec=@@EXEC@@ --no-sandbox --new-window %F
1818
Icon=@@ICON@@

scripts/test-integration.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
88
else
99
ROOT=$(dirname $(dirname $(readlink -f $0)))
1010
VSCODEUSERDATADIR=`mktemp -d 2>/dev/null`
11-
LINUX_NO_SANDBOX="--no-sandbox" # workaround Electron 6 issue on Linux when running tests in container
11+
LINUX_NO_SANDBOX="--no-sandbox" # Electron 6 introduces a chrome-sandbox that requires root to run. This can fail. Disable sandbox via --no-sandbox.
1212
fi
1313

1414
cd $ROOT
@@ -34,7 +34,7 @@ else
3434
fi
3535

3636
# Integration tests in AMD
37-
./scripts/test.sh $LINUX_NO_SANDBOX --runGlob **/*.integrationTest.js "$@"
37+
./scripts/test.sh --runGlob **/*.integrationTest.js "$@"
3838

3939
# Tests in the extension host
4040
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/vscode-api-tests/testWorkspace --extensionDevelopmentPath=$ROOT/extensions/vscode-api-tests --extensionTestsPath=$ROOT/extensions/vscode-api-tests/out/singlefolder-tests --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --disable-inspect --user-data-dir=$VSCODEUSERDATADIR

scripts/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ else
3434
cd $ROOT ; \
3535
ELECTRON_ENABLE_LOGGING=1 \
3636
"$CODE" \
37-
test/electron/index.js "$@"
37+
test/electron/index.js --no-sandbox "$@" # Electron 6 introduces a chrome-sandbox that requires root to run. This can fail. Disable sandbox via --no-sandbox.
3838
fi

src/vs/code/node/cli.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { whenDeleted, writeFileSync } from 'vs/base/node/pfs';
1515
import { findFreePort, randomPort } from 'vs/base/node/ports';
1616
import { resolveTerminalEncoding } from 'vs/base/node/encoding';
1717
import * as iconv from 'iconv-lite';
18-
import { isWindows } from 'vs/base/common/platform';
18+
import { isWindows, isLinux } from 'vs/base/common/platform';
1919
import { ProfilingSession, Target } from 'v8-inspect-profiler';
2020
import { isString } from 'vs/base/common/types';
2121

@@ -360,6 +360,10 @@ export async function main(argv: string[]): Promise<any> {
360360
options['stdio'] = 'ignore';
361361
}
362362

363+
if (isLinux) {
364+
addArg(argv, '--no-sandbox'); // Electron 6 introduces a chrome-sandbox that requires root to run. This can fail. Disable sandbox via --no-sandbox
365+
}
366+
363367
const child = spawn(process.execPath, argv.slice(2), options);
364368

365369
if (args.wait && waitMarkerFilePath) {

0 commit comments

Comments
 (0)