Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add OS distro name and version to runner context #2527

Closed
kolyshkin opened this issue Apr 10, 2023 · 5 comments
Closed

feature: add OS distro name and version to runner context #2527

kolyshkin opened this issue Apr 10, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@kolyshkin
Copy link

Similar to #1185, it would be nice to have OS distro name and version in runner context.

For example, the value of runner.os is used by actions/cache as part of the cache key, so that the cache for Windows won't be reused on MacOS. Surely, it also makes sense to use runner.arch as binary artefacts from ARM won't work on e.g. X64 (filed actions/cache#1146)

What's missing is OS distro name (such as "ubuntu", in case other distros will be used in the future) and the distro version (such as "20.04" or "22.04". This is needed because the code (object files, for example) compiled on Ubuntu 22.04 won't work on Ubuntu 20.04. I guess this may also be true for Windows and Mac OS X (e.g. binaries for Mac OS 12 might not work on Mac OS 11).

Making this available might help solve problems like actions/setup-go#368 (and avoid similar hard-to-debug issues in the future).

@kolyshkin kolyshkin added the bug Something isn't working label Apr 10, 2023
@kolyshkin
Copy link
Author

Now, a universay way to do that for most modern Linux distros is this (example in shell):

. /etc/os-release
echo "distro_id=$ID"
echo "distro_version=$VERSION_ID"

Here's what it shows on my Fedora 37 laptop:

distro_id=fedora
distro_version=37

and here's the example of output on Ubuntu 22.04:

distro_id=ubuntu
distro_version=22.04

@kolyshkin
Copy link
Author

Or perhaps it's the runner image itself that should provide that information?

@nikola-jokic
Copy link
Member

Hey @kolyshkin,

Thank you for your interest in the runner application and taking the time to provide your valuable feedback. We kindly ask you to redirect this feedback to the GitHub Community Support Forum which our team actively monitors and would be a better place to start a discussion for new feature requests in GitHub Actions. For more information on this policy please read our contribution guidelines.

@kolyshkin
Copy link
Author

@nikola-jokic thanks for the detailed explanation! I think I will concede the honor of opening this feature request discussion to whoever is going to fix actions/setup-go#368 and similar issues.

@kolyshkin
Copy link
Author

For the sake of people reading this, this information is actually available from the GHA environment since March 2020, see actions/runner-images#345. For usage example, see https://github.com/actions/setup-go/pull/383/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants