{"record":{"id":"0981734a1f32902a","repo":"SeleniumHQ/selenium","slug":"files-are-only-supported-in-macos","errorCode":null,"errorMessage":"{} files are only supported in macOS","messagePattern":"(.+?) files are only supported in macOS","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"rust/src/files.rs","lineNumber":140,"sourceCode":"    Ok(())\n}\n\npub fn uncompress(\n    compressed_file: &str,\n    target: &Path,\n    log: &Logger,\n    os: &str,\n    single_file: Option<String>,\n    volume: Option<&str>,\n) -> Result<(), Error> {\n    let mut extension = match infer::get_from_path(compressed_file)? {\n        Some(kind) => kind.extension(),\n        _ => {\n            if compressed_file.ends_with(PKG) || compressed_file.ends_with(DMG) {\n                if MACOS.is(os) {\n                    PKG\n                } else {\n                    return Err(anyhow!(format_one_arg(UNCOMPRESS_MACOS_ERR_MSG, PKG)));\n                }\n            } else {\n                return Err(anyhow!(format!(\n                    \"Format for file {} cannot be inferred\",\n                    compressed_file\n                )));\n            }\n        }\n    };\n    if compressed_file.ends_with(DMG) {\n        if MACOS.is(os) {\n            extension = DMG;\n        } else {\n            return Err(anyhow!(format_one_arg(UNCOMPRESS_MACOS_ERR_MSG, DMG)));\n        }\n    }\n    log.trace(format!(\n        \"The detected extension of the compressed file is {}\",","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rust/src/files.rs#L122-L158","documentation":"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'.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run the extraction step on a macOS host if the driver genuinely ships as .pkg.","Confirm the correct driver platform/URL was selected so a zip is downloaded instead.","Check the mirror URL configuration; ensure it serves the platform-appropriate archive.","If cross-platform extraction is required, use a macOS VM/runner for the pkg/dmg step."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Bash: ensure you're on macOS if a .pkg is expected to be extracted\nif [ \"$(uname -s)\" != \"Darwin\" ] && echo \"$ARCHIVE\" | grep -q '\\.pkg$'; then\n  echo \"PKG extraction requires macOS\"; exit 1\nfi","typeGuard":null,"tryCatchPattern":"match uncompress(file, target, &log, os, single, vol) {\n    Ok(()) => (),\n    Err(e) if e.to_string().contains(\"only supported in macOS\") => {\n        eprintln!(\"Route .pkg extraction to a macOS runner\");\n        return Err(e);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Ensure the correct platform archive (zip for Linux/Windows) is downloaded.","Run macOS-format extraction only on macOS runners.","Verify mirror URLs serve platform-appropriate archives."],"tags":["rust","selenium-manager","archive","macos","platform"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}