aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2021-11-20Feature kwargs decorator: automatically report the nodes which trigger an issueEli Schwartz1-9/+11
2021-11-20add location support to feature checksEli Schwartz1-11/+14
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.
2021-11-20guard a complicated mlog.warning inside a Feature checkEli Schwartz1-4/+6
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.
2021-11-20convert more mlog.deprecation into FeatureDeprecatedEli Schwartz2-3/+5
2021-11-20fix missing subproject kwarg to FeatureDeprecatedEli Schwartz1-1/+2
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.
2021-11-20cmake: Use find_library() on bare library names in cmake dependenciesJon Turney1-6/+4
Convert bare library names to a dependency linker argument using find_library(), rather than hardcoding the MSVC transformation.
2021-11-17hdf5 dependency: check for alternative config-tool namesEli Schwartz1-3/+3
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
2021-11-16i18n: Fix backtrace when missing input kwargXavier Claessens1-21/+1
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.
2021-11-16Add vala templateAlberto Fanjul4-5/+134
2021-11-16Support ancient (<3.4.0) gcc versionsWilliam Toohey1-1/+4
2021-11-16mtest: add an ASCII-only version of the spinnerPaolo Bonzini1-4/+7
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>
2021-11-16modules/gnome: fix warning message that will always fireDylan Baker1-3/+2
`typed_pos_args` ensures that the length of args is always true.
2021-11-16modules/gnome: Add back deprecation messageDylan Baker1-0/+2
This looks like it was probably removed in a bad rebase
2021-11-15Fix to find Python files for Windows virtualenvsMatthew Brett1-2/+6
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
2021-11-15Merge pull request #9520 from dcbaker/submit/gnome-first-typed-kwargsJussi Pakkanen1-371/+388
Add typed_kwargs to some of the gnome module functions
2021-11-15only pass clang LTO arguments when they are neededEli Schwartz1-2/+4
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
2021-11-15Merge pull request #9565 from bonzini/invalid-run-targetJussi Pakkanen2-6/+6
reject run_target in test or install script arguments
2021-11-15dependencies/zlib: Add system zlib method for androidDudemanguy1-2/+2
The same method that the BSDs use should also work for android. Also update the tests and docs where appropriate.
2021-11-15interpreter: disallow RunTarget in meson.add_install_scriptPaolo Bonzini1-5/+5
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.
2021-11-15interpreter: disallow RunTarget in testPaolo Bonzini1-1/+1
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))
2021-11-15valac dependencies: use the canonical list of vala source namesEli Schwartz1-1/+1
Don't hardcode one of the three possible source types, thus ignoring the needed vapis for dependencies using .gs or .vapi sources. Fixes #9544
2021-11-14interpreter: Fix a typoYasushi SHOJI1-1/+1
This is a trivial typo. Fix projeccts to projects. Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
2021-11-14Share common code between clang tidy and formatXavier Claessens3-89/+84
2021-11-14Remove incorrect arguments for C2000 C++ compiler. Add correct form for ↵Nathanael Gray1-12/+13
output and include args.
2021-11-13qt module: add depfile support to moc as wellEli Schwartz1-1/+11
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...
2021-11-09Merge pull request #9396 from keszybz/drop-unused-and-unnecessary-printing-codeJussi Pakkanen2-40/+41
depfixer: drop unused and unnecessary printing code
2021-11-09python: Better detect when install path is not in sys.pathXavier Claessens1-9/+12
Using pathlib ensure propre platform specific path handling, such as case sensitivity.
2021-11-09depfixer: always print the file name in messagesZbigniew Jędrzejewski-Szmek1-6/+6
The messages are not useful unless we know what file they are about.
2021-11-09depfixer: convert unused printing code to debugging functionsZbigniew Jędrzejewski-Szmek2-31/+32
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.
2021-11-09depfixer: f-stringsZbigniew Jędrzejewski-Szmek1-3/+3
2021-11-08compilers/java: Add no_warn_args and debug_args methodsDylan Baker1-0/+8
2021-11-08modules/gnome: use typed_kwargs for gdbus_codegenDylan Baker1-51/+70
2021-11-08modules/gnome: use typed_kwargs for gtkdoc methodDylan Baker1-113/+121
2021-11-08modules/gnome: use typed_kwargs for generate_girDylan Baker1-142/+95
This removes the `packages` keyword argument, which was added in 80d665e8decd644d737930d450f0bc66d6b5b02c, 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.
2021-11-08modules/gnome: use typed_kwargs for compile_resourcesDylan Baker1-35/+61
2021-11-08modules/gnome: use typed_kwargs for yelpDylan Baker1-25/+26
2021-11-08modules/gnome: use typed_kwargs for compile_schemasDylan Baker1-9/+19
2021-11-04fix regression that broke string.format with list objectsEli Schwartz1-0/+2
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
2021-11-02fix custom_target with install: true and no install_dir, crashingEli Schwartz1-1/+1
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
2021-11-02wrap: Fix concurrent os.mkdir()Xavier Claessens1-2/+1
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.
2021-11-02python.dependency(): Do not stop when first candidate is not foundXavier Claessens1-3/+4
It has to lookup the dependency with required=False otherwise it raises an exception when the first candidate (pkg-config) failed.
2021-11-02Move language standard in separate method within vsbackendMoroz Oleg3-9/+24
2021-11-02Fixes .vcxproj for vs2017 vs2019Олег Мороз1-0/+9
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
2021-11-01various manual conversion of percent-formatted strings to f-stringsEli Schwartz14-90/+80
2021-11-01fix broken error message that printed formatter codesEli Schwartz1-1/+1
This was probably supposed to be percent-formatted but got typoed to a comma instead. Rewrite as an f-string.
2021-11-01fix typoed vs backend tokenEli Schwartz1-1/+1
2021-11-01coverage generator: obey the documentation and only generate supported outputsEli Schwartz3-36/+44
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
2021-11-01modules/gnome: don't use dict.keys() to test membershipDylan Baker1-2/+2
This is slower than looking in the dictionary, as the dict lookup is O(log n), while keys() is O(n).
2021-11-01modules/gnome: use textwrap.dedentDylan Baker1-35/+44
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
2021-11-01modules/gnome: use envconfig for VAPIGENDylan Baker2-4/+2
we have a mechanism for doing "this could be an environment variable" let's use that.