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

Incorrect Linux version regex [linux version not found (virtual package skipped)] #1851

Closed
kelszo opened this issue Aug 10, 2022 · 8 comments · Fixed by #1852
Closed

Incorrect Linux version regex [linux version not found (virtual package skipped)] #1851

kelszo opened this issue Aug 10, 2022 · 8 comments · Fixed by #1852

Comments

@kelszo
Copy link
Contributor

kelszo commented Aug 10, 2022

The regex on line 301 in libmamba/src/core/util_os.cpp is incorrect for detecting Linux versions.

The current regex is ([0-9]+\.[0-9]+\.[0-9]+)-.* and expects the Linux kernel version to end with -kernel-flavour. Ex. 5.15.59-27-generic. Not all kernel versions end with a flavour tag however. On NixOS the kernel versions are simply 5.15.59, meaning the current regex fails matching. This leads to the linux version not found (virtual package skipped) warning on certain distros.

A fix would be using a regex such as ([0-9]+\.[0-9]+\.[0-9]+)(?:-.*)? or ^([0-9]+\.[0-9]+\.[0-9]+)(?:-.*)?$.

Outputs

$ uname -a
Linux pc 5.15.59 #1-NixOS SMP Wed Aug 3 10:03:56 UTC 2022 x86_64 GNU/Linux

$ uname -r
5.15.59

$ micromamba --version
0.24.0
@wolfv
Copy link
Member

wolfv commented Aug 10, 2022

A PR would be very welcome!

@kelszo
Copy link
Contributor Author

kelszo commented Aug 10, 2022

Sure! Will have a PR ready later today

@wolfv
Copy link
Member

wolfv commented Aug 10, 2022

regex seems to work according to regex101.com :)

@wholtz
Copy link
Member

wholtz commented Oct 25, 2022

Micromamba-docker isssue 227 seems to indicate the updated regex is still failing to match on some linux distributions.

@jonashaag jonashaag reopened this Oct 25, 2022
@wolfv
Copy link
Member

wolfv commented Oct 25, 2022

I just ran our regex over the uname and it seems fine. Weird.

Screenshot 2022-10-25 at 17 53 43

@wholtz
Copy link
Member

wholtz commented Oct 25, 2022

Yeah, I jumped the gun on the regex. I tried it in https://regex101.com/ but forget to remove the \ escaping, so it looked like it was failing on regex.

@wholtz
Copy link
Member

wholtz commented Oct 25, 2022

The call to uname -r is failing. This is within a ubuntu:bionic image... but I haven't been able to reproduce it.

@wolfv
Copy link
Member

wolfv commented Oct 25, 2022

interesting, thanks for helping out with the debugging!

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

Successfully merging a pull request may close this issue.

4 participants