Skip to content

Commit

Permalink
env2mfile: Map Debian GNU/Hurd to system() -> gnu
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
smcv committed Oct 2, 2024
1 parent 9478db4 commit fe85233
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 7 additions & 1 deletion mesonbuild/scripts/env2mfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ def get_args_from_envvars(infos: MachineInfo) -> None:
'powerpc64le': 'ppc64',
}

# map from DEB_HOST_ARCH_OS to Meson machine.system()
deb_os_map = {
'hurd': 'gnu',
}

def deb_detect_cmake(infos: MachineInfo, data: T.Dict[str, str]) -> None:
system_name_map = {'linux': 'Linux', 'kfreebsd': 'kFreeBSD', 'hurd': 'GNU'}
system_processor_map = {'arm': 'armv7l', 'mips64el': 'mips64', 'powerpc64le': 'ppc64le'}
Expand Down Expand Up @@ -195,7 +200,8 @@ 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 = deb_os_map.get(data['DEB_HOST_ARCH_OS'],
data['DEB_HOST_ARCH_OS'])
host_subsystem = host_os
host_kernel = 'linux'
host_cpu_family = deb_cpu_family_map.get(data['DEB_HOST_GNU_CPU'],
Expand Down
6 changes: 2 additions & 4 deletions unittests/internaltests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1976,10 +1976,8 @@ def locate_path(program: str) -> T.List[str]:
'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',
Expand Down

0 comments on commit fe85233

Please sign in to comment.