diff --git a/build/azure-pipelines/common/createAsset.js b/build/azure-pipelines/common/createAsset.js index 43cdc96c063..a5a4c14dc4d 100644 --- a/build/azure-pipelines/common/createAsset.js +++ b/build/azure-pipelines/common/createAsset.js @@ -85,12 +85,15 @@ function getPlatform(product, os, arch, type) { } return `darwin-${arch}`; case 'server': - return 'server-darwin'; - case 'web': - if (arch !== 'x64') { - throw new Error(`What should the platform be?: ${product} ${os} ${arch} ${type}`); + if (arch === 'x64') { + return 'server-darwin'; } - return 'server-darwin-web'; + return `server-darwin-${arch}`; + case 'web': + if (arch === 'x64') { + return 'server-darwin-web'; + } + return `server-darwin-${arch}-web`; default: throw new Error(`Unrecognized: ${product} ${os} ${arch} ${type}`); } diff --git a/build/azure-pipelines/common/createAsset.ts b/build/azure-pipelines/common/createAsset.ts index 26c9e1a0b0e..a1b91071f95 100644 --- a/build/azure-pipelines/common/createAsset.ts +++ b/build/azure-pipelines/common/createAsset.ts @@ -100,12 +100,15 @@ function getPlatform(product: string, os: string, arch: string, type: string): s } return `darwin-${arch}`; case 'server': - return 'server-darwin'; - case 'web': - if (arch !== 'x64') { - throw new Error(`What should the platform be?: ${product} ${os} ${arch} ${type}`); + if (arch === 'x64') { + return 'server-darwin'; } - return 'server-darwin-web'; + return `server-darwin-${arch}`; + case 'web': + if (arch === 'x64') { + return 'server-darwin-web'; + } + return `server-darwin-${arch}-web`; default: throw new Error(`Unrecognized: ${product} ${os} ${arch} ${type}`); } diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index e0d4c43d8e3..4529f64b243 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -124,11 +124,11 @@ steps: - script: | set -e VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \ - yarn gulp vscode-reh-darwin-min-ci + yarn gulp vscode-reh-darwin-$(VSCODE_ARCH)-min-ci VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \ - yarn gulp vscode-reh-web-darwin-min-ci + yarn gulp vscode-reh-web-darwin-$(VSCODE_ARCH)-min-ci displayName: Build Server - condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64')) + condition: and(succeeded(), ne(variables['VSCODE_ARCH'], 'universal')) - script: | set -e @@ -200,7 +200,7 @@ steps: APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH) APP_NAME="`ls $APP_ROOT | head -n 1`" INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \ - VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin" \ + VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin-$(VSCODE_ARCH)" \ ./scripts/test-integration.sh --build --tfs "Integration Tests" displayName: Run integration tests (Electron) timeoutInMinutes: 20 @@ -208,7 +208,7 @@ steps: - script: | set -e - VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-darwin" \ + VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-darwin-$(VSCODE_ARCH)" \ ./scripts/test-web-integration.sh --browser webkit displayName: Run integration tests (Browser, Webkit) timeoutInMinutes: 20 @@ -219,7 +219,7 @@ steps: APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH) APP_NAME="`ls $APP_ROOT | head -n 1`" INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \ - VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin" \ + VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin-$(VSCODE_ARCH)" \ ./scripts/test-remote-integration.sh displayName: Run integration tests (Remote) timeoutInMinutes: 20 @@ -227,7 +227,7 @@ steps: - script: | set -e - VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-darwin" \ + VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-darwin-$(VSCODE_ARCH)" \ yarn smoketest-no-compile --web --headless timeoutInMinutes: 10 displayName: Run smoke tests (Browser, Chromium) @@ -247,7 +247,7 @@ steps: set -e APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH) APP_NAME="`ls $APP_ROOT | head -n 1`" - VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin" \ + VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin-$(VSCODE_ARCH)" \ yarn smoketest-no-compile --build "$APP_ROOT/$APP_NAME" --remote timeoutInMinutes: 10 displayName: Run smoke tests (Remote) @@ -296,27 +296,43 @@ steps: set -e # package Remote Extension Host - pushd .. && mv vscode-reh-darwin vscode-server-darwin && zip -Xry vscode-server-darwin.zip vscode-server-darwin && popd + pushd .. && mv vscode-reh-darwin-$(VSCODE_ARCH) vscode-server-darwin && zip -Xry vscode-server-darwin-$(VSCODE_ARCH).zip vscode-server-darwin && popd # package Remote Extension Host (Web) - pushd .. && mv vscode-reh-web-darwin vscode-server-darwin-web && zip -Xry vscode-server-darwin-web.zip vscode-server-darwin-web && popd + pushd .. && mv vscode-reh-web-darwin-$(VSCODE_ARCH) vscode-server-darwin-web && zip -Xry vscode-server-darwin-$(VSCODE_ARCH)-web.zip vscode-server-darwin-web && popd displayName: Prepare to publish servers - condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), ne(variables['VSCODE_PUBLISH'], 'false')) + condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'), ne(variables['VSCODE_ARCH'], 'universal')) - publish: $(Agent.BuildDirectory)/VSCode-darwin-$(VSCODE_ARCH).zip artifact: unsigned_vscode_client_darwin_$(VSCODE_ARCH)_archive displayName: Publish client archive condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false')) + - script: | + mv $(agent.builddirectory)/vscode-server-darwin-x64.zip $(agent.builddirectory)/vscode-server-darwin.zip + mv $(agent.builddirectory)/vscode-server-darwin-x64-web.zip $(agent.builddirectory)/vscode-server-darwin-web.zip + displayName: Rename x64 server builds to their legacy names + condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'), eq(variables['VSCODE_ARCH'], 'x64')) + + - publish: $(Agent.BuildDirectory)/vscode-server-darwin-arm64.zip + artifact: vscode_server_darwin_arm64_archive-unsigned + displayName: Publish arm64 server archive + condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'), eq(variables['VSCODE_ARCH'], 'arm64')) + + - publish: $(Agent.BuildDirectory)/vscode-server-darwin-arm64-web.zip + artifact: vscode_web_darwin_arm64_archive-unsigned + displayName: Publish arm64 web server archive + condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'), eq(variables['VSCODE_ARCH'], 'arm64')) + - publish: $(Agent.BuildDirectory)/vscode-server-darwin.zip - artifact: vscode_server_darwin_$(VSCODE_ARCH)_archive-unsigned - displayName: Publish server archive - condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), ne(variables['VSCODE_PUBLISH'], 'false')) + artifact: vscode_server_darwin_x64_archive-unsigned + displayName: Publish x64 server archive + condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'), eq(variables['VSCODE_ARCH'], 'x64')) - publish: $(Agent.BuildDirectory)/vscode-server-darwin-web.zip - artifact: vscode_web_darwin_$(VSCODE_ARCH)_archive-unsigned - displayName: Publish web server archive - condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), ne(variables['VSCODE_PUBLISH'], 'false')) + artifact: vscode_web_darwin_x64_archive-unsigned + displayName: Publish x64 web server archive + condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'), eq(variables['VSCODE_ARCH'], 'x64')) - task: AzureCLI@2 inputs: @@ -358,9 +374,9 @@ steps: inputs: BuildDropPath: $(agent.builddirectory)/vscode-server-darwin PackageName: Visual Studio Code Server - condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'), eq(variables['VSCODE_ARCH'], 'x64')) + condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'), ne(variables['VSCODE_ARCH'], 'universal')) - publish: $(agent.builddirectory)/vscode-server-darwin/_manifest displayName: Publish SBOM (server) artifact: vscode_server_darwin_$(VSCODE_ARCH)_sbom - condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'), eq(variables['VSCODE_ARCH'], 'x64')) + condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'), ne(variables['VSCODE_ARCH'], 'universal')) diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js index b72e1e44008..757f670cff2 100644 --- a/build/gulpfile.reh.js +++ b/build/gulpfile.reh.js @@ -39,7 +39,8 @@ const REMOTE_FOLDER = path.join(REPO_ROOT, 'remote'); const BUILD_TARGETS = [ { platform: 'win32', arch: 'ia32' }, { platform: 'win32', arch: 'x64' }, - { platform: 'darwin', arch: null }, // TODO@server-darwin-arm64: See also postinstall.js which hard-codes remote to x64 + { platform: 'darwin', arch: 'x64' }, + { platform: 'darwin', arch: 'arm64' }, { platform: 'linux', arch: 'ia32' }, { platform: 'linux', arch: 'x64' }, { platform: 'linux', arch: 'armhf' }, @@ -132,10 +133,6 @@ function getNodeVersion() { const nodeVersion = getNodeVersion(); BUILD_TARGETS.forEach(({ platform, arch }) => { - if (platform === 'darwin') { - arch = 'x64'; - } - gulp.task(task.define(`node-${platform}-${arch}`, () => { const nodePath = path.join('.build', 'node', `v${nodeVersion}`, `${platform}-${arch}`); @@ -150,8 +147,7 @@ BUILD_TARGETS.forEach(({ platform, arch }) => { })); }); -const arch = process.platform === 'darwin' ? 'x64' : process.arch; -const defaultNodeTask = gulp.task(`node-${process.platform}-${arch}`); +const defaultNodeTask = gulp.task(`node-${process.platform}-${process.arch}`); if (defaultNodeTask) { gulp.task(task.define('node', defaultNodeTask)); @@ -176,10 +172,6 @@ function nodejs(platform, arch) { return es.readArray([new File({ path: 'node', contents, stat: { mode: parseInt('755', 8) } })]); } - if (platform === 'darwin') { - arch = 'x64'; - } - if (arch === 'armhf') { arch = 'armv7l'; } @@ -273,7 +265,7 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa .pipe(util.stripSourceMappingURL()) .pipe(jsFilter.restore); - const nodePath = `.build/node/v${nodeVersion}/${platform}-${platform === 'darwin' ? 'x64' : arch}`; + const nodePath = `.build/node/v${nodeVersion}/${platform}-${arch}`; const node = gulp.src(`${nodePath}/**`, { base: nodePath, dot: true }); let web = []; @@ -390,7 +382,7 @@ function tweakProductForServerWeb(product) { const destinationFolderName = `vscode-${type}${dashed(platform)}${dashed(arch)}`; const serverTaskCI = task.define(`vscode-${type}${dashed(platform)}${dashed(arch)}${dashed(minified)}-ci`, task.series( - gulp.task(`node-${platform}-${platform === 'darwin' ? 'x64' : arch}`), + gulp.task(`node-${platform}-${arch}`), util.rimraf(path.join(BUILD_ROOT, destinationFolderName)), packageTask(type, platform, arch, sourceFolderName, destinationFolderName) )); diff --git a/build/lib/node.js b/build/lib/node.js index e727aff8323..588962fa5bd 100644 --- a/build/lib/node.js +++ b/build/lib/node.js @@ -11,7 +11,7 @@ const yarnrcPath = path.join(root, 'remote', '.yarnrc'); const yarnrc = fs.readFileSync(yarnrcPath, 'utf8'); const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)[1]; const platform = process.platform; -const arch = platform === 'darwin' ? 'x64' : process.arch; +const arch = process.arch; const node = platform === 'win32' ? 'node.exe' : 'node'; const nodePath = path.join(root, '.build', 'node', `v${version}`, `${platform}-${arch}`, node); console.log(nodePath); diff --git a/build/lib/node.ts b/build/lib/node.ts index 6ac45ebb1f8..d1b0039b022 100644 --- a/build/lib/node.ts +++ b/build/lib/node.ts @@ -12,7 +12,7 @@ const yarnrc = fs.readFileSync(yarnrcPath, 'utf8'); const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)![1]; const platform = process.platform; -const arch = platform === 'darwin' ? 'x64' : process.arch; +const arch = process.arch; const node = platform === 'win32' ? 'node.exe' : 'node'; const nodePath = path.join(root, '.build', 'node', `v${version}`, `${platform}-${arch}`, node); diff --git a/build/npm/postinstall.js b/build/npm/postinstall.js index 2e809b1f233..837e8638c87 100644 --- a/build/npm/postinstall.js +++ b/build/npm/postinstall.js @@ -65,11 +65,6 @@ for (let dir of dirs) { if (process.env['LDFLAGS']) { delete env['LDFLAGS']; } if (process.env['VSCODE_REMOTE_NODE_GYP']) { env['npm_config_node_gyp'] = process.env['VSCODE_REMOTE_NODE_GYP']; } - // TODO@server-darwin-arm64: Remove this check when support for arm64 for the server is added on darwin - if (/^remote/.test(dir) && process.platform === 'darwin' && (process.arch === 'arm64' || process.env['npm_config_arch'] === 'arm64')) { - // darwin arm: force `x64` on remote folder - env['npm_config_arch'] = 'x64'; - } opts = { env }; } else if (/^extensions\//.test(dir)) { opts = { ignoreEngines: true };