| Age | Commit message (Collapse) | Author |
|
It doesn't appear to have been needed at all? But only newer mypy
versions go so far as to report it as an unused ignore (which is an
error code itself).
|
|
The type error is renamed to union-attr in some mypy versions, which
raises TWO errors:
- Unused "type: ignore" comment
- Item "TextIO" of "TextIO | Any" has no attribute "colorize_console"
... which broadly speaking indicates that we should not be using
targeted ignores, after all. A proper inheritance system for ignore
types would be more fitting, but seemingly doesn't exist.
|
|
Newer mypy astutely notices this always sets `self.options[str_key]`,
which violates the type requirement for OptionKey. Per the comment,
nobody should be using it, and fortunately nobody is. Deleting the code
(or making it raise MesonBugException) has no impact on the testsuite.
|
|
Which could be printed dozens of times in a row inside
./run_project_tests.py. Regression in commit
c3ea8d5aa1b48fbc4137ef783c567a32cd596993.
|
|
glob can be a generator or an iterator depending on python version. We
would rather not care about this (and officially these are the same,
except not). We just pass it to "accepts_iterable". But nonetheless, we
are forced to care because we hold the value. Sad.
|
|
Reduces 3 errors that show up in newer mypy versions than pinned in CI.
It is new since 1.16 and a likely future default for mypy 2.0. It allows
things like:
```
for i in ['one', 'two', 'three']:
frob_a(i)
for i in [1, 2, 3]:
frob_b(i)
```
since "i" is obviously used as a loop holder and its type can be freely
reinvented. Note: allow-redefinition-new isn't actually about this at
all, it has greater scope than loop holders and allows redefining
"unannotated variables" of all kinds. No granularity in what to accept
redefinition of. :P
To enable this, we must also opt in to local-partial-types, which has
some overlap with None-safety. Specifically:
> the most common cases for partial types are variables initialized
> using None, but without explicit X | None annotations. By default, mypy
> won’t check partial types spanning module top level or class top level.
> This flag changes the behavior to only allow partial types at local
> level, therefore it disallows inferring variable type for None from two
> assignments in different scopes.
So with this, we also fix a couple of actual type errors this revealed.
Where possible, stop None-initializing at all -- it's not strictly
needed for global variables, anyway, and it's a coding error if it is
possible to hit these variables without defining them first.
Bug: https://github.com/python/mypy/issues/19280
|
|
UnknownValue
It is not the build layer's job to handle ast types, so instead filter
out UnknownValues before passing them to the build layer, then fix up
any special values we need in the ast layer. This reveals that some of
what we were previously doing only works because the build layer is
pretty much untyped, if it was typed it would have screamed loudly.
|
|
- Split long expressions in () according to max line length
- Partly revert d028502 . Fixes #14935.
- Fixes #15032.
|
|
The main complication here is that passing -fms-runtime-lib during compilation
results in a warning:
clang: error: argument unused during compilation: '-fms-runtime-lib=dll' [-Werror,-Wunused-command-line-argument]
(https://github.com/mesonbuild/meson/actions/runs/17727020048/job/50369771571).
So, for compilation expand the -D flags by hand, and only pass -fms-runtime-lib
when linking.
Fixes: #14571
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
get_crt_link_args was only called for the final linker command line; add
its result to the sanity check and compiler tests as well.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Option values have type "str | int | list[str]", assert that they are
strings before passing them to self.get_crt_compile_args().
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
When building a proc-macro crate the build target is actually a shared
library target. The resulting library (the .so file directly) is used
in the targets that depend on it. But being a shared object there are
symbols extracted from it and the symbols file is the actual file
recorded as the dependency. When another crate uses a macro from the
first crate, being dependent on the symbols file it means that if the
macro _implementation_ changes, but symbols stay the same, the symbol
extractor does not rewrite the symbols file and nothing else gets
rebuilt.
That would be fine when it comes to classic shared library, but due to
the fact that the shared library is used by the compiler (just like a
gcc plugin or another compiler plugin) the result does not change only
based on the symbols, but also based on the implementation. Therefore
if the target in the dependency is a proc-macro crate, instead of
depending on the symbols file, depend on the shared object filename.
With this change, when a macro implementation changes in a proc-macro
crate, all crates using that macro will be rebuilt.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
|
|
If a depedency includes object files, they have to be added to the doctest.
However, NinjaBackend was not running flatten_object_list on the doctest.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
backends.py has an interesting idiom for keeping the unique
elements of a list. This is much faster than OrderedSet:
* dict.fromkeys() vs. OrderedSet.__init__(): 35% faster on Python
3.13, 50-60% faster on Python 3.10
* list(d) (d is a dict) vs. list(os) (os is an OrderedSet): up to
25% faster on Python 3.13, up to 15% faster on Python 3.10
though it tapers out after a few hundred elements.
Add a function to mesonlib to encapsulate this idiom.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
this fixes the "frameworks: 15 llvm" tests with llvm 21.1
|
|
Add `extra_paths` to cache keys for `PkgConfigInterface`
and `PkgConfigCLI` instances, to avoid incorrectly reusing an instance
with a different `extra_paths` value, see:
https://github.com/mesonbuild/meson/pull/14657#discussion_r2320623799
Signed-off-by: Michał Górny <mgorny@quansight.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This reverts commit 9b1eb8b8ed434d1c2fdca0d8ac46b79c9b91bb0f.
It is not needed anymore since the pre-1.8 semantics were the
good ones.
Only leave in place the new and clearer testcase names.
|
|
This reverts commit 5ab871be5287aa5cce1e8dfdfb7c4a6b07b4f2f7.
It is not needed anymore since the pre-1.8 semantics were the
good ones.
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
The option refactor (https://github.com/mesonbuild/meson/pull/14251) required
False as argument in order for get_user_option_args to work as intended. This
commit removes this argument again.
Signed-off-by: Stephan Lachnit <stephanlachnit@debian.org>
|
|
Added in #14750 for 1.9.0.
Also add FeatureNew.
|
|
If a subproject had its SubprojectHolder created, but was disabled, its options were not
parsed; therefore the subproject should not be checked for unknown options.
Fixes: #14969
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
ccache has been for a long time compatible with MSVC (since 4.6)
but when using debug mode, the /Z7 flag must be passed instead of
/Zi.
See https://ccache.dev/releasenotes.html#_ccache_4_6
|
|
|
|
The subject of this sentence is the plural "design goals",
and the verb must much the pluralism of the subject.
|
|
Fixes: https://github.com/mesonbuild/meson/issues/14984
|
|
|
|
Since http://mesonbuild.com redirects to https://mesonbuild.com anyway,
use https directly in documentation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Analogous to keys(), this returns the values in an array. It uses the
same sorting as keys(), else it would quite confusing to return values
in a different order than the corresponding keys.
|
|
|
|
.wraplock is nice to have, but prevents Meson from operating on a
read-only source directory.
If the source directory is read-only, there is no possible conflict
so in that case it is acceptable to return without any actual locking.
Fixes: #14948
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
Signed-off-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Michał Górny <mgorny@quansight.com>
|
|
Fixes: #14955
Fixes: 37f7572ce15494654128184777b16ece38308b9a
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Fixes: #14956
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Can be tested with adding -stdlib=libc++ to C++ flags.
In file included from /usr/include/c++/v1/stdio.h:93:
In file included from /usr/include/c++/v1/__config:14:
In file included from /usr/include/c++/v1/__configuration/abi.h:15:
/usr/include/c++/v1/__configuration/platform.h:35:7: error: function-like macro '__has_include' is not defined
35 | # if __has_include(<features.h>)
| ^
/usr/include/c++/v1/__configuration/platform.h:48:5: error: function-like macro '__has_include' is not defined
48 | #if __has_include(<picolibc.h>)
| ^
1 warning and 2 errors generated.
'
|
|
|
|
--crate-type is accepted by recent versions of rustdoc, but it
is not used by it and not listed in the documentation[1].
Remove it for compatibility with old versions of Rust.
[1] https://doc.rust-lang.org/rustdoc/command-line-arguments.html
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
Force multiline arguments when there is a trailing comma.
This is the behavior of muon.
Fixes #14721.
|
|
The group_arg_value option allow to put --key and its value on the
same line on multiline arguments. However, when the options is
`--`, it is an argument separator, and should not be grouped with
the following argument.
|