NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.73k stars 13.17k forks source link

Playwright from nixpkgs fails to spawn bundled browsers on intel mac (Bad CPU type in executable) #267894

Open camoles opened 8 months ago

camoles commented 8 months ago

Describe the bug

Playwright from nixpkgs fails to spawn its bundled browsers on intel mac mini.

Steps To Reproduce

You could install playwright-test from nixpkgs and try to run any simple test on an intel mac. A simplified way to reproduce the error would be:

$ nix-shell -p playwright-test
$ /nix/store/*-playwright-browsers-*/chromium-*/chrome-mac/Chromium.app/Contents/MacOS/Chromium
bash: /nix/store/0i01pg9v730idi1zyj5yvqdv7g0f9dd4-playwright-browsers-1.38.0/chromium-1080/chrome-mac/Chromium.app/Contents/MacOS/Chromium:
Bad CPU type in executable

if you try to run any simple playwright test, you will receive an error like below:

Error: browserType.launch: spawn Unknown system error -86
    =========================== logs ===========================
    <launching> /nix/store/0i01pg9v730idi1zyj5yvqdv7g0f9dd4-playwright-browsers-1.38.0/chromium-1080/chrome-mac/Chromium.app/Contents/MacOS/Chromium --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --enable-use-zoom-for-dsf=false --use-angle --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --user-data-dir=/tmp/playwright_chromiumdev_profile-PL7PiM --remote-debugging-pipe --no-startup-window
    ============================================================

trying to run the bundled browser referenced in the error above directly:

/nix/store/0i01pg9v730idi1zyj5yvqdv7g0f9dd4-playwright-browsers-1.38.0/chromium-1080/chrome-mac/Chromium.app/Contents/MacOS/Chromium

you get the error: Bad CPU type in executable

Expected behavior

Playwright should be able to spawn the browsers and proceed with the tests you asked it to run

Notify maintainers

@teto

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-darwin"`
 - host os: `Darwin 22.6.0, macOS 10.16`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.18.1`
 - channels(iosbuilder): `""`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/Users/iosbuilder/.nix-defexpr/channels/nixpkgs`
cryptix commented 4 months ago

Still a problem on 1.40.0