Age | Commit message (Collapse) | Author | Files | Lines |
|
Closes: #3700.
|
|
ERROR is reserved for non-zero exit codes. People will probably get
confused.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Split FeatureNew and FeatureDeprecated
Implement features report to be printed in some 'dev mode'
|
|
* store target version
* Add empty method decorator
|
|
|
|
|
|
Adds "has_key" and "get".
Adapted and updated by Mathieu Duponchelle <mathieu@centricular.com>
|
|
For now dicts are immutable, and do not expose any methods,
they however support "native" syntax such as [] lookup,
and foreach iterating, and can be printed.
|
|
this fixes eg set_variable('foo', ['bar', 'baz']), which
was previously erroring out complaining about the number
of arguments.
Closes #1481
|
|
|
|
|
|
|
|
$ flake8
./mesonbuild/interpreterbase.py:411:13: F821 undefined name 'set_variable'
This looks like an actual bug which would affect disabler use :)
|
|
This can help future generations avoid mistakes like this:
https://github.com/xkbcommon/libxkbcommon/commit/edb1c662394578a54b7bbed231d918925e5d8150
To avoid breaking builds, this is currently just an error. After
sufficient time has passed this can hopefully become a hard error,
similarly to the already-existing `permittedKwargs` warnings.
|
|
|
|
Since PR #2884, this is failing with an exception
Keep the behaviour we have had since PR #1810 (0.41.0), that ordering
comparisons of different types fail with an InterpreterException.
Also warn about equality comparisons of different types, which will one day
become an error, as per PR #2884.
|
|
|
|
Examples:
meson.build:2:0: ERROR: Dependency is both required and not-found
meson.build:4: WARNING: Keyword argument "link_with" defined multiple times.
These are already matched by the default compilation-error-regexp-alist in
emacs.
Also:
Don't start 'red' markup until after the \n before an error
Unabsorb full-stop at end of warning with location from mlog.warning()
Update warning_location test
|
|
This already reports the location (in a slightly different format), but
using mlog.warning() will make it easier if we want to change the location
format in future.
|
|
|
|
The int's to_string method implementation has been reduced to base
10.
|
|
Although some other base types like boolean objects can be expresed
as strings, this is not possible with int objects.
This patch adds support to express int values as strings as hex,
decimal or octal values.
|
|
This allows a CustomTarget to be indexed, and the resulting indexed
value (a CustomTargetIndex type), to be used as a source in other
targets. This will confer a dependency on the original target, but only
inserts the source file returning by index the original target's
outputs. This can allow a CustomTarget that creates both a header and a
code file to have it's outputs split, for example.
Fixes #1470
|
|
All the specified characters in the specified argument will be
stripped. If unspecified, the old behaviour is used.
Includes tests.
|
|
|
|
#2181.
|
|
Do not pickle interpreter objects by accident
|
|
I got this warning on a build:
> WARNING: Passed invalid keyword argument preset. This will become a hard error in the future.
I had to grep in meson code to understand that "preset" was the name of
the invalid argument. This is not obvious at all depending on the
argument name (here it looked like it was about argument presets).
Let's make it clearer by putting it in quotes.
|
|
copies of kwargs.
|
|
|
|
|
|
|
|
|
|
|
|
The result of this method is always a "native" object, and code coverage
(plus a manual inspection) shows that this conversion is never done.
|
|
Meson has a common pattern of using 'if len(foo) == 0:' or
'if len(foo) != 0:', however, this is a common anti-pattern in python.
Instead tests for emptiness/non-emptiness should be done with a simple
'if foo:' or 'if not foo:'
Consider the following:
>>> import timeit
>>> timeit.timeit('if len([]) == 0: pass')
0.10730923599840025
>>> timeit.timeit('if not []: pass')
0.030033907998586074
>>> timeit.timeit('if len(['a', 'b', 'c', 'd']) == 0: pass')
0.1154778649979562
>>> timeit.timeit("if not ['a', 'b', 'c', 'd']: pass")
0.08259823200205574
>>> timeit.timeit('if len("") == 0: pass')
0.089759664999292
>>> timeit.timeit('if not "": pass')
0.02340641999762738
>>> timeit.timeit('if len("foo") == 0: pass')
0.08848102600313723
>>> timeit.timeit('if not "foo": pass')
0.04032287199879647
And for the one additional case of 'if len(foo.strip()) == 0', which can
be replaced with 'if not foo.isspace()'
>>> timeit.timeit('if len(" ".strip()) == 0: pass')
0.15294511600222904
>>> timeit.timeit('if " ".isspace(): pass')
0.09413968399894657
>>> timeit.timeit('if len(" abc".strip()) == 0: pass')
0.2023209120015963
>>> timeit.timeit('if " abc".isspace(): pass')
0.09571301700270851
In other words, it's always a win to not use len(), when you don't
actually want to check the length.
|
|
To reproduce, one could write:
foo = files('foo.c')
foo[0].path()
and get:
Traceback (most recent call last):
[snip]
File "/home/trhd/Projects/meson/mesonbuild/interpreterbase.py", line 398, in method_call
raise InvalidArguments('Variable "%s" is not callable.' % object_name)
UnboundLocalError: local variable 'object_name' referenced before assignment
Fix this by handling file objects separately.
|
|
If the index is out of range, the fallback value is used. Includes
a test.
Closes #1337
|
|
|
|
|
|
|
|
|
|
E225: missing whitespace around operator
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|