mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-29 11:46:02 +01:00
8422282f04
* chore: update electron@31.0.1
* chore: bump electron@31.1.0
* chore: update sysroot download url
* chore: bump electron@31.3.0
* chore: update rpm deps for arm64
* chore: bump electron@31.4.0
* chore: bump electron@32.0.0
* fix: compile stage
* fix: install on windows
* fix: override node-addon-api to support c++20 with gcc-11
Brings in https://github.com/nodejs/node-addon-api/commit/fed13534c595c52fdd2cbf64d7bffe83de74ef35
to support compilation with gcc>=11
* ci: use gnu++2a for gcc <=9
* ci: fix sdl pipeline
* ci: web stage
* ci: fix alpine stage
* ci: fix legacy server stage
* fix: node-addon-api resolution for remote
* ci: fix legacy arm stage
* chore: sync npm dependencies
* chore: bump electron@32.0.1
* ci: fix monaco editor checks
* ci: fix legacy server stage
* ci: possible concurrent execution
* ci: use foreground scripts on windows
* chore: bump electron@32.0.2
* fix: compilation
Refs https://github.com/electron/electron/commit/204011c3f2bfad1b6b2c9544932bf60b162be05f
* Revert "wco - hardcode devtools location on Linux (#227084)"
This reverts commit dfb96d11d3.
* chore: bump electron@32.1.2
* ci: remove workaround for missing c++20 flags
* ci: use gnu++2a for gcc <=9
* chore: bump distro
* ci: use gnu++17 for legacy arm servers
* fixup! override node-addon-api to support c++20 with gcc-11
Scope to only the affected package versions
* chore: bump @vscode/policy-watcher
* chore: bump @vscode/sqlite3
* chore: bump node.js v20.17.0
* chore: bump distro
* chore: update @vscode/windows-ca-certs
* chore: update builds for electron@32.1.2
* chore: bump distro
* chore: bump dependencies
* ci: fix arm legacy servers
109 lines
5.0 KiB
JavaScript
109 lines
5.0 KiB
JavaScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
'use strict';
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.getDependencies = getDependencies;
|
|
const child_process_1 = require("child_process");
|
|
const path = require("path");
|
|
const install_sysroot_1 = require("./debian/install-sysroot");
|
|
const calculate_deps_1 = require("./debian/calculate-deps");
|
|
const calculate_deps_2 = require("./rpm/calculate-deps");
|
|
const dep_lists_1 = require("./debian/dep-lists");
|
|
const dep_lists_2 = require("./rpm/dep-lists");
|
|
const types_1 = require("./debian/types");
|
|
const types_2 = require("./rpm/types");
|
|
const product = require("../../product.json");
|
|
// A flag that can easily be toggled.
|
|
// Make sure to compile the build directory after toggling the value.
|
|
// If false, we warn about new dependencies if they show up
|
|
// while running the prepare package tasks for a release.
|
|
// If true, we fail the build if there are new dependencies found during that task.
|
|
// The reference dependencies, which one has to update when the new dependencies
|
|
// are valid, are in dep-lists.ts
|
|
const FAIL_BUILD_FOR_NEW_DEPENDENCIES = true;
|
|
// Based on https://source.chromium.org/chromium/chromium/src/+/refs/tags/128.0.6613.162:chrome/installer/linux/BUILD.gn;l=64-80
|
|
// and the Linux Archive build
|
|
// Shared library dependencies that we already bundle.
|
|
const bundledDeps = [
|
|
'libEGL.so',
|
|
'libGLESv2.so',
|
|
'libvulkan.so.1',
|
|
'libvk_swiftshader.so',
|
|
'libffmpeg.so'
|
|
];
|
|
async function getDependencies(packageType, buildDir, applicationName, arch) {
|
|
if (packageType === 'deb') {
|
|
if (!(0, types_1.isDebianArchString)(arch)) {
|
|
throw new Error('Invalid Debian arch string ' + arch);
|
|
}
|
|
}
|
|
if (packageType === 'rpm' && !(0, types_2.isRpmArchString)(arch)) {
|
|
throw new Error('Invalid RPM arch string ' + arch);
|
|
}
|
|
// Get the files for which we want to find dependencies.
|
|
const canAsar = false; // TODO@esm ASAR disabled in ESM
|
|
const nativeModulesPath = path.join(buildDir, 'resources', 'app', canAsar ? 'node_modules.asar.unpacked' : 'node_modules');
|
|
const findResult = (0, child_process_1.spawnSync)('find', [nativeModulesPath, '-name', '*.node']);
|
|
if (findResult.status) {
|
|
console.error('Error finding files:');
|
|
console.error(findResult.stderr.toString());
|
|
return [];
|
|
}
|
|
const appPath = path.join(buildDir, applicationName);
|
|
// Add the native modules
|
|
const files = findResult.stdout.toString().trimEnd().split('\n');
|
|
// Add the tunnel binary.
|
|
files.push(path.join(buildDir, 'bin', product.tunnelApplicationName));
|
|
// Add the main executable.
|
|
files.push(appPath);
|
|
// Add chrome sandbox and crashpad handler.
|
|
files.push(path.join(buildDir, 'chrome-sandbox'));
|
|
files.push(path.join(buildDir, 'chrome_crashpad_handler'));
|
|
// Generate the dependencies.
|
|
let dependencies;
|
|
if (packageType === 'deb') {
|
|
const chromiumSysroot = await (0, install_sysroot_1.getChromiumSysroot)(arch);
|
|
const vscodeSysroot = await (0, install_sysroot_1.getVSCodeSysroot)(arch);
|
|
dependencies = (0, calculate_deps_1.generatePackageDeps)(files, arch, chromiumSysroot, vscodeSysroot);
|
|
}
|
|
else {
|
|
dependencies = (0, calculate_deps_2.generatePackageDeps)(files);
|
|
}
|
|
// Merge all the dependencies.
|
|
const mergedDependencies = mergePackageDeps(dependencies);
|
|
// Exclude bundled dependencies and sort
|
|
const sortedDependencies = Array.from(mergedDependencies).filter(dependency => {
|
|
return !bundledDeps.some(bundledDep => dependency.startsWith(bundledDep));
|
|
}).sort();
|
|
const referenceGeneratedDeps = packageType === 'deb' ?
|
|
dep_lists_1.referenceGeneratedDepsByArch[arch] :
|
|
dep_lists_2.referenceGeneratedDepsByArch[arch];
|
|
if (JSON.stringify(sortedDependencies) !== JSON.stringify(referenceGeneratedDeps)) {
|
|
const failMessage = 'The dependencies list has changed.'
|
|
+ '\nOld:\n' + referenceGeneratedDeps.join('\n')
|
|
+ '\nNew:\n' + sortedDependencies.join('\n');
|
|
if (FAIL_BUILD_FOR_NEW_DEPENDENCIES) {
|
|
throw new Error(failMessage);
|
|
}
|
|
else {
|
|
console.warn(failMessage);
|
|
}
|
|
}
|
|
return sortedDependencies;
|
|
}
|
|
// Based on https://source.chromium.org/chromium/chromium/src/+/main:chrome/installer/linux/rpm/merge_package_deps.py.
|
|
function mergePackageDeps(inputDeps) {
|
|
const requires = new Set();
|
|
for (const depSet of inputDeps) {
|
|
for (const dep of depSet) {
|
|
const trimmedDependency = dep.trim();
|
|
if (trimmedDependency.length && !trimmedDependency.startsWith('#')) {
|
|
requires.add(trimmedDependency);
|
|
}
|
|
}
|
|
}
|
|
return requires;
|
|
}
|
|
//# sourceMappingURL=dependencies-generator.js.map
|