install icon indicating copy to clipboard operation
install copied to clipboard

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

Open cptpcrd opened this issue 4 years ago • 4 comments

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/virtual-environments#1816).

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

cptpcrd avatar Nov 26 '20 02:11 cptpcrd

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.

svartalf avatar Nov 29 '20 17:11 svartalf

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 avatar Nov 29 '20 19:11 cptpcrd

@svartalf can this be merged?

cptpcrd avatar Dec 07 '20 19:12 cptpcrd

@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)?

cptpcrd avatar Jan 12 '21 21:01 cptpcrd