From b9e68e22e0d8eebf4f90e63d01408f524812fef2 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Thu, 6 Jul 2023 22:41:36 -0700 Subject: [PATCH] feat: support Chromium installation on Debian 12 (#24090) This adds Chromium support for both x86 and arm64 versions of Debian 12. References https://github.com/microsoft/playwright/issues/24028 --- .../src/server/registry/index.ts | 14 ++++ .../src/server/registry/nativeDeps.ts | 83 ++++++++++++++++++- .../playwright-core/src/utils/hostPlatform.ts | 3 + 3 files changed, 99 insertions(+), 1 deletion(-) diff --git a/packages/playwright-core/src/server/registry/index.ts b/packages/playwright-core/src/server/registry/index.ts index 9f8ad55b22cf6..4c9b610d52ae3 100644 --- a/packages/playwright-core/src/server/registry/index.ts +++ b/packages/playwright-core/src/server/registry/index.ts @@ -86,6 +86,8 @@ const DOWNLOAD_PATHS = { 'ubuntu22.04-arm64': 'builds/chromium/%s/chromium-linux-arm64.zip', 'debian11': 'builds/chromium/%s/chromium-linux.zip', 'debian11-arm64': 'builds/chromium/%s/chromium-linux-arm64.zip', + 'debian12': 'builds/chromium/%s/chromium-linux.zip', + 'debian12-arm64': 'builds/chromium/%s/chromium-linux-arm64.zip', 'mac10.13': 'builds/chromium/%s/chromium-mac.zip', 'mac10.14': 'builds/chromium/%s/chromium-mac.zip', 'mac10.15': 'builds/chromium/%s/chromium-mac.zip', @@ -109,6 +111,8 @@ const DOWNLOAD_PATHS = { 'ubuntu22.04-arm64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip', 'debian11': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux.zip', 'debian11-arm64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip', + 'debian12': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux.zip', + 'debian12-arm64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip', 'mac10.13': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-mac.zip', 'mac10.14': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-mac.zip', 'mac10.15': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-mac.zip', @@ -132,6 +136,8 @@ const DOWNLOAD_PATHS = { 'ubuntu22.04-arm64': 'builds/chromium/%s/chromium-with-symbols-linux-arm64.zip', 'debian11': 'builds/chromium/%s/chromium-with-symbols-linux.zip', 'debian11-arm64': 'builds/chromium/%s/chromium-with-symbols-linux-arm64.zip', + 'debian12': 'builds/chromium/%s/chromium-with-symbols-linux.zip', + 'debian12-arm64': 'builds/chromium/%s/chromium-with-symbols-linux-arm64.zip', 'mac10.13': 'builds/chromium/%s/chromium-with-symbols-mac.zip', 'mac10.14': 'builds/chromium/%s/chromium-with-symbols-mac.zip', 'mac10.15': 'builds/chromium/%s/chromium-with-symbols-mac.zip', @@ -155,6 +161,8 @@ const DOWNLOAD_PATHS = { 'ubuntu22.04-arm64': 'builds/firefox/%s/firefox-ubuntu-22.04-arm64.zip', 'debian11': 'builds/firefox/%s/firefox-debian-11.zip', 'debian11-arm64': 'builds/firefox/%s/firefox-debian-11-arm64.zip', + 'debian12': undefined, + 'debian12-arm64': undefined, 'mac10.13': 'builds/firefox/%s/firefox-mac-13.zip', 'mac10.14': 'builds/firefox/%s/firefox-mac-13.zip', 'mac10.15': 'builds/firefox/%s/firefox-mac-13.zip', @@ -178,6 +186,8 @@ const DOWNLOAD_PATHS = { 'ubuntu22.04-arm64': 'builds/firefox-beta/%s/firefox-beta-ubuntu-22.04-arm64.zip', 'debian11': 'builds/firefox-beta/%s/firefox-beta-debian-11.zip', 'debian11-arm64': 'builds/firefox-beta/%s/firefox-beta-debian-11-arm64.zip', + 'debian12': undefined, + 'debian12-arm64': undefined, 'mac10.13': 'builds/firefox-beta/%s/firefox-beta-mac-13.zip', 'mac10.14': 'builds/firefox-beta/%s/firefox-beta-mac-13.zip', 'mac10.15': 'builds/firefox-beta/%s/firefox-beta-mac-13.zip', @@ -201,6 +211,8 @@ const DOWNLOAD_PATHS = { 'ubuntu22.04-arm64': 'builds/webkit/%s/webkit-ubuntu-22.04-arm64.zip', 'debian11': 'builds/webkit/%s/webkit-debian-11.zip', 'debian11-arm64': 'builds/webkit/%s/webkit-debian-11-arm64.zip', + 'debian12': undefined, + 'debian12-arm64': undefined, 'mac10.13': undefined, 'mac10.14': 'builds/deprecated-webkit-mac-10.14/%s/deprecated-webkit-mac-10.14.zip', 'mac10.15': 'builds/deprecated-webkit-mac-10.15/%s/deprecated-webkit-mac-10.15.zip', @@ -224,6 +236,8 @@ const DOWNLOAD_PATHS = { 'ubuntu22.04-arm64': 'builds/ffmpeg/%s/ffmpeg-linux-arm64.zip', 'debian11': 'builds/ffmpeg/%s/ffmpeg-linux.zip', 'debian11-arm64': 'builds/ffmpeg/%s/ffmpeg-linux-arm64.zip', + 'debian12': 'builds/ffmpeg/%s/ffmpeg-linux.zip', + 'debian12-arm64': 'builds/ffmpeg/%s/ffmpeg-linux-arm64.zip', 'mac10.13': 'builds/ffmpeg/%s/ffmpeg-mac.zip', 'mac10.14': 'builds/ffmpeg/%s/ffmpeg-mac.zip', 'mac10.15': 'builds/ffmpeg/%s/ffmpeg-mac.zip', diff --git a/packages/playwright-core/src/server/registry/nativeDeps.ts b/packages/playwright-core/src/server/registry/nativeDeps.ts index 29300306a86c7..b2855cb122f67 100644 --- a/packages/playwright-core/src/server/registry/nativeDeps.ts +++ b/packages/playwright-core/src/server/registry/nativeDeps.ts @@ -823,7 +823,74 @@ export const deps: any = { 'libatomic.so.1': 'libatomic1', 'libevent-2.1.so.7': 'libevent-2.1-7', } - } + }, + 'debian12': { + tools: [ + 'xvfb', + 'fonts-noto-color-emoji', + 'fonts-unifont', + 'libfontconfig1', + 'libfreetype6', + 'xfonts-scalable', + 'fonts-liberation', + 'fonts-ipafont-gothic', + 'fonts-wqy-zenhei', + 'fonts-tlwg-loma-otf', + 'fonts-freefont-ttf', + ], + chromium: [ + 'libasound2', + 'libatk-bridge2.0-0', + 'libatk1.0-0', + 'libatspi2.0-0', + 'libcairo2', + 'libcups2', + 'libdbus-1-3', + 'libdrm2', + 'libgbm1', + 'libglib2.0-0', + 'libnspr4', + 'libnss3', + 'libpango-1.0-0', + 'libx11-6', + 'libxcb1', + 'libxcomposite1', + 'libxdamage1', + 'libxext6', + 'libxfixes3', + 'libxkbcommon0', + 'libxrandr2' + ], + firefox: [], + webkit: [], + lib2package: { + 'libasound.so.2': 'libasound2', + 'libatk-1.0.so.0': 'libatk1.0-0', + 'libatk-bridge-2.0.so.0': 'libatk-bridge2.0-0', + 'libatspi.so.0': 'libatspi2.0-0', + 'libcairo.so.2': 'libcairo2', + 'libcups.so.2': 'libcups2', + 'libdbus-1.so.3': 'libdbus-1-3', + 'libdrm.so.2': 'libdrm2', + 'libgbm.so.1': 'libgbm1', + 'libgio-2.0.so.0': 'libglib2.0-0', + 'libglib-2.0.so.0': 'libglib2.0-0', + 'libgobject-2.0.so.0': 'libglib2.0-0', + 'libnspr4.so': 'libnspr4', + 'libnss3.so': 'libnss3', + 'libnssutil3.so': 'libnss3', + 'libpango-1.0.so.0': 'libpango-1.0-0', + 'libsmime3.so': 'libnss3', + 'libX11.so.6': 'libx11-6', + 'libxcb.so.1': 'libxcb1', + 'libXcomposite.so.1': 'libxcomposite1', + 'libXdamage.so.1': 'libxdamage1', + 'libXext.so.6': 'libxext6', + 'libXfixes.so.3': 'libxfixes3', + 'libxkbcommon.so.0': 'libxkbcommon0', + 'libXrandr.so.2': 'libxrandr2', + } + }, }; deps['ubuntu20.04-arm64'] = { @@ -868,3 +935,17 @@ deps['debian11-arm64'] = { }, }; +deps['debian12-arm64'] = { + tools: [...deps['debian12'].tools], + chromium: [...deps['debian12'].chromium], + firefox: [ + ...deps['debian12'].firefox, + ], + webkit: [ + ...deps['debian12'].webkit, + ], + lib2package: { + ...deps['debian12'].lib2package, + }, +}; + diff --git a/packages/playwright-core/src/utils/hostPlatform.ts b/packages/playwright-core/src/utils/hostPlatform.ts index c35db077e56a1..a766a98ebc7e3 100644 --- a/packages/playwright-core/src/utils/hostPlatform.ts +++ b/packages/playwright-core/src/utils/hostPlatform.ts @@ -27,6 +27,7 @@ export type HostPlatform = 'win64' | 'ubuntu20.04' | 'ubuntu20.04-arm64' | 'ubuntu22.04' | 'ubuntu22.04-arm64' | 'debian11' | 'debian11-arm64' | + 'debian12' | 'debian12-arm64' | 'generic-linux' | 'generic-linux-arm64' | ''; @@ -69,6 +70,8 @@ export const hostPlatform = ((): HostPlatform => { } if (distroInfo?.id === 'debian' && distroInfo?.version === '11') return ('debian11' + archSuffix) as HostPlatform; + if (distroInfo?.id === 'debian' && distroInfo?.version === '12') + return ('debian12' + archSuffix) as HostPlatform; return ('generic-linux' + archSuffix) as HostPlatform; } if (platform === 'win32')