Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Improve Ubuntu version detection (and prepare for imminent switch to 20.04 by default) #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cptpcrd
Copy link

@cptpcrd cptpcrd commented Nov 26, 2020

This PR makes the getRunner() function check /etc/os-release to determine the Ubuntu version, rather than hardcoding a kernel version check.

This is also important because the current implementation only checks for Ubuntu 16.04/18.04. Ubuntu 20.04 has been available for use in GitHub Actions for some time, and ubuntu-latest will soon default to ubuntu-20.04 (see actions/runner-images#1816).

(Edit: I don't write much Node, and I've never written TypeScript, so I'm happy to make changes to this.)

@cptpcrd cptpcrd force-pushed the ubuntu-version-detection branch 6 times, most recently from 05f8a08 to f2506da Compare November 26, 2020 03:06
@svartalf
Copy link
Member

Hi, @cptpcrd and thanks for PR!

Looks great, but I'm a bit worried if it is safe to rely on VERSION_ID parameter? Ubuntu man page states that this field is optional.

@cptpcrd
Copy link
Author

cptpcrd commented Nov 29, 2020

Hi, @cptpcrd and thanks for PR!

Looks great, but I'm a bit worried if it is safe to rely on VERSION_ID parameter? Ubuntu man page states that this field is optional.

AFAIK it's present on most systems that have an actual "version". For example, it's absent on Arch because Arch is rolling release, but I don't think I've ever seen it absent on a Debian-based system. (That man page appears to be copied directly from systemd's man page, which is written very generally, so I'm not surprised that it mentions certain fields being optional when they're actually present on Ubuntu).

I don't know of another "good" way to reliably detect the version of Ubuntu without getting too complicated (i.e. spawning processes and parsing output), except maybe /etc/lsb-release (which is nonstandard).

@cptpcrd cptpcrd force-pushed the ubuntu-version-detection branch from f2506da to d2de35b Compare November 29, 2020 19:39
@cptpcrd cptpcrd force-pushed the ubuntu-version-detection branch from d2de35b to 324307e Compare November 29, 2020 19:42
@cptpcrd
Copy link
Author

cptpcrd commented Dec 7, 2020

@svartalf can this be merged?

@cptpcrd
Copy link
Author

cptpcrd commented Jan 12, 2021

@svartalf The migration to Ubuntu 20.04 began more than a month ago. Is it possible to get this merged (probably along with actions-rs/tool-cache#9)?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants