From 555a67407e3639c71356950f2d2151860ba2fb4f Mon Sep 17 00:00:00 2001 From: Matt Clarkson Date: Wed, 5 Feb 2025 16:55:19 +0000 Subject: [PATCH] fix: allow four-part `uname -r` versions On WSL2, the kernel version is reported as a four-part version such as `5.15.167.4-microsoft-standard-WSL2`. The extra part is the increment number that Microsoft put onto of the upstream kernel headers. We drop the extra patch part to stay consistent. This likely needs a follow-up series of patches to validate the detection under WSL. --- toolchain/local/triplet/os.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/toolchain/local/triplet/os.bzl b/toolchain/local/triplet/os.bzl index a7de606..b2a9afc 100644 --- a/toolchain/local/triplet/os.bzl +++ b/toolchain/local/triplet/os.bzl @@ -118,6 +118,7 @@ def _uname(rctx, path): major, minor, patch = split(version, ".", { 3: lambda x, y, z: (x, y, z), + 4: lambda x, y, z, _: (x, y, z), }) if rctx.path("/.dockerenv").exists: -- GitLab