Commit Graph

11897 Commits

Author SHA1 Message Date
Chris Lamb 958b1a7fb4 Make the generated reproducible .cmake files reproducible.
Whilst working on the Reproducible Builds effort [0], I noticed that meson did
not generate reproducible .cmake files: they include the full path name.

This commit not only makes the build reproducible, but it also matches CMake's
own behaviour. Specifically, CMakePackageConfigHelpers.cmake does the
equivalent transformation using:

    get_filename_component(inputFileName "${_inputFile}" NAME)

I originally filed this in Debian as bug #1000327 [1].

 [0] https://reproducible-builds.org/
 [1] https://bugs.debian.org/1000327
2021-11-21 14:38:33 -05:00
Crend King 809792c223 Support Visual Studio 2022 backend 2021-11-21 08:08:11 -05:00
GustavoLCR 5924510188 Run pylint 2021-11-21 01:42:02 -05:00
GustavoLCR 2771e352bd Fix vs backend cross compilation regression 2021-11-21 01:42:02 -05:00
Dudemanguy e67c07c006 dependencies/zlib: Allow for generic OS checks
Contrary to most system method checks, zlib currently functions as a
whitelist of OSes. This isn't really needed however. The first special
case for OSes that provide zlib as part of the base OS is worth keeping.
However, the elif for windows is more than generic enough to allow any
other potential OSes to try. Just make it a simplie if/else instead.
2021-11-20 23:54:33 -05:00
Eli Schwartz fae7a70292
FeatureDeprecated: add a notice summary of future deprecations
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.
2021-11-20 20:48:30 -05:00
Eli Schwartz 32821be623
add location nodes to some Feature calls 2021-11-20 20:48:30 -05:00
Eli Schwartz 8dbb0ee476
Feature kwargs decorator: automatically report the nodes which trigger an issue 2021-11-20 20:48:30 -05:00
Eli Schwartz 7a033c7887
add location support to feature checks
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-20 20:48:29 -05:00
Eli Schwartz 329783d80c
guard a complicated mlog.warning inside a Feature check
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-20 20:48:29 -05:00
Eli Schwartz dbb109703e
convert more mlog.deprecation into FeatureDeprecated 2021-11-20 20:48:29 -05:00
Eli Schwartz 4a65f3dead
fix missing subproject kwarg to FeatureDeprecated
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-20 20:48:29 -05:00
Jon Turney 61ca56422b cmake: Use find_library() on bare library names in cmake dependencies
Convert bare library names to a dependency linker argument using
find_library(), rather than hardcoding the MSVC transformation.
2021-11-20 08:29:50 -08:00
Jon Turney 987a26e9e1 Update expected skip condition for llvm framework test on msys2
On msys2, we will now find static llvm using cmake
2021-11-20 08:29:50 -08:00
Dylan Baker cc8018744d tests: replace python2 framework with metal
The bundled python is deprecated, metal is unlikely to be deprecated any
time soon, so let's use that.
2021-11-18 16:55:14 -05:00
Dylan Baker 89c133b3db tests: remove extraframework test for python
This tries to link the system provided python, which is deprecated and
will result in an ambiguous error like "your binary is not an allowed
client of .../Library/Frameworks/python.framework/python.tbd for
architecture x86_64".
2021-11-18 16:55:14 -05:00
Eli Schwartz 4f4259de1b hdf5 dependency: check for alternative config-tool names
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-17 23:07:14 +02:00
Xavier Claessens 018d928cf5 i18n: Fix backtrace when missing input kwarg
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-16 23:35:46 -05:00
Alberto Fanjul 05e0712f59 Add vala template 2021-11-16 22:25:14 -05:00
Jussi Pakkanen 4c62dab611
MSI generator fixes 2021-11-17 00:44:29 +02:00
William Toohey 679adc7bf5 Support ancient (<3.4.0) gcc versions 2021-11-16 06:45:33 -05:00
Paolo Bonzini 83f8b7c1b1 mtest: add an ASCII-only version of the spinner
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-16 01:54:33 +02:00
Dylan Baker 40a8a3f8fe modules/gnome: fix warning message that will always fire
`typed_pos_args` ensures that the length of args is always true.
2021-11-16 01:20:03 +02:00
Dylan Baker aaac5538bf modules/gnome: Add back deprecation message
This looks like it was probably removed in a bad rebase
2021-11-16 01:20:03 +02:00
Matthew Brett bd5e520672 Fix to find Python files for Windows virtualenvs
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-15 23:20:48 +02:00
Jussi Pakkanen cad109607d
Merge pull request #9520 from dcbaker/submit/gnome-first-typed-kwargs
Add typed_kwargs to some of the gnome module functions
2021-11-15 22:07:03 +02:00
Eli Schwartz ee5428d64f only pass clang LTO arguments when they are needed
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-15 22:00:53 +02:00
Jussi Pakkanen 5b08fd4b33
Merge pull request #9565 from bonzini/invalid-run-target
reject run_target in test or install script arguments
2021-11-15 22:00:21 +02:00
Dudemanguy a4b4b21908 dependencies/zlib: Add system zlib method for android
The same method that the BSDs use should also work for android. Also
update the tests and docs where appropriate.
2021-11-15 12:40:00 -05:00
Paolo Bonzini 9a8c2d23f1 interpreter: disallow RunTarget in meson.add_install_script
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-15 11:33:00 +01:00
Paolo Bonzini 36c390e08e interpreter: disallow RunTarget in test
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-15 11:32:59 +01:00
Eli Schwartz 680c6bb012 valac dependencies: use the canonical list of vala source names
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-15 15:43:43 +05:30
Dudemanguy f873b9ae2f Users.md: add mpv 2021-11-14 23:01:26 -05:00
Yasushi SHOJI dbd1e154ab interpreter: Fix a typo
This is a trivial typo.  Fix projeccts to projects.

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
2021-11-14 15:16:54 -05:00
Xavier Claessens 364d951b34 Share common code between clang tidy and format 2021-11-14 22:07:17 +02:00
Nathanael Gray ae3d495c37 Remove incorrect arguments for C2000 C++ compiler. Add correct form for output and include args. 2021-11-14 21:59:59 +02:00
Eli Schwartz 0bc0905210
qt module: add depfile support to moc as well
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-13 23:28:59 -05:00
Eli Schwartz 39ceb67774 docs: fix refman 2.0 regression in correctly describing find_library(has_headers)
All kwargs inherited from has_header need to be prefixed `header_` so we
cannot just do straight inheritance. And the part of the description
that highlighted the way kwargs are derived and evolved, went entirely
missing.

Fixes #9551
2021-11-09 16:59:36 -08:00
Eli Schwartz 4029705cf3 docs: fix some spelling typos 2021-11-09 16:59:36 -08:00
Jussi Pakkanen 96d243ac75 Delete ghwt.py as it is no longer needed or even works. 2021-11-09 14:23:54 -08:00
Jussi Pakkanen 4c1c605c57
Merge pull request #9396 from keszybz/drop-unused-and-unnecessary-printing-code
depfixer: drop unused and unnecessary printing code
2021-11-09 18:52:23 +02:00
Xavier Claessens 898bf6e518 python: Better detect when install path is not in sys.path
Using pathlib ensure propre platform specific path handling, such as
case sensitivity.
2021-11-09 18:49:03 +02:00
Zbigniew Jędrzejewski-Szmek 7a5eb6f9aa depfixer: always print the file name in messages
The messages are not useful unless we know what file they are about.
2021-11-09 10:50:59 +01:00
Zbigniew Jędrzejewski-Szmek c2f1d91b8a depfixer: convert unused printing code to debugging functions
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-09 10:50:59 +01:00
Zbigniew Jędrzejewski-Szmek da522efc93 depfixer: f-strings 2021-11-09 10:47:21 +01:00
Dylan Baker f48d75dcae compilers/java: Add no_warn_args and debug_args methods 2021-11-08 23:33:14 +02:00
Dylan Baker ef52e60936 modules/gnome: use typed_kwargs for gdbus_codegen 2021-11-08 12:39:38 -08:00
Dylan Baker 566c2c9a9c modules/gnome: use typed_kwargs for gtkdoc method 2021-11-08 12:29:01 -08:00
Dylan Baker be1d013453 modules/gnome: use typed_kwargs for generate_gir
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.
2021-11-08 12:29:01 -08:00
Dylan Baker 6137c21eb6 modules/gnome: use typed_kwargs for compile_resources 2021-11-08 12:29:01 -08:00