`DEB_HOST_ARCH` encodes both the CPU family and the OS, so using it to
get the CPU type gives the wrong answer for non-Linux ports.
However, `DEB_HOST_GNU_CPU` gives less detailed information about the
CPU: it's `arm` for all 32-bit ARM CPUs, and doesn't distinguish between
the differing baselines of `armel` (ARMv5 softfloat) and `armhf`
(ARMv7 hardfloat).
When cross-compiling for x86_64 Linux, this changes the `cpu()` from
`amd64` to `x86_64`, which is consistent with the answer we get during
native builds on that architecture.
When cross-compiling for `ppc64el`, this changes the `cpu()` from
`ppc64el` to `ppc64`, which is a reasonable change but is still not
consistent with what we see during native builds (which is `ppc64le`):
see #13741 for that.
Resolves: https://github.com/mesonbuild/meson/issues/13742
Signed-off-by: Simon McVittie <smcv@debian.org>
All official Debian release architectures use the Linux kernel, but
unofficial ports like hurd-i386 and kfreebsd-amd64 use the Hurd and
FreeBSD kernel, respectively.
Map Linux to 'linux' and kFreeBSD ports to 'freebsd' as per the
reference tables in Meson's documentation. For now, use the Debian
system name such as 'hurd' for anything else (see #13740 for the
question of whether Hurd should identify its kernel differently).
Signed-off-by: Simon McVittie <smcv@debian.org>
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>
This test parses several possible outputs of dpkg-architecture and
asserts that they produce the expected MachineInfo.
To avoid depending on suitable cross-tools being installed, use
unittest.mock to override locate_path with a version that pretends that
all of the tools we're interested in are in /usr/bin.
Similarly, use mock environment variables to exercise what happens
when we have those set.
The test data used here exercises most variations:
* big- and little-endianness
* GNU CPU (x86_64) differing from dpkg CPU (amd64)
* Linux, kFreeBSD and Hurd
* special-cased architectures: x86, arm, mips64el, ppc64el
expected_compilers() intentionally doesn't assume that every compiler
is gcc (even though they all are, right now), because #13721 proposes
adding valac which does not take a gcc suffix.
Signed-off-by: Simon McVittie <smcv@debian.org>
This allows checking for tools that may not be available in older version of qt
or avoiding requesting tools that may not be necessary for a given project
Co-authored-by: Nirbheek Chauhan <nirbheek@centricular.com>
Fixes#13508
- Fix indentation of comments in arrays
- Fix indentation of comments in dicts
- Fix indentation of comments in if clauses
- Fix indentation of comments in foreach clauses
for test attributes that are class constant. This reduces the work that
must be done for each test case, allowing some of the setup work to be
done once for the entire class.
The documentation for subprocess.run at https://docs.python.org/3/library/subprocess.html#popen-constructor has a warning,
pointing to using shutil.which() instead of subprocess.run for detecting if exe files exists on the path.
shutil.which() is used in many places already.
Fixes regression from commit 78e9009ff9.
The above commit relied on rpath_dirs_to_remove being present and
correctly filled, which was never the case for the AppleDynamicLinker.
The result was that all the build-dir-only RPATHs were being carried
over to the installed files.
This commit implements returning the list of RPATHs to remove in
AppleDynamicLinker, doing pretty much the same thing as what's in the
GnuLikeDynamicLinkerMixin. Thanks to that, depfixer now correctly
removes build-time Meson-created RPATHs, as it used to before 1.4.1.
Cargo.lock is essentially identical to subprojects/*.wrap files. When a
(sub)project has a Cargo.lock file this allows automatic fallback for
its cargo dependencies.
Running `touch` on a tracked file in Git, to update its timestamp, and
then running `meson dist` would cause dist to fail:
ERROR: Repository has uncommitted changes that will not be included in the dist tarball
Use --allow-dirty to ignore the warning and proceed anyway
Unlike `git status` and `git diff`, `git diff-index` doesn't refresh the
index before comparing, so stat changes are assumed to imply content
changes. Run `git update-index -q --refresh` first to refresh the index.
Fixes: #12985
Since it's an implementation detail, and shouldn't be exposed. This also
helps give better error messages when a user writes `import('qt')`,
since otherwise you get an error about `qt doesn't have an initialize
method`, and now you get `qt module doesn't exist`.