env2mfile: Map Debian GNU/Hurd to system() -> gnu

As per <https://mesonbuild.com/Reference-tables.html>, and matching what
happens when running Meson for a native build on Debian GNU/Hurd.

Signed-off-by: Simon McVittie <smcv@debian.org>
pull/13866/head
Simon McVittie 2 months ago committed by Jussi Pakkanen
parent b4a7251eb8
commit 1909a8180b
  1. 7
      mesonbuild/scripts/env2mfile.py
  2. 6
      unittests/internaltests.py

@ -142,6 +142,11 @@ deb_cpu_map = {
'powerpc64le': 'ppc64',
}
# map from DEB_HOST_ARCH_OS to Meson machine.system()
deb_os_map = {
'hurd': 'gnu',
}
def replace_special_cases(special_cases: T.Mapping[str, str], name: str) -> str:
'''
If name is a key in special_cases, replace it with the value, or otherwise
@ -188,7 +193,7 @@ def dpkg_architecture_to_machine_info(output: str, options: T.Any) -> MachineInf
k, v = line.split('=', 1)
data[k] = v
host_arch = data['DEB_HOST_GNU_TYPE']
host_os = data['DEB_HOST_ARCH_OS']
host_os = replace_special_cases(deb_os_map, data['DEB_HOST_ARCH_OS'])
host_subsystem = host_os
host_kernel = 'linux'
host_cpu_family = replace_special_cases(deb_cpu_family_map, data['DEB_HOST_GNU_CPU'])

@ -1933,10 +1933,8 @@ class InternalTests(unittest.TestCase):
'CMAKE_SYSTEM_NAME': 'GNU',
'CMAKE_SYSTEM_PROCESSOR': 'i686',
},
# TODO: Currently hurd, but should be gnu as per
# https://mesonbuild.com/Reference-tables.html
system='TODO',
subsystem='TODO',
system='gnu',
subsystem='gnu',
# TODO: Currently linux, but should be gnu/hurd/mach?
# https://github.com/mesonbuild/meson/issues/13740
kernel='TODO',

Loading…
Cancel
Save