Skip to content

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

@kratsg

Description

@kratsg

In

setup-python/src/utils.ts

Lines 175 to 178 in 4f41a90

export async function getLinuxInfo() {
const {stdout} = await exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {
silent: true
});
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 #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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature or request to improve the current logic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions