Skip to content

feat(linux): add community support for Rocky Linux 9 / RHEL 9 (Chromium)#40312

Open
Dev-iL wants to merge 1 commit intomicrosoft:mainfrom
SummitSG-LLC:2604/rhel_support
Open

feat(linux): add community support for Rocky Linux 9 / RHEL 9 (Chromium)#40312
Dev-iL wants to merge 1 commit intomicrosoft:mainfrom
SummitSG-LLC:2604/rhel_support

Conversation

@Dev-iL
Copy link
Copy Markdown

@Dev-iL Dev-iL commented Apr 20, 2026

Fixes: #37812 (partially)

Summary

  • Adds rhel9-x64 and rhel9-arm64 platform detection via /etc/os-release ID and ID_LIKE fields; covers Rocky Linux, RHEL, AlmaLinux, CentOS Stream, and Oracle Linux at version ≥ 9 (Fedora explicitly excluded)
  • install-deps chromium now uses dnf/yum with EPEL enablement on RHEL-family hosts, including proper sudo/su privilege escalation for non-root users
  • Adds Chromium download paths for rhel9; Firefox and WebKit remain unsupported (undefined) on RHEL — only Chromium is community-supported
  • RHEL 8 and earlier produce an actionable error message instead of a confusing apt-get failure
  • Adds dep-generation tooling (process_rhel.sh, list_dependencies_rhel.js) and a CI workflow running install + headless smoke test inside a rockylinux:9 container
  • All existing ubuntu/debian code paths are unchanged

Manual testing

Verified end-to-end inside a rockylinux:9 Docker container.

  1. Pack playwright-core:
npm run build
node utils/pack_package.js playwright-core /tmp/pw-core.tar.gz
  1. Write the test script to /tmp:
cat > /tmp/test-rhel9.js << 'EOF'
const { chromium } = require('playwright-core');
(async () => {
  const browser = await chromium.launch({ headless: true });
  const page = await browser.newPage();

  // Navigation + title
  await page.goto('data:text/html,<title>Rocky Linux 9</title><h1 id=h>Playwright on Rocky Linux 9</h1><input id=i><div id=r></div>');
  console.log('title:', await page.title());

  // DOM interaction
  await page.fill('#i', 'hello from rhel9');
  await page.evaluate(() => { document.getElementById('r').textContent = document.getElementById('i').value; });
  const result = await page.textContent('#r');
  console.log('DOM result:', result);
  if (result !== 'hello from rhel9') throw new Error('DOM interaction failed');

  // JS evaluation
  const ua = await page.evaluate(() => navigator.userAgent);
  console.log('UA:', ua.includes('HeadlessChrome') ? 'HeadlessChrome confirmed' : ua);

  // Screenshot
  await page.screenshot({ path: '/mnt/rhel9-screenshot.png' });
  console.log('Screenshot saved to /mnt/rhel9-screenshot.png');

  await browser.close();
  console.log('PASS: all checks passed on Rocky Linux 9');
})().catch(e => { console.error(e); process.exit(1); });
EOF
  1. Run the full install + functional test:
docker run --rm -v /tmp:/mnt rockylinux:9 sh -c '
  set -e
  dnf module enable -y nodejs:20
  dnf install -y nodejs
  mkdir /app && cd /app && npm init -y
  npm i /mnt/pw-core.tar.gz

  node_modules/.bin/playwright-core install-deps chromium
  node_modules/.bin/playwright-core install chromium

  cp /mnt/test-rhel9.js /app/
  node /app/test-rhel9.js
'

Resulting in:

title: Rocky Linux 9
DOM result: hello from rhel9
UA: HeadlessChrome confirmed
Screenshot saved to /mnt/rhel9-screenshot.png
PASS: all checks passed on Rocky Linux 9
rhel9-screenshot

Future Work

  • Add more OS variants/versions
  • Add Firefox & WebKit support

@Dev-iL
Copy link
Copy Markdown
Author

Dev-iL commented Apr 20, 2026

@microsoft-github-policy-service agree company="SSG LLC"

@Dev-iL Dev-iL force-pushed the 2604/rhel_support branch from a49db50 to 01ea520 Compare April 20, 2026 12:27
- Detect RHEL-family distros via id and id_like; map version >= 9 to rhel9-{arch}
- Add RPM package list for Chromium (20 packages from rockylinux:9 Docker run)
- Install deps via dnf/yum with EPEL enablement and privilege escalation
- Add rhel9-x64/arm64 download paths for Chromium and ffmpeg
- Emit actionable error for RHEL 8 users rather than confusing apt-get failure
- Add dep-generation tooling (process_rhel.sh, list_dependencies_rhel.js) and CI workflow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Support for Red Hat and Oracle Linux

1 participant