From 56fcb7c7c8715c8496285a036aaaa71e56e9a176 Mon Sep 17 00:00:00 2001 From: Raymond Zhao Date: Tue, 19 Apr 2022 08:33:07 -0700 Subject: [PATCH] Polish RPM dependencies generator (#147336) * Print dependencies * Add reference deps for rpm package * Add flag to control new deps behaviour * Add dependencies by arch * Link arch properly --- build/gulpfile.vscode.linux.js | 2 +- build/linux/rpm/dep-lists.js | 280 +++++++++++++++++++++- build/linux/rpm/dep-lists.ts | 279 +++++++++++++++++++++ build/linux/rpm/dependencies-generator.js | 26 +- build/linux/rpm/dependencies-generator.ts | 34 ++- build/linux/rpm/types.js | 6 + build/linux/rpm/types.ts | 6 + 7 files changed, 619 insertions(+), 14 deletions(-) create mode 100644 build/linux/rpm/types.js create mode 100644 build/linux/rpm/types.ts diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js index 3c6a7b3ee8968..7d0f70f9bef69 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -176,7 +176,7 @@ function prepareRpmPackage(arch) { const code = gulp.src(binaryDir + '/**/*', { base: binaryDir }) .pipe(rename(function (p) { p.dirname = 'BUILD/usr/share/' + product.applicationName + '/' + p.dirname; })); - const dependencies = rpmDependenciesGenerator.getDependencies(binaryDir, product.applicationName); + const dependencies = rpmDependenciesGenerator.getDependencies(binaryDir, product.applicationName, rpmArch); const spec = gulp.src('resources/linux/rpm/code.spec.template', { base: '.' }) .pipe(replace('@@NAME@@', product.applicationName)) .pipe(replace('@@NAME_LONG@@', product.nameLong)) diff --git a/build/linux/rpm/dep-lists.js b/build/linux/rpm/dep-lists.js index f72b442670aea..99064a1f7e685 100644 --- a/build/linux/rpm/dep-lists.js +++ b/build/linux/rpm/dep-lists.js @@ -4,7 +4,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ Object.defineProperty(exports, "__esModule", { value: true }); -exports.bundledDeps = exports.additionalDeps = void 0; +exports.referenceGeneratedDepsByArch = exports.bundledDeps = exports.additionalDeps = void 0; // Based on https://source.chromium.org/chromium/chromium/src/+/main:chrome/installer/linux/rpm/additional_deps // Additional dependencies not in the rpm find-requires output. exports.additionalDeps = [ @@ -29,3 +29,281 @@ exports.bundledDeps = [ 'libvk_swiftshader.so', 'libffmpeg.so' ]; +exports.referenceGeneratedDepsByArch = { + 'x86_64': [ + 'ca-certificates', + 'ld-linux-x86-64.so.2()(64bit)', + 'ld-linux-x86-64.so.2(GLIBC_2.2.5)(64bit)', + 'ld-linux-x86-64.so.2(GLIBC_2.3)(64bit)', + 'libX11.so.6()(64bit)', + 'libXcomposite.so.1()(64bit)', + 'libXdamage.so.1()(64bit)', + 'libXext.so.6()(64bit)', + 'libXfixes.so.3()(64bit)', + 'libXrandr.so.2()(64bit)', + 'libasound.so.2()(64bit)', + 'libasound.so.2(ALSA_0.9)(64bit)', + 'libasound.so.2(ALSA_0.9.0rc4)(64bit)', + 'libatk-1.0.so.0()(64bit)', + 'libatk-bridge-2.0.so.0()(64bit)', + 'libatspi.so.0()(64bit)', + 'libc.so.6()(64bit)', + 'libc.so.6(GLIBC_2.10)(64bit)', + 'libc.so.6(GLIBC_2.11)(64bit)', + 'libc.so.6(GLIBC_2.14)(64bit)', + 'libc.so.6(GLIBC_2.15)(64bit)', + 'libc.so.6(GLIBC_2.16)(64bit)', + 'libc.so.6(GLIBC_2.17)(64bit)', + 'libc.so.6(GLIBC_2.2.5)(64bit)', + 'libc.so.6(GLIBC_2.3)(64bit)', + 'libc.so.6(GLIBC_2.3.2)(64bit)', + 'libc.so.6(GLIBC_2.3.3)(64bit)', + 'libc.so.6(GLIBC_2.3.4)(64bit)', + 'libc.so.6(GLIBC_2.4)(64bit)', + 'libc.so.6(GLIBC_2.6)(64bit)', + 'libc.so.6(GLIBC_2.7)(64bit)', + 'libc.so.6(GLIBC_2.8)(64bit)', + 'libc.so.6(GLIBC_2.9)(64bit)', + 'libcairo.so.2()(64bit)', + 'libcurl.so.4()(64bit)', + 'libdbus-1.so.3()(64bit)', + 'libdl.so.2()(64bit)', + 'libdl.so.2(GLIBC_2.2.5)(64bit)', + 'libdrm.so.2()(64bit)', + 'libexpat.so.1()(64bit)', + 'libgbm.so.1()(64bit)', + 'libgcc_s.so.1()(64bit)', + 'libgcc_s.so.1(GCC_3.0)(64bit)', + 'libgdk_pixbuf-2.0.so.0()(64bit)', + 'libgio-2.0.so.0()(64bit)', + 'libglib-2.0.so.0()(64bit)', + 'libgmodule-2.0.so.0()(64bit)', + 'libgobject-2.0.so.0()(64bit)', + 'libgtk-3.so.0()(64bit)', + 'libm.so.6()(64bit)', + 'libm.so.6(GLIBC_2.2.5)(64bit)', + 'libnspr4.so()(64bit)', + 'libnss3.so()(64bit)', + 'libnss3.so(NSS_3.11)(64bit)', + 'libnss3.so(NSS_3.12)(64bit)', + 'libnss3.so(NSS_3.12.1)(64bit)', + 'libnss3.so(NSS_3.2)(64bit)', + 'libnss3.so(NSS_3.22)(64bit)', + 'libnss3.so(NSS_3.3)(64bit)', + 'libnss3.so(NSS_3.4)(64bit)', + 'libnss3.so(NSS_3.5)(64bit)', + 'libnss3.so(NSS_3.9.2)(64bit)', + 'libnssutil3.so()(64bit)', + 'libnssutil3.so(NSSUTIL_3.12.3)(64bit)', + 'libpango-1.0.so.0()(64bit)', + 'libpthread.so.0()(64bit)', + 'libpthread.so.0(GLIBC_2.12)(64bit)', + 'libpthread.so.0(GLIBC_2.2.5)(64bit)', + 'libpthread.so.0(GLIBC_2.3.2)(64bit)', + 'libpthread.so.0(GLIBC_2.3.3)(64bit)', + 'libpthread.so.0(GLIBC_2.3.4)(64bit)', + 'librt.so.1()(64bit)', + 'librt.so.1(GLIBC_2.2.5)(64bit)', + 'libsecret-1.so.0()(64bit)', + 'libsmime3.so()(64bit)', + 'libsmime3.so(NSS_3.10)(64bit)', + 'libsmime3.so(NSS_3.2)(64bit)', + 'libssl3.so(NSS_3.28)(64bit)', + 'libutil.so.1()(64bit)', + 'libutil.so.1(GLIBC_2.2.5)(64bit)', + 'libxcb.so.1()(64bit)', + 'libxkbcommon.so.0()(64bit)', + 'libxkbfile.so.1()(64bit)', + 'rpmlib(FileDigests) <= 4.6.0-1', + 'rtld(GNU_HASH)', + 'xdg-utils' + ], + 'armv7hl': [ + 'ca-certificates', + 'ld-linux-armhf.so.3', + 'ld-linux-armhf.so.3(GLIBC_2.4)', + 'libX11.so.6', + 'libXcomposite.so.1', + 'libXdamage.so.1', + 'libXext.so.6', + 'libXfixes.so.3', + 'libXrandr.so.2', + 'libasound.so.2', + 'libasound.so.2(ALSA_0.9)', + 'libasound.so.2(ALSA_0.9.0rc4)', + 'libatk-1.0.so.0', + 'libatk-bridge-2.0.so.0', + 'libatspi.so.0', + 'libc.so.6', + 'libc.so.6(GLIBC_2.10)', + 'libc.so.6(GLIBC_2.11)', + 'libc.so.6(GLIBC_2.14)', + 'libc.so.6(GLIBC_2.15)', + 'libc.so.6(GLIBC_2.16)', + 'libc.so.6(GLIBC_2.17)', + 'libc.so.6(GLIBC_2.4)', + 'libc.so.6(GLIBC_2.6)', + 'libc.so.6(GLIBC_2.7)', + 'libc.so.6(GLIBC_2.8)', + 'libc.so.6(GLIBC_2.9)', + 'libcairo.so.2', + 'libcurl.so.4()(64bit)', + 'libdbus-1.so.3', + 'libdl.so.2', + 'libdl.so.2(GLIBC_2.4)', + 'libdrm.so.2', + 'libexpat.so.1', + 'libgbm.so.1', + 'libgcc_s.so.1', + 'libgcc_s.so.1(GCC_3.0)', + 'libgcc_s.so.1(GCC_3.4)', + 'libgcc_s.so.1(GCC_3.5)', + 'libgdk_pixbuf-2.0.so.0', + 'libgio-2.0.so.0', + 'libglib-2.0.so.0', + 'libgmodule-2.0.so.0', + 'libgobject-2.0.so.0', + 'libgtk-3.so.0', + 'libgtk-3.so.0()(64bit)', + 'libm.so.6', + 'libm.so.6(GLIBC_2.4)', + 'libnspr4.so', + 'libnss3.so', + 'libnss3.so(NSS_3.11)', + 'libnss3.so(NSS_3.12)', + 'libnss3.so(NSS_3.12.1)', + 'libnss3.so(NSS_3.2)', + 'libnss3.so(NSS_3.22)', + 'libnss3.so(NSS_3.22)(64bit)', + 'libnss3.so(NSS_3.3)', + 'libnss3.so(NSS_3.4)', + 'libnss3.so(NSS_3.5)', + 'libnss3.so(NSS_3.9.2)', + 'libnssutil3.so', + 'libnssutil3.so(NSSUTIL_3.12.3)', + 'libpango-1.0.so.0', + 'libpthread.so.0', + 'libpthread.so.0(GLIBC_2.12)', + 'libpthread.so.0(GLIBC_2.4)', + 'librt.so.1', + 'librt.so.1(GLIBC_2.4)', + 'libsecret-1.so.0', + 'libsmime3.so', + 'libsmime3.so(NSS_3.10)', + 'libsmime3.so(NSS_3.2)', + 'libssl3.so(NSS_3.28)(64bit)', + 'libstdc++.so.6', + 'libstdc++.so.6(CXXABI_1.3)', + 'libstdc++.so.6(CXXABI_1.3.5)', + 'libstdc++.so.6(CXXABI_1.3.8)', + 'libstdc++.so.6(CXXABI_1.3.9)', + 'libstdc++.so.6(CXXABI_ARM_1.3.3)', + 'libstdc++.so.6(GLIBCXX_3.4)', + 'libstdc++.so.6(GLIBCXX_3.4.11)', + 'libstdc++.so.6(GLIBCXX_3.4.14)', + 'libstdc++.so.6(GLIBCXX_3.4.15)', + 'libstdc++.so.6(GLIBCXX_3.4.18)', + 'libstdc++.so.6(GLIBCXX_3.4.19)', + 'libstdc++.so.6(GLIBCXX_3.4.20)', + 'libstdc++.so.6(GLIBCXX_3.4.21)', + 'libstdc++.so.6(GLIBCXX_3.4.22)', + 'libstdc++.so.6(GLIBCXX_3.4.5)', + 'libstdc++.so.6(GLIBCXX_3.4.9)', + 'libutil.so.1', + 'libutil.so.1(GLIBC_2.4)', + 'libxcb.so.1', + 'libxkbcommon.so.0', + 'libxkbfile.so.1', + 'rpmlib(FileDigests) <= 4.6.0-1', + 'rtld(GNU_HASH)', + 'xdg-utils' + ], + 'aarch64': [ + 'ca-certificates', + 'ld-linux-aarch64.so.1()(64bit)', + 'ld-linux-aarch64.so.1(GLIBC_2.17)(64bit)', + 'libX11.so.6()(64bit)', + 'libXcomposite.so.1()(64bit)', + 'libXdamage.so.1()(64bit)', + 'libXext.so.6()(64bit)', + 'libXfixes.so.3()(64bit)', + 'libXrandr.so.2()(64bit)', + 'libasound.so.2()(64bit)', + 'libasound.so.2(ALSA_0.9)(64bit)', + 'libasound.so.2(ALSA_0.9.0rc4)(64bit)', + 'libatk-1.0.so.0()(64bit)', + 'libatk-bridge-2.0.so.0()(64bit)', + 'libatspi.so.0()(64bit)', + 'libc.so.6()(64bit)', + 'libc.so.6(GLIBC_2.17)(64bit)', + 'libcairo.so.2()(64bit)', + 'libcurl.so.4()(64bit)', + 'libdbus-1.so.3()(64bit)', + 'libdbus-1.so.3(LIBDBUS_1_3)(64bit)', + 'libdl.so.2()(64bit)', + 'libdl.so.2(GLIBC_2.17)(64bit)', + 'libdrm.so.2()(64bit)', + 'libexpat.so.1()(64bit)', + 'libgbm.so.1()(64bit)', + 'libgcc_s.so.1()(64bit)', + 'libgcc_s.so.1(GCC_3.0)(64bit)', + 'libgcc_s.so.1(GCC_4.2.0)(64bit)', + 'libgcc_s.so.1(GCC_4.5.0)(64bit)', + 'libgdk_pixbuf-2.0.so.0()(64bit)', + 'libgio-2.0.so.0()(64bit)', + 'libglib-2.0.so.0()(64bit)', + 'libgmodule-2.0.so.0()(64bit)', + 'libgobject-2.0.so.0()(64bit)', + 'libgtk-3.so.0()(64bit)', + 'libm.so.6()(64bit)', + 'libm.so.6(GLIBC_2.17)(64bit)', + 'libnspr4.so()(64bit)', + 'libnss3.so()(64bit)', + 'libnss3.so(NSS_3.11)(64bit)', + 'libnss3.so(NSS_3.12)(64bit)', + 'libnss3.so(NSS_3.12.1)(64bit)', + 'libnss3.so(NSS_3.2)(64bit)', + 'libnss3.so(NSS_3.22)(64bit)', + 'libnss3.so(NSS_3.3)(64bit)', + 'libnss3.so(NSS_3.4)(64bit)', + 'libnss3.so(NSS_3.5)(64bit)', + 'libnss3.so(NSS_3.9.2)(64bit)', + 'libnssutil3.so()(64bit)', + 'libnssutil3.so(NSSUTIL_3.12.3)(64bit)', + 'libpango-1.0.so.0()(64bit)', + 'libpthread.so.0()(64bit)', + 'libpthread.so.0(GLIBC_2.17)(64bit)', + 'librt.so.1()(64bit)', + 'librt.so.1(GLIBC_2.17)(64bit)', + 'libsecret-1.so.0()(64bit)', + 'libsmime3.so()(64bit)', + 'libsmime3.so(NSS_3.10)(64bit)', + 'libsmime3.so(NSS_3.2)(64bit)', + 'libssl3.so(NSS_3.28)(64bit)', + 'libstdc++.so.6()(64bit)', + 'libstdc++.so.6(CXXABI_1.3)(64bit)', + 'libstdc++.so.6(CXXABI_1.3.5)(64bit)', + 'libstdc++.so.6(CXXABI_1.3.8)(64bit)', + 'libstdc++.so.6(CXXABI_1.3.9)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4.11)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4.14)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4.15)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4.18)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4.19)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4.20)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4.21)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4.22)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4.5)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4.9)(64bit)', + 'libutil.so.1()(64bit)', + 'libutil.so.1(GLIBC_2.17)(64bit)', + 'libxcb.so.1()(64bit)', + 'libxkbcommon.so.0()(64bit)', + 'libxkbcommon.so.0(V_0.5.0)(64bit)', + 'libxkbfile.so.1()(64bit)', + 'rpmlib(FileDigests) <= 4.6.0-1', + 'rtld(GNU_HASH)', + 'xdg-utils' + ] +}; diff --git a/build/linux/rpm/dep-lists.ts b/build/linux/rpm/dep-lists.ts index 884f6825fbd35..524cc0d7eddb1 100644 --- a/build/linux/rpm/dep-lists.ts +++ b/build/linux/rpm/dep-lists.ts @@ -28,3 +28,282 @@ export const bundledDeps = [ 'libvk_swiftshader.so', 'libffmpeg.so' ]; + +export const referenceGeneratedDepsByArch = { + 'x86_64': [ + 'ca-certificates', + 'ld-linux-x86-64.so.2()(64bit)', + 'ld-linux-x86-64.so.2(GLIBC_2.2.5)(64bit)', + 'ld-linux-x86-64.so.2(GLIBC_2.3)(64bit)', + 'libX11.so.6()(64bit)', + 'libXcomposite.so.1()(64bit)', + 'libXdamage.so.1()(64bit)', + 'libXext.so.6()(64bit)', + 'libXfixes.so.3()(64bit)', + 'libXrandr.so.2()(64bit)', + 'libasound.so.2()(64bit)', + 'libasound.so.2(ALSA_0.9)(64bit)', + 'libasound.so.2(ALSA_0.9.0rc4)(64bit)', + 'libatk-1.0.so.0()(64bit)', + 'libatk-bridge-2.0.so.0()(64bit)', + 'libatspi.so.0()(64bit)', + 'libc.so.6()(64bit)', + 'libc.so.6(GLIBC_2.10)(64bit)', + 'libc.so.6(GLIBC_2.11)(64bit)', + 'libc.so.6(GLIBC_2.14)(64bit)', + 'libc.so.6(GLIBC_2.15)(64bit)', + 'libc.so.6(GLIBC_2.16)(64bit)', + 'libc.so.6(GLIBC_2.17)(64bit)', + 'libc.so.6(GLIBC_2.2.5)(64bit)', + 'libc.so.6(GLIBC_2.3)(64bit)', + 'libc.so.6(GLIBC_2.3.2)(64bit)', + 'libc.so.6(GLIBC_2.3.3)(64bit)', + 'libc.so.6(GLIBC_2.3.4)(64bit)', + 'libc.so.6(GLIBC_2.4)(64bit)', + 'libc.so.6(GLIBC_2.6)(64bit)', + 'libc.so.6(GLIBC_2.7)(64bit)', + 'libc.so.6(GLIBC_2.8)(64bit)', + 'libc.so.6(GLIBC_2.9)(64bit)', + 'libcairo.so.2()(64bit)', + 'libcurl.so.4()(64bit)', + 'libdbus-1.so.3()(64bit)', + 'libdl.so.2()(64bit)', + 'libdl.so.2(GLIBC_2.2.5)(64bit)', + 'libdrm.so.2()(64bit)', + 'libexpat.so.1()(64bit)', + 'libgbm.so.1()(64bit)', + 'libgcc_s.so.1()(64bit)', + 'libgcc_s.so.1(GCC_3.0)(64bit)', + 'libgdk_pixbuf-2.0.so.0()(64bit)', + 'libgio-2.0.so.0()(64bit)', + 'libglib-2.0.so.0()(64bit)', + 'libgmodule-2.0.so.0()(64bit)', + 'libgobject-2.0.so.0()(64bit)', + 'libgtk-3.so.0()(64bit)', + 'libm.so.6()(64bit)', + 'libm.so.6(GLIBC_2.2.5)(64bit)', + 'libnspr4.so()(64bit)', + 'libnss3.so()(64bit)', + 'libnss3.so(NSS_3.11)(64bit)', + 'libnss3.so(NSS_3.12)(64bit)', + 'libnss3.so(NSS_3.12.1)(64bit)', + 'libnss3.so(NSS_3.2)(64bit)', + 'libnss3.so(NSS_3.22)(64bit)', + 'libnss3.so(NSS_3.3)(64bit)', + 'libnss3.so(NSS_3.4)(64bit)', + 'libnss3.so(NSS_3.5)(64bit)', + 'libnss3.so(NSS_3.9.2)(64bit)', + 'libnssutil3.so()(64bit)', + 'libnssutil3.so(NSSUTIL_3.12.3)(64bit)', + 'libpango-1.0.so.0()(64bit)', + 'libpthread.so.0()(64bit)', + 'libpthread.so.0(GLIBC_2.12)(64bit)', + 'libpthread.so.0(GLIBC_2.2.5)(64bit)', + 'libpthread.so.0(GLIBC_2.3.2)(64bit)', + 'libpthread.so.0(GLIBC_2.3.3)(64bit)', + 'libpthread.so.0(GLIBC_2.3.4)(64bit)', + 'librt.so.1()(64bit)', + 'librt.so.1(GLIBC_2.2.5)(64bit)', + 'libsecret-1.so.0()(64bit)', + 'libsmime3.so()(64bit)', + 'libsmime3.so(NSS_3.10)(64bit)', + 'libsmime3.so(NSS_3.2)(64bit)', + 'libssl3.so(NSS_3.28)(64bit)', + 'libutil.so.1()(64bit)', + 'libutil.so.1(GLIBC_2.2.5)(64bit)', + 'libxcb.so.1()(64bit)', + 'libxkbcommon.so.0()(64bit)', + 'libxkbfile.so.1()(64bit)', + 'rpmlib(FileDigests) <= 4.6.0-1', + 'rtld(GNU_HASH)', + 'xdg-utils' + ], + 'armv7hl': [ + 'ca-certificates', + 'ld-linux-armhf.so.3', + 'ld-linux-armhf.so.3(GLIBC_2.4)', + 'libX11.so.6', + 'libXcomposite.so.1', + 'libXdamage.so.1', + 'libXext.so.6', + 'libXfixes.so.3', + 'libXrandr.so.2', + 'libasound.so.2', + 'libasound.so.2(ALSA_0.9)', + 'libasound.so.2(ALSA_0.9.0rc4)', + 'libatk-1.0.so.0', + 'libatk-bridge-2.0.so.0', + 'libatspi.so.0', + 'libc.so.6', + 'libc.so.6(GLIBC_2.10)', + 'libc.so.6(GLIBC_2.11)', + 'libc.so.6(GLIBC_2.14)', + 'libc.so.6(GLIBC_2.15)', + 'libc.so.6(GLIBC_2.16)', + 'libc.so.6(GLIBC_2.17)', + 'libc.so.6(GLIBC_2.4)', + 'libc.so.6(GLIBC_2.6)', + 'libc.so.6(GLIBC_2.7)', + 'libc.so.6(GLIBC_2.8)', + 'libc.so.6(GLIBC_2.9)', + 'libcairo.so.2', + 'libcurl.so.4()(64bit)', + 'libdbus-1.so.3', + 'libdl.so.2', + 'libdl.so.2(GLIBC_2.4)', + 'libdrm.so.2', + 'libexpat.so.1', + 'libgbm.so.1', + 'libgcc_s.so.1', + 'libgcc_s.so.1(GCC_3.0)', + 'libgcc_s.so.1(GCC_3.4)', + 'libgcc_s.so.1(GCC_3.5)', + 'libgdk_pixbuf-2.0.so.0', + 'libgio-2.0.so.0', + 'libglib-2.0.so.0', + 'libgmodule-2.0.so.0', + 'libgobject-2.0.so.0', + 'libgtk-3.so.0', + 'libgtk-3.so.0()(64bit)', + 'libm.so.6', + 'libm.so.6(GLIBC_2.4)', + 'libnspr4.so', + 'libnss3.so', + 'libnss3.so(NSS_3.11)', + 'libnss3.so(NSS_3.12)', + 'libnss3.so(NSS_3.12.1)', + 'libnss3.so(NSS_3.2)', + 'libnss3.so(NSS_3.22)', + 'libnss3.so(NSS_3.22)(64bit)', + 'libnss3.so(NSS_3.3)', + 'libnss3.so(NSS_3.4)', + 'libnss3.so(NSS_3.5)', + 'libnss3.so(NSS_3.9.2)', + 'libnssutil3.so', + 'libnssutil3.so(NSSUTIL_3.12.3)', + 'libpango-1.0.so.0', + 'libpthread.so.0', + 'libpthread.so.0(GLIBC_2.12)', + 'libpthread.so.0(GLIBC_2.4)', + 'librt.so.1', + 'librt.so.1(GLIBC_2.4)', + 'libsecret-1.so.0', + 'libsmime3.so', + 'libsmime3.so(NSS_3.10)', + 'libsmime3.so(NSS_3.2)', + 'libssl3.so(NSS_3.28)(64bit)', + 'libstdc++.so.6', + 'libstdc++.so.6(CXXABI_1.3)', + 'libstdc++.so.6(CXXABI_1.3.5)', + 'libstdc++.so.6(CXXABI_1.3.8)', + 'libstdc++.so.6(CXXABI_1.3.9)', + 'libstdc++.so.6(CXXABI_ARM_1.3.3)', + 'libstdc++.so.6(GLIBCXX_3.4)', + 'libstdc++.so.6(GLIBCXX_3.4.11)', + 'libstdc++.so.6(GLIBCXX_3.4.14)', + 'libstdc++.so.6(GLIBCXX_3.4.15)', + 'libstdc++.so.6(GLIBCXX_3.4.18)', + 'libstdc++.so.6(GLIBCXX_3.4.19)', + 'libstdc++.so.6(GLIBCXX_3.4.20)', + 'libstdc++.so.6(GLIBCXX_3.4.21)', + 'libstdc++.so.6(GLIBCXX_3.4.22)', + 'libstdc++.so.6(GLIBCXX_3.4.5)', + 'libstdc++.so.6(GLIBCXX_3.4.9)', + 'libutil.so.1', + 'libutil.so.1(GLIBC_2.4)', + 'libxcb.so.1', + 'libxkbcommon.so.0', + 'libxkbfile.so.1', + 'rpmlib(FileDigests) <= 4.6.0-1', + 'rtld(GNU_HASH)', + 'xdg-utils' + ], + 'aarch64': [ + 'ca-certificates', + 'ld-linux-aarch64.so.1()(64bit)', + 'ld-linux-aarch64.so.1(GLIBC_2.17)(64bit)', + 'libX11.so.6()(64bit)', + 'libXcomposite.so.1()(64bit)', + 'libXdamage.so.1()(64bit)', + 'libXext.so.6()(64bit)', + 'libXfixes.so.3()(64bit)', + 'libXrandr.so.2()(64bit)', + 'libasound.so.2()(64bit)', + 'libasound.so.2(ALSA_0.9)(64bit)', + 'libasound.so.2(ALSA_0.9.0rc4)(64bit)', + 'libatk-1.0.so.0()(64bit)', + 'libatk-bridge-2.0.so.0()(64bit)', + 'libatspi.so.0()(64bit)', + 'libc.so.6()(64bit)', + 'libc.so.6(GLIBC_2.17)(64bit)', + 'libcairo.so.2()(64bit)', + 'libcurl.so.4()(64bit)', + 'libdbus-1.so.3()(64bit)', + 'libdbus-1.so.3(LIBDBUS_1_3)(64bit)', + 'libdl.so.2()(64bit)', + 'libdl.so.2(GLIBC_2.17)(64bit)', + 'libdrm.so.2()(64bit)', + 'libexpat.so.1()(64bit)', + 'libgbm.so.1()(64bit)', + 'libgcc_s.so.1()(64bit)', + 'libgcc_s.so.1(GCC_3.0)(64bit)', + 'libgcc_s.so.1(GCC_4.2.0)(64bit)', + 'libgcc_s.so.1(GCC_4.5.0)(64bit)', + 'libgdk_pixbuf-2.0.so.0()(64bit)', + 'libgio-2.0.so.0()(64bit)', + 'libglib-2.0.so.0()(64bit)', + 'libgmodule-2.0.so.0()(64bit)', + 'libgobject-2.0.so.0()(64bit)', + 'libgtk-3.so.0()(64bit)', + 'libm.so.6()(64bit)', + 'libm.so.6(GLIBC_2.17)(64bit)', + 'libnspr4.so()(64bit)', + 'libnss3.so()(64bit)', + 'libnss3.so(NSS_3.11)(64bit)', + 'libnss3.so(NSS_3.12)(64bit)', + 'libnss3.so(NSS_3.12.1)(64bit)', + 'libnss3.so(NSS_3.2)(64bit)', + 'libnss3.so(NSS_3.22)(64bit)', + 'libnss3.so(NSS_3.3)(64bit)', + 'libnss3.so(NSS_3.4)(64bit)', + 'libnss3.so(NSS_3.5)(64bit)', + 'libnss3.so(NSS_3.9.2)(64bit)', + 'libnssutil3.so()(64bit)', + 'libnssutil3.so(NSSUTIL_3.12.3)(64bit)', + 'libpango-1.0.so.0()(64bit)', + 'libpthread.so.0()(64bit)', + 'libpthread.so.0(GLIBC_2.17)(64bit)', + 'librt.so.1()(64bit)', + 'librt.so.1(GLIBC_2.17)(64bit)', + 'libsecret-1.so.0()(64bit)', + 'libsmime3.so()(64bit)', + 'libsmime3.so(NSS_3.10)(64bit)', + 'libsmime3.so(NSS_3.2)(64bit)', + 'libssl3.so(NSS_3.28)(64bit)', + 'libstdc++.so.6()(64bit)', + 'libstdc++.so.6(CXXABI_1.3)(64bit)', + 'libstdc++.so.6(CXXABI_1.3.5)(64bit)', + 'libstdc++.so.6(CXXABI_1.3.8)(64bit)', + 'libstdc++.so.6(CXXABI_1.3.9)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4.11)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4.14)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4.15)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4.18)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4.19)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4.20)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4.21)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4.22)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4.5)(64bit)', + 'libstdc++.so.6(GLIBCXX_3.4.9)(64bit)', + 'libutil.so.1()(64bit)', + 'libutil.so.1(GLIBC_2.17)(64bit)', + 'libxcb.so.1()(64bit)', + 'libxkbcommon.so.0()(64bit)', + 'libxkbcommon.so.0(V_0.5.0)(64bit)', + 'libxkbfile.so.1()(64bit)', + 'rpmlib(FileDigests) <= 4.6.0-1', + 'rtld(GNU_HASH)', + 'xdg-utils' + ] +}; diff --git a/build/linux/rpm/dependencies-generator.js b/build/linux/rpm/dependencies-generator.js index ddeefe3c28d01..1d91eb8de78c9 100644 --- a/build/linux/rpm/dependencies-generator.js +++ b/build/linux/rpm/dependencies-generator.js @@ -9,7 +9,15 @@ const child_process_1 = require("child_process"); const fs_1 = require("fs"); const path = require("path"); const dep_lists_1 = require("./dep-lists"); -function getDependencies(buildDir, applicationName) { +// 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 rpm prepare package task 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; +function getDependencies(buildDir, applicationName, arch) { // Get the files for which we want to find dependencies. const nativeModulesPath = path.join(buildDir, 'resources', 'app', 'node_modules.asar.unpacked'); const findResult = (0, child_process_1.spawnSync)('find', [nativeModulesPath, '-name', '*.node']); @@ -40,9 +48,22 @@ function getDependencies(buildDir, applicationName) { sortedDependencies = sortedDependencies.filter(dependency => { return !dep_lists_1.bundledDeps.some(bundledDep => dependency.startsWith(bundledDep)); }); + const referenceGeneratedDeps = dep_lists_1.referenceGeneratedDepsByArch[arch]; + if (JSON.stringify(sortedDependencies) !== JSON.stringify(referenceGeneratedDeps)) { + const failMessage = 'The dependencies list has changed. ' + + 'Printing newer dependencies list that one can use to compare against referenceGeneratedDeps:\n' + + sortedDependencies.join('\n'); + if (FAIL_BUILD_FOR_NEW_DEPENDENCIES) { + throw new Error(failMessage); + } + else { + console.warn(failMessage); + } + } return sortedDependencies; } exports.getDependencies = getDependencies; +// Based on https://source.chromium.org/chromium/chromium/src/+/main:chrome/installer/linux/rpm/calculate_package_deps.py. function calculatePackageDeps(binaryPath) { try { if (!((0, fs_1.statSync)(binaryPath).mode & fs_1.constants.S_IXUSR)) { @@ -58,9 +79,6 @@ function calculatePackageDeps(binaryPath) { throw new Error(`find-requires failed with exit code ${findRequiresResult.status}.\nstderr: ${findRequiresResult.stderr}`); } const requires = new Set(findRequiresResult.stdout.toString('utf-8').trimEnd().split('\n')); - // we only need to use provides to check for newer dependencies - // const provides = readFileSync('dist_package_provides.json'); - // const jsonProvides = JSON.parse(provides.toString('utf-8')); return requires; } // Based on https://source.chromium.org/chromium/chromium/src/+/main:chrome/installer/linux/rpm/merge_package_deps.py diff --git a/build/linux/rpm/dependencies-generator.ts b/build/linux/rpm/dependencies-generator.ts index 97d313fe570b8..95953ecaa24ed 100644 --- a/build/linux/rpm/dependencies-generator.ts +++ b/build/linux/rpm/dependencies-generator.ts @@ -8,9 +8,19 @@ import { spawnSync } from 'child_process'; import { constants, statSync } from 'fs'; import path = require('path'); -import { additionalDeps, bundledDeps } from './dep-lists'; - -export function getDependencies(buildDir: string, applicationName: string): string[] { +import { additionalDeps, bundledDeps, referenceGeneratedDepsByArch } from './dep-lists'; +import { ArchString } from './types'; + +// 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 rpm prepare package task 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: boolean = true; + +export function getDependencies(buildDir: string, applicationName: string, arch: ArchString): string[] { // Get the files for which we want to find dependencies. const nativeModulesPath = path.join(buildDir, 'resources', 'app', 'node_modules.asar.unpacked'); const findResult = spawnSync('find', [nativeModulesPath, '-name', '*.node']); @@ -49,9 +59,22 @@ export function getDependencies(buildDir: string, applicationName: string): stri return !bundledDeps.some(bundledDep => dependency.startsWith(bundledDep)); }); + const referenceGeneratedDeps = referenceGeneratedDepsByArch[arch]; + if (JSON.stringify(sortedDependencies) !== JSON.stringify(referenceGeneratedDeps)) { + const failMessage = 'The dependencies list has changed. ' + + 'Printing newer dependencies list that one can use to compare against referenceGeneratedDeps:\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/calculate_package_deps.py. function calculatePackageDeps(binaryPath: string): Set { try { if (!(statSync(binaryPath).mode & constants.S_IXUSR)) { @@ -68,11 +91,6 @@ function calculatePackageDeps(binaryPath: string): Set { } const requires = new Set(findRequiresResult.stdout.toString('utf-8').trimEnd().split('\n')); - - // we only need to use provides to check for newer dependencies - // const provides = readFileSync('dist_package_provides.json'); - // const jsonProvides = JSON.parse(provides.toString('utf-8')); - return requires; } diff --git a/build/linux/rpm/types.js b/build/linux/rpm/types.js new file mode 100644 index 0000000000000..56d4e6c56ce15 --- /dev/null +++ b/build/linux/rpm/types.js @@ -0,0 +1,6 @@ +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/build/linux/rpm/types.ts b/build/linux/rpm/types.ts new file mode 100644 index 0000000000000..84330949d1df0 --- /dev/null +++ b/build/linux/rpm/types.ts @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +export type ArchString = 'x86_64' | 'armv7hl' | 'aarch64';