Skip to content

Commit 3933a69

Browse files
authored
fix: remove debian dependency on libgcc-s1 (microsoft#158883)
1 parent 0380d81 commit 3933a69

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

build/linux/debian/calculate-deps.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ function calculatePackageDeps(binaryPath, arch, sysroot) {
6565
depsStr = line.substring(shlibsDependsPrefix.length);
6666
}
6767
}
68-
const requires = new Set(depsStr.split(', ').sort());
68+
// Refs https://chromium-review.googlesource.com/c/chromium/src/+/3572926
69+
// Chromium depends on libgcc_s, is from the package libgcc1. However, in
70+
// Bullseye, the package was renamed to libgcc-s1. To avoid adding a dep
71+
// on the newer package, this hack skips the dep. This is safe because
72+
// libgcc-s1 is a dependency of libc6. This hack can be removed once
73+
// support for Debian Buster and Ubuntu Bionic are dropped.
74+
const filteredDeps = depsStr.split(', ').filter(dependency => {
75+
return !dependency.startsWith('libgcc-s1');
76+
}).sort();
77+
const requires = new Set(filteredDeps);
6978
return requires;
7079
}

build/linux/debian/calculate-deps.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ function calculatePackageDeps(binaryPath: string, arch: DebianArchString, sysroo
7070
depsStr = line.substring(shlibsDependsPrefix.length);
7171
}
7272
}
73-
const requires = new Set(depsStr.split(', ').sort());
73+
// Refs https://chromium-review.googlesource.com/c/chromium/src/+/3572926
74+
// Chromium depends on libgcc_s, is from the package libgcc1. However, in
75+
// Bullseye, the package was renamed to libgcc-s1. To avoid adding a dep
76+
// on the newer package, this hack skips the dep. This is safe because
77+
// libgcc-s1 is a dependency of libc6. This hack can be removed once
78+
// support for Debian Buster and Ubuntu Bionic are dropped.
79+
const filteredDeps = depsStr.split(', ').filter(dependency => {
80+
return !dependency.startsWith('libgcc-s1');
81+
}).sort();
82+
const requires = new Set(filteredDeps);
7483
return requires;
7584
}

build/linux/debian/dep-lists.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ exports.referenceGeneratedDepsByArch = {
3636
'libdrm2 (>= 2.4.38)',
3737
'libexpat1 (>= 2.0.1)',
3838
'libgbm1 (>= 8.1~0)',
39-
'libgcc-s1 (>= 3.0)',
4039
'libglib2.0-0 (>= 2.16.0)',
4140
'libglib2.0-0 (>= 2.39.4)',
4241
'libgtk-3-0 (>= 3.9.10)',
@@ -73,8 +72,6 @@ exports.referenceGeneratedDepsByArch = {
7372
'libdrm2 (>= 2.4.38)',
7473
'libexpat1 (>= 2.0.1)',
7574
'libgbm1 (>= 8.1~0)',
76-
'libgcc-s1 (>= 3.0)',
77-
'libgcc-s1 (>= 3.5)',
7875
'libglib2.0-0 (>= 2.16.0)',
7976
'libglib2.0-0 (>= 2.39.4)',
8077
'libgtk-3-0 (>= 3.9.10)',

build/linux/debian/dep-lists.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export const referenceGeneratedDepsByArch = {
3636
'libdrm2 (>= 2.4.38)',
3737
'libexpat1 (>= 2.0.1)',
3838
'libgbm1 (>= 8.1~0)',
39-
'libgcc-s1 (>= 3.0)',
4039
'libglib2.0-0 (>= 2.16.0)',
4140
'libglib2.0-0 (>= 2.39.4)',
4241
'libgtk-3-0 (>= 3.9.10)',
@@ -73,8 +72,6 @@ export const referenceGeneratedDepsByArch = {
7372
'libdrm2 (>= 2.4.38)',
7473
'libexpat1 (>= 2.0.1)',
7574
'libgbm1 (>= 8.1~0)',
76-
'libgcc-s1 (>= 3.0)',
77-
'libgcc-s1 (>= 3.5)',
7875
'libglib2.0-0 (>= 2.16.0)',
7976
'libglib2.0-0 (>= 2.39.4)',
8077
'libgtk-3-0 (>= 3.9.10)',

0 commit comments

Comments
 (0)