Skip to content

Add platform_utils.py for cross platform OS detection and CI workflow#545

Open
Eashan-H wants to merge 3 commits into
FOSSEE:feature/tool-manager-integrationfrom
Eashan-H:feature/tool-manager-integration-update
Open

Add platform_utils.py for cross platform OS detection and CI workflow#545
Eashan-H wants to merge 3 commits into
FOSSEE:feature/tool-manager-integrationfrom
Eashan-H:feature/tool-manager-integration-update

Conversation

@Eashan-H

@Eashan-H Eashan-H commented Jun 8, 2026

Copy link
Copy Markdown

Purpose

The tool manager currently hardcodes Windows only logic and has no Linux or macOS backend. This causes silent failures on Ubuntu and other Linux distros and there is no package manager detection for non-apt distros like Fedora, Arch, or openSUSE.

This PR adds the foundation for full cross-platform support by introducing a dedicated OS detection utility and a CI workflow to validate it across all target platforms.


Approach

Added src/toolManager/platform_utils.py:

  • Detects the current OS (IS_WINDOWS, IS_LINUX, IS_MAC)
  • Auto-detects the correct package manager (apt, dnf, yum, pacman, zypper, apk on Linux; brew, port, nix on macOS; None on Windows)
  • Provides distro_label() for human-readable OS/distro names (e.g. Ubuntu 22.04, Windows 11, macOS Sequoia)
  • Provides subprocess_flags() to suppress console windows on Windows — returns CREATE_NO_WINDOW + STARTUPINFO on Windows, empty dict on Linux/macOS

Added .github/workflows/test_platform_utils.yml:

  • Automatically runs smoke tests on every push/PR that touches platform_utils.py
  • Tests across 5 environments: Ubuntu (apt), Fedora 40 (dnf), Arch Linux (pacman), macOS (brew), Windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant