aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--docs/markdown/Reference-tables.md3
-rw-r--r--mesonbuild/environment.py13
2 files changed, 14 insertions, 2 deletions
diff --git a/docs/markdown/Reference-tables.md b/docs/markdown/Reference-tables.md
index b553832..377b362 100644
--- a/docs/markdown/Reference-tables.md
+++ b/docs/markdown/Reference-tables.md
@@ -175,7 +175,8 @@ Native names as returned by the `.kernel()` method.
| netbsd | |
| nt | |
| xnu | Kernel of various Apple OSes |
-| sunos | |
+| illumos | Kernel derived from OpenSolaris by community efforts |
+| solaris | Kernel derived from OpenSolaris by Oracle |
| dragonfly | |
| haiku| |
| none | For e.g. bare metal embedded |
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]: