From 5b16e830cc40827369cf3949a337112be74dec0e Mon Sep 17 00:00:00 2001 From: CorrodedCoder <38778644+CorrodedCoder@users.noreply.github.com> Date: Mon, 18 Sep 2023 18:03:57 +0100 Subject: Adjust kernel detection to support Solaris 5.10 or earlier The logic previously added to distinguish between illumos and Solaris made use of a uname invocation with a -o switch which is not supported on Solaris 5.10 or earlier. illumos started with version 5.11 so the logic has been shortcut to report 'solaris' in such cases where the version is 5.10 or below. --- mesonbuild/environment.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 5c7d78b..7bd8c2c 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -411,6 +411,11 @@ KERNEL_MAPPINGS: T.Mapping[str, str] = {'freebsd': 'freebsd', def detect_kernel(system: str) -> T.Optional[str]: if system == 'sunos': + # Solaris 5.10 uname doesn't support the -o switch, and illumos started + # with version 5.11 so shortcut the logic to report 'solaris' in such + # cases where the version is 5.10 or below. + if mesonlib.version_compare(platform.uname().release, '<=5.10'): + return 'solaris' # This needs to be /usr/bin/uname because gnu-uname could be installed and # won't provide the necessary information p, out, _ = Popen_safe(['/usr/bin/uname', '-o']) -- cgit v1.1