summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorrodedCoder <38778644+CorrodedCoder@users.noreply.github.com>2023-09-18 18:03:57 +0100
committerDylan Baker <dylan@pnwbakers.com>2023-09-25 13:05:24 -0700
commit5b16e830cc40827369cf3949a337112be74dec0e (patch)
tree4ea614ea4009bd4d68aa70dea8dca30b518ae7bc
parentd5546bdceaa2f3040d16a33fcbd824ba94b8cfde (diff)
downloadmeson-5b16e830cc40827369cf3949a337112be74dec0e.tar.gz
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.
-rw-r--r--mesonbuild/environment.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 5c7d78b90..7bd8c2ca6 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'])