fix(deps): don't suggest apt/install-deps on non-Debian Linux#41442
Open
alpham8 wants to merge 2 commits into
Open
fix(deps): don't suggest apt/install-deps on non-Debian Linux#41442alpham8 wants to merge 2 commits into
alpham8 wants to merge 2 commits into
Conversation
On distributions without apt, hostPlatform falls back to a Debian/Ubuntu build so the browser binaries can still be downloaded. As a side effect, the host dependency validation printed Ubuntu apt package names (e.g. libicu74) and the `install-deps` command, both of which are wrong there. Detect the Debian/Ubuntu family from /etc/os-release (ID and ID_LIKE, covering derivatives) and only translate missing libraries to apt package names on those systems. On other distributions the validation now lists the missing libraries and points users at their own package manager (zypper, dnf, pacman). `install-deps` itself fails with a clear message instead of a cryptic apt error. To support the detection, getLinuxDistributionInfoSync() now also exposes ID_LIKE. Drops a stale `as any` cast in the same file along the way.
When a browser fails to launch because of a missing shared library, the MCP browser factory suggested `sudo npx playwright install-deps`, which only works on Debian/Ubuntu. Show that suggestion only there; on other distributions point users at their own package manager (zypper, dnf, pacman), matching the install-deps validation message. Move the Debian/Ubuntu detection (isDebianBasedDistro) from registry/dependencies.ts into @utils/linuxUtils so both the registry and the MCP tools can share it. Replace the `any`-typed catch clauses and casts in browserFactory.ts with precise types along the way.
|
@alpham8 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
the host-dependency warning printed Debian package names
(
sudo apt-get install libicu74 …) and the MCP browser-launch error suggestednpx playwright install-deps, which only supports Debian/Ubuntu.isDebianBasedDistro()helper in@utils/linuxUtilsthat readsID/ID_LIKEfrom/etc/os-release.apt/install-depson Debian/Ubuntu. On other distributions they name thedetected distribution and point to its native package manager (zypper, dnf or
pacman).
install-depsitself now exits with a clear message on non-Debian distributionsinstead of attempting an apt install.
Notes
hostPlatformfalls back toubuntu24.04-x64for unknown distros so the browser binaries still download —the new helper reads the real
/etc/os-release, independent of that fallback.