Skip to content

Commit

Permalink
Link arch properly
Browse files Browse the repository at this point in the history
  • Loading branch information
rzhao271 committed Apr 14, 2022
1 parent e90f85b commit 056d678
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build/gulpfile.vscode.linux.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
6 changes: 3 additions & 3 deletions build/linux/rpm/dep-lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ exports.bundledDeps = [
'libffmpeg.so'
];
exports.referenceGeneratedDepsByArch = {
'amd64': [
'x86_64': [
'ca-certificates',
'ld-linux-x86-64.so.2()(64bit)',
'ld-linux-x86-64.so.2(GLIBC_2.2.5)(64bit)',
Expand Down Expand Up @@ -118,7 +118,7 @@ exports.referenceGeneratedDepsByArch = {
'rtld(GNU_HASH)',
'xdg-utils'
],
'armhf': [
'armv7hl': [
'ca-certificates',
'ld-linux-armhf.so.3',
'ld-linux-armhf.so.3(GLIBC_2.4)',
Expand Down Expand Up @@ -218,7 +218,7 @@ exports.referenceGeneratedDepsByArch = {
'rtld(GNU_HASH)',
'xdg-utils'
],
'arm64': [
'aarch64': [
'ca-certificates',
'ld-linux-aarch64.so.1()(64bit)',
'ld-linux-aarch64.so.1(GLIBC_2.17)(64bit)',
Expand Down
6 changes: 3 additions & 3 deletions build/linux/rpm/dep-lists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const bundledDeps = [
];

export const referenceGeneratedDepsByArch = {
'amd64': [
'x86_64': [
'ca-certificates',
'ld-linux-x86-64.so.2()(64bit)',
'ld-linux-x86-64.so.2(GLIBC_2.2.5)(64bit)',
Expand Down Expand Up @@ -118,7 +118,7 @@ export const referenceGeneratedDepsByArch = {
'rtld(GNU_HASH)',
'xdg-utils'
],
'armhf': [
'armv7hl': [
'ca-certificates',
'ld-linux-armhf.so.3',
'ld-linux-armhf.so.3(GLIBC_2.4)',
Expand Down Expand Up @@ -218,7 +218,7 @@ export const referenceGeneratedDepsByArch = {
'rtld(GNU_HASH)',
'xdg-utils'
],
'arm64': [
'aarch64': [
'ca-certificates',
'ld-linux-aarch64.so.1()(64bit)',
'ld-linux-aarch64.so.1(GLIBC_2.17)(64bit)',
Expand Down
5 changes: 1 addition & 4 deletions build/linux/rpm/dependencies-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function getDependencies(buildDir, applicationName, arch) {
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:'
+ '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);
Expand Down Expand Up @@ -79,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
Expand Down
7 changes: 1 addition & 6 deletions build/linux/rpm/dependencies-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function getDependencies(buildDir: string, applicationName: string, arch:
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:'
+ '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);
Expand Down Expand Up @@ -91,11 +91,6 @@ function calculatePackageDeps(binaryPath: string): Set<string> {
}

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;
}

Expand Down
2 changes: 1 addition & 1 deletion build/linux/rpm/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

export type ArchString = 'amd64' | 'armhf' | 'arm64';
export type ArchString = 'x86_64' | 'armv7hl' | 'aarch64';

0 comments on commit 056d678

Please sign in to comment.