The logic previously added to distinguish between illumos and Solaris made use of a uname invocation with a -o switch which is not supported on Solaris 5.10 or earlier.
illumos started with version 5.11 so the logic has been shortcut to report 'solaris' in such cases where the version is 5.10 or below.
If we have a build- or host-architecture compiler, we can detect mips64
vs. mips by the fact that mips64 compilers define __mips64. However,
machine_info_can_run() doesn't provide any compilers, because it is
interested in the architecture of the underlying kernel. If we don't
return mips64 when running on a mips64 kernel, machine_info_can_run()
will wrongly say that we can't run mips64 binaries.
If we're running a complete 32-bit mips user-space on a mips64 kernel,
it's OK to return mips64 in the absence of any compilers, as a result
of the previous commit "environment: Assume that mips64 can run 32-bit
mips binaries".
Resolves: https://github.com/mesonbuild/meson/issues/12017
Bug-Debian: https://bugs.debian.org/1041499
Fixes: 6def03c7 "detect_cpu: Fix mips32 detection on mips64"
Signed-off-by: Simon McVittie <smcv@debian.org>
The relationship between mips64 and mips is similar to the relationship
between x86_64 and x86. Representing it here is necessary so that we
will not require an exe_wrapper when cross-compiling for 32-bit mips on
mips64, or when a complete 32-bit mips user-space runs on a 64-bit kernel
without using linux32 to alter uname(2) to pretend to be 32-bit.
Signed-off-by: Simon McVittie <smcv@debian.org>
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
MIPS64 can run MIPS32 code natively, so there is a chance that a mixture
of MIPS64 kernel and MIPS32 userland exists. Before this Meson just
treats such mixture as mips64, because uname -m returns mips64.
So in this case we have to check compiler builtin defines for actual
architecture and CPU in use.
- Also fixes mips64 related detection tests in internaltests:
Normalize mips64 as mips first, then if __mips64 is defined, return
mips64 for mips64* machines.
This is a bit confiusing because normally one would detect if a flag
of 32-bit target is defined while running on a 64-bit machine. For
mips64 it is almost just the other way around - we need to detect if
__mips64 is set to make sure it is a mips64 environment.
Co-Authored-By: Jue Wang <maliya355@outlook.com>
This reverts commit 79d7891746.
This debug print probably should not have ended up live. Moreover, the
function it debugs is, surprisingly, called rather often. Adding I/O to
it causes it to begin to noticeably lag, on the scale of adding actual
*minutes* to a setup run.
Fixes#11322
There are lots of warnings that become fatal, that are simply unfixable
by the end user. Things like using old versions of software (because
they're using some kind of LTS release), warnings about compilers not
supporting certain kinds of checks, or standards being upgraded due to
skipped implementations (MSVC has c++98 and c++14, but not c++11). None
of these should be fatal, they're informative, and too important to
reduce to notices, but not important enough to stop meson if they're
printed.
It is only used by Environment.get_exe_wrapper() and every callers were
handling None already. Type annotation was wrong, it already could
return None for the case an exe wrapper is needed but none is provided.
Which adds the `use-set-for-membership` check. It's generally faster in
python to use a set with the `in` keyword, because it's a hash check
instead of a linear walk, this is especially true with strings, where
it's actually O(n^2), one loop over the container, and an inner loop of
the strings (as string comparison works by checking that `a[n] == b[n]`,
in a loop).
Also, I'm tired of complaining about this in reviews, let the tools do
it for me :)
Move `detect_native_windows_arch()` to `mesonlib/universal.py` and
rename it to `windows_detect_native_arch()`
Use `IsWow64Process2()` to detect native architecture if available
Use native `vcvarsarm64.bat` to initialize vsenv if available
In various situations we want to figure out what type of compiler we
have, because we want to know stuff like "is it the pgi one", or "does
it use msvc style". The compiler object has this property already, via
an API specifically designed to communicate this info, but instead we
performed isinstance checks on a compiler class.
This is confusing and indirect, and has the side effect of requiring
more imports everywhere. We should do away with it.
The new get_env() method that returns an EnvironmentVariables object
will be needed in next commit that will pass it to CustomTarget.
This has the side effect to use the proper os specific path separator
instead of hardcoding `:`. It is the obvious right thing to do here, but
has caused issues in the past. Hopefully issues have been fixed in the
meantime. If not, better deal with fallouts than keep doing the wrong
thing forever.
A bunch of files have several T.TYPE_CHECKING blocks that each do some
things which could just as well be done once, with a single `if`
statement. Make them do so.
We say:
> If version 4.2 or higher of the first is found, targets coverage-text,
> coverage-xml, coverage-sonarqube and coverage-html are generated.
But this is totally untrue. Make it true, by actually checking (and
not generating broken coverage commands when older versions of gcovr are
found).
Fixes#9505
I ran into one of these from LGTM, and it would be nice if pylint could
warn me as part of my local development process instead of waiting for
the CI to tell me.
Instead of treating native files as always being for the build machine,
and then copying them to the host machine, treat them as for the build
machine only when a cross file is also present