#1150412 file utility needed for --find-package command-line option on some 64-bit archs

Package:
cmake
Source:
cmake
Description:
cross-platform, open-source make system
Submitter:
Sébastien Villemot
Date:
2026-10-09 10:25:02 UTC
Severity:
normal
#1150412#5
Date:
2026-10-09 10:22:53 UTC
From:
To:
Dear Maintainer,

When running cmake on the command-line with the --find-package option, a
heuristic is used to determine CMAKE_SIZEOF_VOID_P without using a compiler
(see /usr/share/cmake-<version>/Modules/CMakeFindPackageMode.cmake).

If /usr/lib64 exists, then a size of 8 bytes is assumed. But some of our
architectures (riscv64 and s390x at least) don’t have that directory. In that
case, CMake falls back to a detection using the file utility, and if that
utility is not present on the system, a size of 4 bytes is assumed.

This means that cmake --find-package will detect the wrong pointer size on
riscv64 and s390x in a minimal chroot such as one used in autopkgtest (which is
what happened to me with the tasmanian package, where testing of the CMake
config-file package works on amd64 but fails on s390x in version 8.2-3).

This tends to suggest that the file package should be added as a dependency of
cmake, to avoid such a situation.

Thanks for your work,