SeleniumHQ/selenium · error · anyhow::Error

{} files are only supported in macOS

Error message

{} files are only supported in macOS

What it means

Raised in uncompress() (files.rs:140) when the compressed file's type cannot be inferred by the `infer` crate, the filename ends with .pkg (or .dmg) but the runtime OS is not macOS. PKG/DMG archives require macOS tooling (pkgutil/hdiutil) to extract, so Selenium Manager refuses on other platforms. UNCOMPRESS_MACOS_ERR_MSG is formatted with 'pkg'.

Source

Thrown at rust/src/files.rs:140

    Ok(())
}

pub fn uncompress(
    compressed_file: &str,
    target: &Path,
    log: &Logger,
    os: &str,
    single_file: Option<String>,
    volume: Option<&str>,
) -> Result<(), Error> {
    let mut extension = match infer::get_from_path(compressed_file)? {
        Some(kind) => kind.extension(),
        _ => {
            if compressed_file.ends_with(PKG) || compressed_file.ends_with(DMG) {
                if MACOS.is(os) {
                    PKG
                } else {
                    return Err(anyhow!(format_one_arg(UNCOMPRESS_MACOS_ERR_MSG, PKG)));
                }
            } else {
                return Err(anyhow!(format!(
                    "Format for file {} cannot be inferred",
                    compressed_file
                )));
            }
        }
    };
    if compressed_file.ends_with(DMG) {
        if MACOS.is(os) {
            extension = DMG;
        } else {
            return Err(anyhow!(format_one_arg(UNCOMPRESS_MACOS_ERR_MSG, DMG)));
        }
    }
    log.trace(format!(
        "The detected extension of the compressed file is {}",

View on GitHub (pinned to aa36b38e69)

Solutions

  1. Run the extraction step on a macOS host if the driver genuinely ships as .pkg.
  2. Confirm the correct driver platform/URL was selected so a zip is downloaded instead.
  3. Check the mirror URL configuration; ensure it serves the platform-appropriate archive.
  4. If cross-platform extraction is required, use a macOS VM/runner for the pkg/dmg step.
Defensive patterns

Strategy: validation

Validate before calling

# Bash: ensure you're on macOS if a .pkg is expected to be extracted
if [ "$(uname -s)" != "Darwin" ] && echo "$ARCHIVE" | grep -q '\.pkg$'; then
  echo "PKG extraction requires macOS"; exit 1
fi

Try / catch

match uncompress(file, target, &log, os, single, vol) {
    Ok(()) => (),
    Err(e) if e.to_string().contains("only supported in macOS") => {
        eprintln!("Route .pkg extraction to a macOS runner");
        return Err(e);
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: uncompress() is called with a .pkg file and os != macOS. The infer crate returned None (could not fingerprint), the ends_with(PKG) branch is taken, but MACOS.is(os) is false at line 137.

Common situations: A macOS-only driver package is downloaded on Linux/Windows CI; a mirror mis-serves a .pkg for a cross-platform driver; running Selenium Manager for a macOS-targeted driver on a Linux build host.

Related errors


AI-assisted analysis of SeleniumHQ/selenium@aa36b38e69 (2026-08-14). Data as JSON: /api/errors/0981734a1f32902a. Report an issue: GitHub.