Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
And fix a bug where `not in` is in the wrong order.
|
|
EnvironmentVariables was always broken, it used MutableMapping because
everyone <3 abstract interfaces, especially when they are broken and
don't actually do what you want.
This needs a dict interface, exposing `.copy()`. We either use a dict or
os._Environ, and the latter also supports that.
Also fix a broken import, and the fallout from forgetting to update the
signature of self.envvars in commit b926374205bd761085031755c87152d08bc10e9d.
|
|
transpilation
|
|
|
|
The code below this already handles being passed an Executable or
ExternalProgram, and it does it correctly, since it handles host
binaries that need an exe_wrapper correctly, while the code in the
generator paths doesn't.
The xcode backend is, like always, problematic, it doesn't handle things
the same way as the ninja and vscode backends, and generates a shell
script instead of using meson as a wrapper when needed (it seems likely
that just forcing the meson path for xcode would be better). I don't
have a working mac to develop a fix for, so I've left a todo comment
there.
Fixes: #11264
|
|
|
|
The base module is fully typed, but the numbered version are not, though
it's pretty trivial to do so.
|
|
|
|
In some cases we'll get an `ImmutableListProtocol[str]` anyway (and
actually, we should probably be getting one in call cases), since we
don't mutate it anyway, just store it as immutable.
|
|
Again, state.find_program is wrong
|
|
This is also due to the incorrect annotations of state.find_program()
|
|
Because this too, has the wrong assumptions
|
|
Which suffers from the same issue as the gnome module
|
|
Mainly thi sis that `state.find_program()` is annotated incorrectly, it
returns `ExternalProgram | Executable | OverrideProgram`, but it's
annotated to return only `ExteranlProgram`, and thus a bunch of the
annotations in the gnome module are wrong.
|
|
Again, this is necessary for polymorphism with ExternalProgram
|
|
This is needed to make Executable Polymorphic with ExternalProgram. This
can happen when a build program overrides a lookup.
|
|
Fixes: #11258
|
|
This was actually probing bfd without always_args passed.
Fixes: #10763
|
|
It's msvc-like but, just like Intel Fortran, doesn't support this
argument.
|
|
It is possible, albeit possibly inadvisable, for the exact combination
of MSVC and "$CXX has C++ specific flags in it" to occur. When this
happens, and cl.exe is given a filename ending in .c, it complains that
you cannot compile a .c file with that option.
Instead, pick the first filename matching that language and use that as
the temporary filename. This more or less matches what we do in
compiler-time checks. And it's the proper thing to do, rather than
assume that cl.exe, when detected as the current C++ compiler, can
*also* compile C because it's *also* a C compiler.
Fixes #11257
|
|
`get_event_loop()` would always implicitly create one on demand, but
Python upstream has decided it's a bad/confusing API. Explicitly
starting our own, then setting it, is exactly equivalent other than not
being scheduled for deprecation.
|
|
These functions constantly want the current asyncio loop, and we run a
function call each time to get it. And the function call is a deprecated
one. Python 3.7 brings the more explicit get_running_loop for use when
we know we're inside one, with the aim of getting rid of get_event_loop
once support for python <3.7 disappears. Meson no longer supports python
<3.7 either.
Switch to the new API, and save the reference for reuse instead of
constantly re-calculating it.
|
|
Fix a TODO comment about moving to asyncio.run, now that we use
sufficiently new python to do it.
Note that we create an event loop for Windows using the new python
defaults, but in a completely different part of the code from where we
need to use it. Since asyncio.run creates the loop on its own, we need
to set the default policy instead -- which we probably should have done
all along.
|
|
In https://bugs.python.org/issue42392 this stopped implicitly creating
an event loop if none exists. We created it before running _run_tests(),
so it would auto-create an event loop and set the default, which means
we cannot create one explicitly on our own schedule or we end up with
two of them.
Delay this until we actually start the logger. This happens inside the
actual testsuite loop, so it finds the running loop and doesn't create a
new one, even on python <3.10.
|
|
Useful for running the testsuite with this environment variable and
catching obscure issues. Just like with the encoding warning later down,
we have to do this inside meson itself, not externally injected.
|
|
See https://github.com/llvm/llvm-project/commit/a8f75d49
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
Generated objects can already be passed in the "objects" keyword argument
as long as you go through an extract_objects() indirection. Allow the
same even directly, since that is more intuitive than having to add them
to "sources".
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
It's probably not useful to spam the user with warnings that old
versions of software may not behave correctly when the first warning was
perfectly valid.
|
|
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.
|
|
|
|
Just call `mlog.code_line` directly, since the exception is never raised.
|
|
We need this outside the constructor for the ParseException class, so
let's pull it out. mlog seemed like a good place since it's a text
formatting function, and has no dependencies.
|
|
|
|
|
|
enum comparisons are ultimately ints, so they're faster, plus they're
exhaustive, so mypy can statically determine that we've passed a valid
value rather than via an assertion at runtime.
|
|
This is annoying because we can't get proper auto-completion of mlog,
and because ultimately it was allowing keyword arguments to be silently
dropped on the floor. This does make the code a little more verbose, but
I think the trade-offs of completion + better safety are worth it.
PEP692, which will be part of python 3.12, provides a more elegant
solution using `TypedDicts` to annotate `**kwargs`, which we should
consider in the future.
|
|
mypy is pretty dumb when it comes to unions of callables (pylance is
also dumb in this regard), and can't figure out that our use of
`mlog.debug | mlog.log` is perfectly safe. We also can't annotate them
properly to cast them to a valid subset of arguments because you can't
have splats in `typing.Callable`, so I've done enough to make it work.
|
|
There should be a way to make mypy happy without casting, but I can't
figure it out, since the mlog.error and mlog.debug actually have
different signatures.
|
|
mypy spotted this as well. And it turns out that we're not setting the
column either for the warning, so improvements!
|
|
After tracing all the way down to the bottom of this (or really, adding
annotations so mypy can) it turns out that passing file would just be
ignored at the end of the mlog call stack, so it should be removed
|
|
Unless `meson.install_dependency_manifest()` is explicitly used, this
will cause a default implied one to be installed.
|
|
Hook this up to installed dependency manifests. This is often needed
above and beyond just an SPDX string -- e.g. many licenses have custom
copyright lines.
|
|
This was fixed in Emscripten 1.39.16, see:
https://github.com/emscripten-core/emscripten/commit/d4fabf3da40e7f556700b16950739d5960a91559
|
|
|
|
Since it's the same as the one in `CLikeCompiler`.
|
|
i.e. without a space between the "-s" and option name. See:
https://github.com/emscripten-core/emscripten/issues/11463
This is supported since Emscripten 1.39.19, see:
https://github.com/emscripten-core/emscripten/commit/f45bea21f3a8f74a68ed4e3e3d7e290807ee2aff
|
|
See: https://github.com/emscripten-core/emscripten/issues/12346
This is supported since Emscripten 1.38.33, see:
https://github.com/emscripten-core/emscripten/commit/24350798a8570f567327f873cf1efb0361aec284
|