aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2023-06-29 13:50:52 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2023-07-04 19:02:03 +0300
commit42c68291c4c2512de04de31a90cb1c408d75a277 (patch)
treed1e18bb49632e77837d97b185e5f443748a7127e /mesonbuild
parentc34ee374a77fb2dffff90364506ac0cbbb1f00de (diff)
downloadmeson-42c68291c4c2512de04de31a90cb1c408d75a277.zip
meson-42c68291c4c2512de04de31a90cb1c408d75a277.tar.gz
meson-42c68291c4c2512de04de31a90cb1c408d75a277.tar.bz2
environment: separate illumos and Solaris kernels in Machines
While both kernels are derived from the OpenSolaris project of Sun, they have diverged and code that works with one may not work with the other. As such, we should provide different values for them. This was requested by both Oracle and the illumos upstreams. Fixes: #11922
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/environment.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 688070f..ff7ae3a 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -403,12 +403,23 @@ KERNEL_MAPPINGS: T.Mapping[str, str] = {'freebsd': 'freebsd',
'linux': 'linux',
'cygwin': 'nt',
'darwin': 'xnu',
- 'sunos': 'sunos',
'dragonfly': 'dragonfly',
'haiku': 'haiku',
}
def detect_kernel(system: str) -> T.Optional[str]:
+ if system == 'sunos':
+ # 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'])
+ if p.returncode != 0:
+ raise MesonException('Failed to run "/usr/bin/uname -o"')
+ out = out.lower().strip()
+ if out not in {'illumos', 'solaris'}:
+ mlog.warning(f'Got an unexpected value for kernel on a SunOS derived platform, expcted either "illumos" or "solaris", but got "{out}".'
+ "Please open a Meson issue with the OS you're running and the value detected for your kernel.")
+ return None
+ return out
return KERNEL_MAPPINGS.get(system, None)
def detect_subsystem(system: str) -> T.Optional[str]: