From f176bee18192d6ea76479337e35d95c2ccbca9f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Mon, 8 Jul 2019 17:22:32 +0200 Subject: [PATCH] Cleanup distro dependencies installation (#76893) * depend directly on vsda * add vsda to remote * remove vsda cleanup rules * update distro * upgrade vsda * update distro * update vsda * remove vsda * add vsda rules * distro * distro --- build/.nativeignore | 10 ++--- .../common/installDistroDependencies.ts | 38 ------------------- .../darwin/product-build-darwin.yml | 12 +----- .../linux/product-build-linux-multiarch.yml | 6 +-- .../linux/product-build-linux.yml | 12 +----- build/azure-pipelines/product-compile.yml | 13 +------ .../win32/product-build-win32.yml | 15 ++------ build/gulpfile.mixin.js | 1 - build/gulpfile.vscode.js | 13 ------- package.json | 2 +- 10 files changed, 17 insertions(+), 105 deletions(-) delete mode 100644 build/azure-pipelines/common/installDistroDependencies.ts diff --git a/build/.nativeignore b/build/.nativeignore index e3dca97ca41..a4823bf719c 100644 --- a/build/.nativeignore +++ b/build/.nativeignore @@ -91,13 +91,13 @@ nsfw/includes/** !nsfw/build/Release/*.node !nsfw/**/*.a +vsda/build/** +vsda/ci/** +vsda/src/** +vsda/.gitignore vsda/binding.gyp vsda/README.md -vsda/build/** -vsda/*.bat -vsda/*.sh -vsda/*.cpp -vsda/*.h +vsda/targets !vsda/build/Release/vsda.node vscode-windows-ca-certs/**/* diff --git a/build/azure-pipelines/common/installDistroDependencies.ts b/build/azure-pipelines/common/installDistroDependencies.ts deleted file mode 100644 index a0dd3a295db..00000000000 --- a/build/azure-pipelines/common/installDistroDependencies.ts +++ /dev/null @@ -1,38 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as cp from 'child_process'; -import * as path from 'path'; -import * as fs from 'fs'; - -function yarnInstall(packageName: string, cwd: string): void { - console.log(`yarn add --no-lockfile ${packageName}`, cwd); - cp.execSync(`yarn add --no-lockfile ${packageName}`, { cwd, stdio: 'inherit' }); -} - -/** - * Install additional dependencies listed on each quality `package.json` file. - */ -function main() { - const quality = process.env['VSCODE_QUALITY']; - - if (!quality) { - throw new Error('Missing VSCODE_QUALITY, can\'t install distro'); - } - - const rootPath = path.dirname(path.dirname(path.dirname(__dirname))); - const qualityPath = path.join(rootPath, 'quality', quality); - const packagePath = path.join(qualityPath, 'package.json'); - const pkg = JSON.parse(fs.readFileSync(packagePath, 'utf8')); - const dependencies = pkg.dependencies || {} as { [name: string]: string; }; - - Object.keys(dependencies).forEach(name => { - const url = dependencies[name]; - const cwd = process.argv.length < 3 ? process.cwd() : path.join(process.cwd(), process.argv[2]); - yarnInstall(url, cwd); - }); -} - -main(); \ No newline at end of file diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index f82b4acf503..cdf7eb2f1df 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -36,8 +36,6 @@ steps: set -e cat << EOF > ~/.netrc - machine monacotools.visualstudio.com - password $(devops-pat) machine github.com login vscode password $(github-distro-mixin-password) @@ -56,7 +54,7 @@ steps: - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 inputs: - keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, quality/*/package.json, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' + keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' targetfolder: '**/node_modules, !**/node_modules/**/node_modules' vstsFeed: 'npm-vscode' @@ -68,7 +66,7 @@ steps: - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1 inputs: - keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, quality/*/package.json, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' + keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' targetfolder: '**/node_modules, !**/node_modules/**/node_modules' vstsFeed: 'npm-vscode' condition: and(succeeded(), ne(variables['CacheRestored'], 'true')) @@ -79,12 +77,6 @@ steps: displayName: Run postinstall scripts condition: and(succeeded(), eq(variables['CacheRestored'], 'true')) -- script: | - set -e - CHILD_CONCURRENCY=1 node build/azure-pipelines/common/installDistroDependencies.js - CHILD_CONCURRENCY=1 node build/azure-pipelines/common/installDistroDependencies.js remote - displayName: Install distro dependencies - - script: | set -e yarn gulp mixin diff --git a/build/azure-pipelines/linux/product-build-linux-multiarch.yml b/build/azure-pipelines/linux/product-build-linux-multiarch.yml index 11af31f7bd3..66b6bbff713 100644 --- a/build/azure-pipelines/linux/product-build-linux-multiarch.yml +++ b/build/azure-pipelines/linux/product-build-linux-multiarch.yml @@ -45,8 +45,6 @@ steps: set -e cat << EOF > ~/.netrc - machine monacotools.visualstudio.com - password $(devops-pat) machine github.com login vscode password $(github-distro-mixin-password) @@ -65,7 +63,7 @@ steps: - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 inputs: - keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, quality/*/package.json, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' + keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' targetfolder: '**/node_modules, !**/node_modules/**/node_modules' vstsFeed: 'npm-vscode' @@ -77,7 +75,7 @@ steps: - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1 inputs: - keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, quality/*/package.json, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' + keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' targetfolder: '**/node_modules, !**/node_modules/**/node_modules' vstsFeed: 'npm-vscode' condition: and(succeeded(), ne(variables['CacheRestored'], 'true')) diff --git a/build/azure-pipelines/linux/product-build-linux.yml b/build/azure-pipelines/linux/product-build-linux.yml index 99b58772c9c..1e48713cd86 100644 --- a/build/azure-pipelines/linux/product-build-linux.yml +++ b/build/azure-pipelines/linux/product-build-linux.yml @@ -37,8 +37,6 @@ steps: export npm_config_arch="$(VSCODE_ARCH)" cat << EOF > ~/.netrc - machine monacotools.visualstudio.com - password $(devops-pat) machine github.com login vscode password $(github-distro-mixin-password) @@ -57,7 +55,7 @@ steps: - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 inputs: - keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, quality/*/package.json, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' + keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' targetfolder: '**/node_modules, !**/node_modules/**/node_modules' vstsFeed: 'npm-vscode' @@ -69,7 +67,7 @@ steps: - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1 inputs: - keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, quality/*/package.json, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' + keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' targetfolder: '**/node_modules, !**/node_modules/**/node_modules' vstsFeed: 'npm-vscode' condition: and(succeeded(), ne(variables['CacheRestored'], 'true')) @@ -80,12 +78,6 @@ steps: displayName: Run postinstall scripts condition: and(succeeded(), eq(variables['CacheRestored'], 'true')) -- script: | - set -e - CHILD_CONCURRENCY=1 node build/azure-pipelines/common/installDistroDependencies.js - CHILD_CONCURRENCY=1 node build/azure-pipelines/common/installDistroDependencies.js remote - displayName: Install distro dependencies - - script: | set -e yarn gulp mixin diff --git a/build/azure-pipelines/product-compile.yml b/build/azure-pipelines/product-compile.yml index f1b4e4eba6c..cc2639f139c 100644 --- a/build/azure-pipelines/product-compile.yml +++ b/build/azure-pipelines/product-compile.yml @@ -34,8 +34,6 @@ steps: export npm_config_arch="$(VSCODE_ARCH)" cat << EOF > ~/.netrc - machine monacotools.visualstudio.com - password $(devops-pat) machine github.com login vscode password $(github-distro-mixin-password) @@ -56,7 +54,7 @@ steps: - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 inputs: - keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, quality/*/package.json, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' + keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' targetfolder: '**/node_modules, !**/node_modules/**/node_modules' vstsFeed: 'npm-vscode' condition: and(succeeded(), ne(variables['CacheRestored-Compilation'], 'true')) @@ -69,7 +67,7 @@ steps: - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1 inputs: - keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, quality/*/package.json, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' + keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' targetfolder: '**/node_modules, !**/node_modules/**/node_modules' vstsFeed: 'npm-vscode' condition: and(succeeded(), ne(variables['CacheRestored-Compilation'], 'true'), ne(variables['CacheRestored'], 'true')) @@ -80,13 +78,6 @@ steps: displayName: Run postinstall scripts condition: and(succeeded(), ne(variables['CacheRestored-Compilation'], 'true'), eq(variables['CacheRestored'], 'true')) -- script: | - set -e - CHILD_CONCURRENCY=1 node build/azure-pipelines/common/installDistroDependencies.js - CHILD_CONCURRENCY=1 node build/azure-pipelines/common/installDistroDependencies.js remote - displayName: Install distro dependencies - condition: and(succeeded(), ne(variables['CacheRestored-Compilation'], 'true')) - # Mixin must run before optimize, because the CSS loader will # inline small SVGs - script: | diff --git a/build/azure-pipelines/win32/product-build-win32.yml b/build/azure-pipelines/win32/product-build-win32.yml index 02922016fe3..66d8bf4af32 100644 --- a/build/azure-pipelines/win32/product-build-win32.yml +++ b/build/azure-pipelines/win32/product-build-win32.yml @@ -40,7 +40,7 @@ steps: - powershell: | . build/azure-pipelines/win32/exec.ps1 $ErrorActionPreference = "Stop" - "machine monacotools.visualstudio.com`npassword $(devops-pat)`nmachine github.com`nlogin vscode`npassword $(github-distro-mixin-password)" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII + "machine github.com`nlogin vscode`npassword $(github-distro-mixin-password)" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII exec { git config user.email "vscode@microsoft.com" } exec { git config user.name "VSCode" } @@ -59,7 +59,7 @@ steps: - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 inputs: - keyfile: 'build/.cachesalt, .build/arch, .yarnrc, remote/.yarnrc, quality/*/package.json, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' + keyfile: 'build/.cachesalt, .build/arch, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' targetfolder: '**/node_modules, !**/node_modules/**/node_modules' vstsFeed: 'npm-vscode' @@ -74,7 +74,7 @@ steps: - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1 inputs: - keyfile: 'build/.cachesalt, .build/arch, .yarnrc, remote/.yarnrc, quality/*/package.json, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' + keyfile: 'build/.cachesalt, .build/arch, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock' targetfolder: '**/node_modules, !**/node_modules/**/node_modules' vstsFeed: 'npm-vscode' condition: and(succeeded(), ne(variables['CacheRestored'], 'true')) @@ -86,15 +86,6 @@ steps: displayName: Run postinstall scripts condition: and(succeeded(), eq(variables['CacheRestored'], 'true')) -- powershell: | - . build/azure-pipelines/win32/exec.ps1 - $ErrorActionPreference = "Stop" - $env:npm_config_arch="$(VSCODE_ARCH)" - $env:CHILD_CONCURRENCY="1" - exec { node build/azure-pipelines/common/installDistroDependencies.js } - exec { node build/azure-pipelines/common/installDistroDependencies.js remote } - displayName: Install distro dependencies - - powershell: | . build/azure-pipelines/win32/exec.ps1 $ErrorActionPreference = "Stop" diff --git a/build/gulpfile.mixin.js b/build/gulpfile.mixin.js index 0f9b1d990f3..a2b61d33ad3 100644 --- a/build/gulpfile.mixin.js +++ b/build/gulpfile.mixin.js @@ -28,7 +28,6 @@ gulp.task('mixin', function () { return vfs .src(`quality/${quality}/**`, { base: `quality/${quality}` }) .pipe(filter(f => !f.isDirectory())) - .pipe(filter(['**', '!**/package.json'])) .pipe(productJsonFilter) .pipe(buffer()) .pipe(json(o => Object.assign({}, require('../product.json'), o))) diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index 2475b3b6c45..2d73433dfd6 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -311,19 +311,6 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op const dependenciesSrc = _.flatten(productionDependencies.map(d => path.relative(root, d.path)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`])); - // Collect distro dependencies, if any - if (quality) { - const qualityPackagePath = path.join(root, 'quality', quality, 'package.json'); - - if (fs.existsSync(qualityPackagePath)) { - const pkg = JSON.parse(fs.readFileSync(qualityPackagePath, 'utf8')); - - // @ts-ignore JSON checking: dependencies is optional - const distroDependencies = _.flatten(Object.keys(pkg.dependencies || {}).map(d => [`node_modules/${d}/**`, `!node_modules/${d}/**/{test,tests}/**`])); - dependenciesSrc.push(...distroDependencies); - } - } - const deps = gulp.src(dependenciesSrc, { base: '.', dot: true }) .pipe(filter(['**', '!**/package-lock.json'])) .pipe(util.cleanNodeModules(path.join(__dirname, '.nativeignore'))) diff --git a/package.json b/package.json index 23d3a5504bf..e509252782f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.37.0", - "distro": "2069209483770ea54d4a020efa830fdc2d574025", + "distro": "382ae0863e9d7c4b14a176686e2065cf7f7f5a18", "author": { "name": "Microsoft Corporation" }, -- GitLab