Skip to content

Commit

Permalink
Adjust kernel detection to support Solaris 5.10 or earlier
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
CorrodedCoder authored and dcbaker committed Sep 25, 2023
1 parent d5546bd commit 5b16e83
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mesonbuild/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,11 @@ def detect_cpu(compilers: CompilersDict) -> str:

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'])
Expand Down

0 comments on commit 5b16e83

Please sign in to comment.