Skip to content

Build fails on Mac M1 with "ENOENT: no such file or directory" due to selenium-standalone #45838

@mmacy

Description

@mmacy

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Building /src/Components via /src/Components $ ./build.sh fails on a Mac M1 in selenium-standalone due to a recent-ish change to the ARM64-based chromedriver archive's filename convention on the Chromium distribution site.

The first clue was a download failure at some point (possibly during dependency restore when I first opened the project) on https://chromedriver.storage.googleapis.com/108.0.5359.71/chromedriver_mac64_m1.zip, which I cannot for the life of me find in my build logs.

However, this error now repros reliably on every /src/Components $ ./build.sh execution because the script tries to chmod a nonexistent chromedriver archive:

  -----
  selenium-standalone installation finished
  -----
/Users/mmacy/repos/aspnetcore/src/Shared/E2ETesting/E2ETesting.targets(23,5): error : in "chmod".  [/Users/mmacy/repos/aspnetcore/src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj]
  See more details below:
  ENOENT: no such file or directory, chmod '/Users/mmacy/repos/aspnetcore/src/Components/test/E2ETest/node_modules/selenium-standalone/.selenium/chromedriver/108.0.5359.71-arm64/chromedriver'
  node:internal/process/promises:289
              triggerUncaughtException(err, true /* fromPromise */);
              ^
  
  [Error: ENOENT: no such file or directory, chmod '/Users/mmacy/repos/aspnetcore/src/Components/test/E2ETest/node_modules/selenium-standalone/.selenium/chromedriver/108.0.5359.71-arm64/chromedriver'] {
    errno: -2,
    code: 'ENOENT',
    syscall: 'chmod',
    path: '/Users/mmacy/repos/aspnetcore/src/Components/test/E2ETest/node_modules/selenium-standalone/.selenium/chromedriver/108.0.5359.71-arm64/chromedriver'
  }
  
  Node.js v19.3.0
  info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
/Users/mmacy/repos/aspnetcore/src/Shared/E2ETesting/E2ETesting.targets(23,5): error : Command failed with exit code 1. [/Users/mmacy/repos/aspnetcore/src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj]

Expected Behavior

Executing /src/Components $ ./build.sh should download all the project's dependencies including those dependencies' dependencies, and complete successfully.

Steps To Reproduce

  1. On a Mac M1 machine, follow the steps in BuildFromSource.md to prepare your local build environment.
  2. Execute the /src/Components/build.sh script.

Exceptions (if any)

No response

.NET Version

8.0.100-alpha.1.22531.1

Anything else?

As of version 106.0.5249.61, the filename suffix for the ARM64-based chromedriver ZIP archive changed. The change causes the version of selenium-standalone used by the current build config to fail to download the archive.

The compute-download-urls.js file in the version of selenium-standalone used by the current aspnetcore build/test toolchain does not accommodate the new chromedriver filename convention:

// Busted version - from selenium-standalone in current build/test toolchain
platform = 'mac64' + (process.arch === 'arm64' ? '_m1' : '');

The upstream selenium-standalone repo includes a fix for this in the current compute-download-urls.js:

// Fixed in upstream selenium-standalone repo
platform = parseInt(major, 10) > 105 ? 'mac_arm64' : 'mac64_m1';

Happy to provide more information if you need it, just say the word. 🙂

ℹ️ To get unblocked, M1 Mac users can manually download and extract the right chromedriver to the expected location.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-blazorIncludes: Blazor, Razor Componentstask

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions