Since these aren't warnings, per se, we don't note every single call
site that has one. And we raise mlog.notice in non-fatal mode to avoid
either:
- being too threatening
- making builds fail with --fatal-meson-warnings
Nevertheless, it is useful to give people a heads-up that there is an
upgrade opportunity, rather than waiting until they upgrade and then
causing projects to begin printing fatal warnings.
mlog can already print location info, and we use this often -- including
for custom feature warnings already. Make this work everywhere, so that
it is feasible to move such custom warnings to globally tracked
Features.
This is only relevant on certain versions of meson, so do not print it
when meson_version is too low.
The message itself is not precisely a deprecation warning, since
ostensibly it may be an unlikely coding mistake. It is probably an
attempt to implement `copy: true`, but it might not be, hence "warning"
instead of "deprecation". So although we could switch this to a
FeatureDeprecated, that is not being done at this time.
We went straight to the extra message, which when parsed as a subproject
string resulted in the Feature being entirely skipped because "project()
has not been parsed yet" as it could not find a subproject named that.
Depending on whether hdf5 is compiled with parallel support, the
same config-tool program may be installed with a mysterious "p" in the
name. In this case, dependency lookup will totally fail, unless of
course you use the superior pkg-config interface in which case you get a
predictable name.
Work around this insanity by checking for both types of config-tool
name.
Fixes#9555
When input kwarg is missing in i18n.merge_file() it was crashing with a
backtrace because of kwargs['input'][0]. That code was useless anyway
because CustomTarget now uses first output as default name which is what
we need here.
While the horizontal line and the other pictograms in mtest have an ASCII-only
version, the spinner does not. This causes mtest to fail with a
UnicodeEncodeError exception on non-Unicode locales.
Fixes: #9538
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Virtualenvs do not have their Python DLLs etc in the `sys.prefix`
directory, but in the `sys.base_prefix` directory. This directory is
the same as `sys.prefix` if not in a virtualenv, so is safe for either
case:
https://docs.python.org/3/library/sys.html#sys.base_prefix
If the LTO threads == 0 clang will default to the same argument we
manually pass, which meant we dropped support for admittedly ancient
versions of clang that didn't yet add that option.
Drop the extraneous argument, and add a specific error condition when
too old versions of clang are detected.
Fixes#9569
Without this patch, the name of the RunTarget is passed to the
install script; for the enclosed test, meson setup (incorrectly)
succeeds, but installation fails.
Fixes the following error in the testcase:
File "/usr/lib/python3.10/site-packages/mesonbuild/backend/ninjabackend.py", line 548, in generate
self.generate_tests()
File "/usr/lib/python3.10/site-packages/mesonbuild/backend/ninjabackend.py", line 1093, in generate_tests
self.serialize_tests()
File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 567, in serialize_tests
self.write_test_file(datafile)
File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 943, in write_test_file
self.write_test_serialisation(self.build.get_tests(), datafile)
File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 1017, in write_test_serialisation
pickle.dump(self.create_test_serialisation(tests), datafile)
File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 1002, in create_test_serialisation
cmd_args.append(self.construct_target_rel_path(a, t.workdir))
File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 1021, in construct_target_rel_path
return self.get_target_filename(a)
File "/usr/lib/python3.10/site-packages/mesonbuild/backend/backends.py", line 253, in get_target_filename
assert(isinstance(t, build.BuildTarget))
We currently enable this only for rcc (where this really really matters)
but it can often matter for moc as well, and is just generally more
correct.
Really, this should have been added in #7451 too, but I neglected it
since the module warned about inaccurate dependencies only for rcc...
When installing with 'meson install --quiet' I'd get the following output:
This file does not have an rpath.
This file does not have a runpath.
(It turns out that of the couple hundred of binaries that are installed,
this message was generated for /usr/lib/systemd/boot/efi/linuxx64.elf.stub.)
There doesn't seem to be any good reason for this output by default. But those
functions can still be used for debugging. Under a debugger, returning the
string is just as useful as printing it, but more flexible. So let's suppress
printing of anything by default, but keep the extractor functions.
The code was somewhat inconsistent wrt. to when .decode() was done. But it
seems that we'll get can expect a decodable text string in all cases, so
just call .decode() everywhere, because it's nicer to print decoded strings.
This removes the `packages` keyword argument, which was added in
80d665e8de, but beyond not warning about
unknown arguments has never done anything, and has never been
documented. The only users I could find were in our own test suite. If
someone is using this we can add it back with a deprecation warning.
String formatting should validly assume that printing a list means
printing the list itself. Instead, something like this broke:
'one is: @0@ and two is: @1@'.format(['foo', 'bar'], ['baz'])
which would evaluate as:
'one is: foo and two is: bar'
or:
'the value of array option foobar is: @0@'.format(get_option('foobar'))
which should evaluate with '-Dfoobar=[]' as
'the value of array option foobar is: []'
But instead produced:
meson.build:7:0: ERROR: Format placeholder @0@ out of range.
Fixes#9530
It's supposed to emit an error message, but instead it did a traceback.
It used to be, if no install_dir was specified then it was simply not in
kwargs, but due to typed_kwargs it will now be there, but not have
viable contents, so the dict membership check got skipped.
Fixes#9522
Since 0.59.0 Meson downloads multiple wraps in parallel, so the
packagecache directory could be created by one then the 2nd would hit
error when calling os.mkdir() because it already exists.
fixes#6314
in case of backend is vs2017 or vs2019 place LanguageStandard tag with stdcpp version and LanguageStandard_C tag with stdc version in .vcxproj file
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
Python is a whitespace significant language, changing indent level
implies that scope is changing. So when a string like
```python
def foo():
a = '''
somthing
'''
return a
```
It's visually misleading. Couple that with folding editors like vim
getting utterly confused by this, and it turns into a real pain. Using
textwrap.dedent allows us to get rid of that:
```python
def foo():
a = texwrap.dedent(
'''
something
''')
return a
```
But we still get the same result