feat(deps): add native Fedora Linux support#39665
Closed
CybLow wants to merge 1 commit intomicrosoft:mainfrom
Closed
feat(deps): add native Fedora Linux support#39665CybLow wants to merge 1 commit intomicrosoft:mainfrom
CybLow wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Add Fedora as a recognized platform in Playwright with full support for Chromium and Firefox, and experimental WebKit support via a compatibility layer. Platform detection: - Detect Fedora via /etc/os-release (fedora-x64, fedora-arm64) - Add id_like field to os-release parsing for future RHEL-family detection - Versionless platform string (packages stable across Fedora 39-43+) - isOfficiallySupportedPlatform: false (browsers are Ubuntu-built) Package management: - Use dnf install -y --skip-unavailable instead of apt-get on Fedora - Add complete Fedora RPM package mappings for all three browsers - Add 70+ lib2package mappings (.so names -> Fedora RPM package names) - Show correct dnf install commands in error messages - On Fedora, warn instead of throwing when all missing deps have known package mappings (graceful degradation for non-critical libs) Browser downloads: - Add fedora-x64 and fedora-arm64 to all DOWNLOAD_PATHS records - Chromium/Firefox: reuse Ubuntu 24.04 builds (cross-distro compatible) - WebKit: reuse Ubuntu 24.04 builds with compat layer (see below) WebKit compatibility layer (fedoraCompat.ts): - Downloads Ubuntu 24.04 libjpeg-turbo8 .deb for LIBJPEG_8.0 ABI - Downloads Ubuntu 24.04 ICU 74 .deb for ICU symbol compatibility - Creates libjxl.so.0.8 symlink to system libjxl for soversion compat - Patches WebKit MiniBrowser wrapper scripts with compat LD_LIBRARY_PATH - Architecture-aware (amd64/arm64) for .deb downloads and extraction - All compat libraries installed to ~/.local/lib/playwright-compat/ - Full error handling with warnings on all failure paths Note: The compat layer is experimental. The proper long-term fix is adding Fedora to the WebKit build matrix in the CI infrastructure. The team may prefer to ship Chromium+Firefox only and set WebKit to undefined.
CybLow
pushed a commit
to CybLow/playwright-fedora
that referenced
this pull request
Mar 13, 2026
- Replace libjpeg cmake/gcc/nasm build with Ubuntu .deb download - Add deb_arch() helper for arm64/amd64 architecture detection - Use HTTPS URLs instead of HTTP for all Ubuntu package downloads - Remove launchpadlibrarian.net fallback (hardcoded amd64 ID) - Remove cmake/gcc/gcc-c++/nasm from Dockerfile deps - Add libjxl base compat dir to WebKit wrapper patching - Reference upstream PR microsoft/playwright#39665 - No compiler toolchain required — only curl/binutils/tar/findutils
Member
|
This is out of scope at the moment. |
Author
what part is out of scope exactly? Fedora are a huge developper base os. It's the support in general, or specifically the WebKit compat layer? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds native Fedora Linux support to Playwright. Currently, Playwright only supports Debian/Ubuntu-based distributions — running on Fedora fails because:
install-depshardcodesapt-get(Fedora usesdnf)apt-get installinstead ofdnf installFedora is the 3rd most popular Linux distribution and the upstream for RHEL/CentOS/Rocky/Alma. This PR makes Chromium and Firefox work natively on Fedora with zero workarounds.
What this PR does
Platform detection (
hostPlatform.ts,linuxUtils.ts):/etc/os-release→fedora-x64/fedora-arm64id_likefield to os-release parsing (for future RHEL-family detection)isOfficiallySupportedPlatform: false(browsers are Ubuntu-built binaries)Package management (
dependencies.ts):getLinuxPackageManager()helper: returns'dnf'for Fedora,'apt'otherwiseinstallDependenciesLinux(): usesdnf install -y --skip-unavailableon FedoravalidateDependenciesLinux(): showsdnf installin error messagesinstall-depsguidance (doesn't block Chromium/Firefox)libx264.sofrom RPM Fusion) → warns, doesn't block browser launchBrowser downloads (
index.ts):fedora-x64andfedora-arm64to allDOWNLOAD_PATHSrecordsNative dependencies (
nativeDeps.ts):fedora-x64entry with correct Fedora RPM package names for tools, chromium, firefox, webkitlib2packagemappings (.sonames → Fedora RPM package names)curl,binutils,tar,findutils(needed by compat layer)fedora-arm64spread variantWebKit on Fedora — discussion needed
WebKit binaries are compiled on Ubuntu 24.04, which means they link against Ubuntu's library versions. On Fedora, several libraries have ABI-incompatible versions:
libjpeg.so.8(LIBJPEG_8.0 ABI)libjpeg.so.62(LIBJPEG_6.2 ABI)libicudata.so.74(ICU 74)libicudata.so.75+(ICU 75–77)libjxl.so.0.8(soversion 0.8)libjxl.so.0.11(soversion 0.11)This cannot be fixed in TypeScript — it's baked into the compiled C++ binary. This PR includes a compatibility layer (
fedoraCompat.ts) that:libjpeg-turbo8.deb→ extractslibjpeg.so.8with LIBJPEG_8.0 symbols (HTTPS, architecture-aware)libicu74.deb→ extracts ICU 74 librarieslibjxl.so.0.8symlink → system'slibjxl.so.0.11LD_LIBRARY_PATHplaywright install-depsandplaywright install webkit# playwright-fedora-compat-patchedmarker (works regardless of customPLAYWRIGHT_COMPAT_DIR)All compat libraries are installed to
~/.local/lib/playwright-compat/(user-scoped, non-invasive).I understand this compat layer may not align with the project's architecture and the team may prefer a different approach. Possible alternatives:
undefined, ship Chromium + Firefox only. Clean and honest.webkit-fedora.zipon Fedora CI, which would eliminate all ABI issues. This is the proper long-term fix.I'm happy to strip
fedoraCompat.tsand remove WebKit support from this PR if the team prefers option 1, and then open a follow-up issue requesting Fedora WebKit builds.What this gives Fedora users
Design decisions
fedora-x64(versionless)falseTesting
Tested on a clean Fedora 43 Docker container (no pre-installed dev tools, no env var workarounds):
fedora-x64install-depsuses dnf with correct packagesSee also: playwright-fedora — standalone Fedora integration testing repo with Docker-based test suite.
Test plan
npm run flintpasses (ESLint + tsc clean, doclint failure is pre-existing — requires browser binaries installed)npx playwright install-depsuses dnfRecord<HostPlatform, ...>completeness (all DOWNLOAD_PATHS include fedora entries)