Skip to content

Commit 5438814

Browse files
authored
chore: do not fall back to previous LTS release deps for new Ubuntu LTS (#34360)
1 parent 587e778 commit 5438814

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

packages/playwright-core/src/server/registry/dependencies.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export async function installDependenciesLinux(targets: Set<DependencyGroup>, dr
9595
for (const target of targets) {
9696
const info = deps[platform];
9797
if (!info) {
98-
console.warn(`Cannot install dependencies for ${platform}!`); // eslint-disable-line no-console
98+
console.warn(`Cannot install dependencies for ${platform} with Playwright ${getPlaywrightVersion()}!`); // eslint-disable-line no-console
9999
return;
100100
}
101101
libraries.push(...info[target]);

packages/playwright-core/src/utils/hostPlatform.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,18 @@ function calculatePlatform(): { hostPlatform: HostPlatform, isOfficiallySupporte
7474
// KDE Neon is ubuntu-based and has the same versions.
7575
// TUXEDO OS is ubuntu-based and has the same versions.
7676
if (distroInfo?.id === 'ubuntu' || distroInfo?.id === 'pop' || distroInfo?.id === 'neon' || distroInfo?.id === 'tuxedo') {
77-
const isOfficiallySupportedPlatform = distroInfo?.id === 'ubuntu';
78-
if (parseInt(distroInfo.version, 10) <= 19)
77+
const isUbuntu = distroInfo?.id === 'ubuntu';
78+
const version = distroInfo?.version;
79+
const major = parseInt(distroInfo.version, 10);
80+
if (major < 20)
7981
return { hostPlatform: ('ubuntu18.04' + archSuffix) as HostPlatform, isOfficiallySupportedPlatform: false };
80-
if (parseInt(distroInfo.version, 10) <= 21)
81-
return { hostPlatform: ('ubuntu20.04' + archSuffix) as HostPlatform, isOfficiallySupportedPlatform };
82-
if (parseInt(distroInfo.version, 10) <= 22)
83-
return { hostPlatform: ('ubuntu22.04' + archSuffix) as HostPlatform, isOfficiallySupportedPlatform };
84-
return { hostPlatform: ('ubuntu24.04' + archSuffix) as HostPlatform, isOfficiallySupportedPlatform };
82+
if (major < 22)
83+
return { hostPlatform: ('ubuntu20.04' + archSuffix) as HostPlatform, isOfficiallySupportedPlatform: isUbuntu && version === '20.04' };
84+
if (major < 24)
85+
return { hostPlatform: ('ubuntu22.04' + archSuffix) as HostPlatform, isOfficiallySupportedPlatform: isUbuntu && version === '22.04' };
86+
if (major < 26)
87+
return { hostPlatform: ('ubuntu24.04' + archSuffix) as HostPlatform, isOfficiallySupportedPlatform: isUbuntu && version === '24.04' };
88+
return { hostPlatform: ('ubuntu' + distroInfo.version + archSuffix) as HostPlatform, isOfficiallySupportedPlatform: false };
8589
}
8690
// Linux Mint is ubuntu-based but does not have the same versions
8791
if (distroInfo?.id === 'linuxmint') {

0 commit comments

Comments
 (0)