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

build - set no-sandbox everywhere #81096

Merged
merged 1 commit into from Sep 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/azure-pipelines/linux/product-build-linux.yml
Expand Up @@ -100,7 +100,7 @@ steps:

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

Expand Down
2 changes: 1 addition & 1 deletion resources/linux/code-url-handler.desktop
Expand Up @@ -2,7 +2,7 @@
Name=@@NAME_LONG@@ - URL Handler
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=@@EXEC@@ --open-url %U
Exec=@@EXEC@@ --no-sandbox --open-url %U
Icon=@@ICON@@
Type=Application
NoDisplay=true
Expand Down
4 changes: 2 additions & 2 deletions resources/linux/code.desktop
Expand Up @@ -2,7 +2,7 @@
Name=@@NAME_LONG@@
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=@@EXEC@@ --unity-launch %F
Exec=@@EXEC@@ --no-sandbox --unity-launch %F
Icon=@@ICON@@
Type=Application
StartupNotify=false
Expand All @@ -14,5 +14,5 @@ Keywords=vscode;

[Desktop Action new-empty-window]
Name=New Empty Window
Exec=@@EXEC@@ --new-window %F
Exec=@@EXEC@@ --no-sandbox --new-window %F
Icon=@@ICON@@
4 changes: 2 additions & 2 deletions scripts/test-integration.sh
Expand Up @@ -8,7 +8,7 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
else
ROOT=$(dirname $(dirname $(readlink -f $0)))
VSCODEUSERDATADIR=`mktemp -d 2>/dev/null`
LINUX_NO_SANDBOX="--no-sandbox" # workaround Electron 6 issue on Linux when running tests in container
LINUX_NO_SANDBOX="--no-sandbox" # Electron 6 introduces a chrome-sandbox that requires root to run. This can fail. Disable sandbox via --no-sandbox.
fi

cd $ROOT
Expand All @@ -34,7 +34,7 @@ else
fi

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

# Tests in the extension host
"$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
Expand Down
2 changes: 1 addition & 1 deletion scripts/test.sh
Expand Up @@ -34,5 +34,5 @@ else
cd $ROOT ; \
ELECTRON_ENABLE_LOGGING=1 \
"$CODE" \
test/electron/index.js "$@"
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.
fi
6 changes: 5 additions & 1 deletion src/vs/code/node/cli.ts
Expand Up @@ -15,7 +15,7 @@ import { whenDeleted, writeFileSync } from 'vs/base/node/pfs';
import { findFreePort, randomPort } from 'vs/base/node/ports';
import { resolveTerminalEncoding } from 'vs/base/node/encoding';
import * as iconv from 'iconv-lite';
import { isWindows } from 'vs/base/common/platform';
import { isWindows, isLinux } from 'vs/base/common/platform';
import { ProfilingSession, Target } from 'v8-inspect-profiler';
import { isString } from 'vs/base/common/types';

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

if (isLinux) {
addArg(argv, '--no-sandbox'); // Electron 6 introduces a chrome-sandbox that requires root to run. This can fail. Disable sandbox via --no-sandbox
}

const child = spawn(process.execPath, argv.slice(2), options);

if (args.wait && waitMarkerFilePath) {
Expand Down