setup-python icon indicating copy to clipboard operation
setup-python copied to clipboard

use of lsb_release instead of /etc/os-release for getting OS information on linux

Open kratsg opened this issue 2 weeks ago • 1 comments

In https://github.com/actions/setup-python/blob/4f41a90a1f38628c7ccc608d05fbafe701bc20ae/src/utils.ts#L175-L178 the lsb_release legacy command line is relied upon for identifying linux distros. By now however, as part of systemd you should have /etc/os-release which should cover a vast majority if not all OSes that linux runners would be using (GitHub-hosted, Ubuntu-based self-hosted, or other non-Ubuntu-self-hosted otherwise).

Description:

The proposal would be to migrate from relying on the lsb_release executable in favor of the /etc/os-release and the contents there for identifying the OS information.

Justification:

Issues like https://github.com/actions/setup-python/issues/1214 and error messages on self-hosted runners such as Error: The version '3.13' with architecture 'x64' was not found for this operating system. are quite misleading because they indicate that setup-python has no x64 architecture for the operating system, when in actuality it is the operating system that setup-python does not support which is (frustratingly) hidden away in the advanced usage of the documentation.

Are you willing to submit a PR?

Yes, but I would not know how to test this.

kratsg avatar Jan 09 '26 02:01 kratsg