Commit Graph

7469 Commits

Author SHA1 Message Date
Ben Brown 20ac070fca Fix typo in comment 2022-04-14 14:43:50 -04:00
Xavier Claessens c649a2b8c5 wayland: Make sure wayland-scanner has same version as wayland libraries 2022-04-13 21:40:59 +03:00
Eli Schwartz a0e7f93414 compilers: fix broken CompCert support for release flags
This has been broken ever since the original implementation. Due to a
typo, the optimization flag used a zero instead of an uppercase "o",
which the compiler then breaks on during argument parsing because it is
an invalid argument.

Fixes #10267
2022-04-13 21:11:09 +03:00
Xavier Claessens 3180c579f6 mconf: Fix printing <inherited from main project> for yielding options
In print_options() k was a string instead of OptionKey, but
self.yielding_options expects OptionKey. Not sure how this has not been
catched by mypy.

Fix by keeping k as OptionKey which makes self.yielding_options useless.

Fixes: #9503
2022-04-13 21:10:32 +03:00
Eli Schwartz d68a0651e4
qt module: also prefer the changed name scheme for the tools
Although Qt6 has decided these are "internal" commands and should never
be run directly, so they don't get symlinked to /usr/bin at all, and are
only available in the qt_dep.bindir anyway.

But, the general naming pattern should be followed on principle.
2022-04-12 20:44:51 -04:00
Eli Schwartz b5a81ff634
qt dependency: adapt to the qmake command changed name
Qt now has official guidance for the symlinked names of the tools, which
is great.

Qt now officially calls the tools `fooX` instead of `foo-qtX` where the
major version of Qt is X. Which is not great, because a bit of an
unofficial standard had prior art and now needs to change, and we never
adapted.

Prefer the official name whenever looking up qmake, and in the
testsuite, specifically look only for the official name on versions of
qt which we know should have that.
2022-04-12 20:44:07 -04:00
Eli Schwartz e223136b10
qt dependency: find the correct -qtX configtool name
Fixes regression in commit c211fea513. The
original dependency lookup looked for `qmake-{self.name}`, i.e.
`qmake-qt5`, but when porting to config-tool, it got switched to
`qmake-{self.qtname}` i.e. `qmake-Qt6`, which was bogus and never
worked. As a result, if `qmake-qt5` and `qmake` both existed, and the
latter was NOT qt5, it would only try the less preferred name, and then
fail.

We need to define self.name early enough to define the configtool names,
which means we need to set it before running the configtool __init__()
even though configtool/pkgconfig would also set it to the same value.

Mark the tests as passing on two distros that were failing to detect
qmake due to this issue, and were marked for skipping because we assumed
that the CI skipping there was an expected case rather than an old
regression.
2022-04-12 20:44:07 -04:00
John Lindgren a606ce22eb Add support for Qt 6.1+
Qt 6.1 moved the location of some binaries from QT_HOST_BINS to
QT_HOST_LIBEXECS as noted in the changelog:

c515ee178f Move build tools to libexec instead of the bin dir
- Tools that are called by the build system and are unlikely to be
called by the user are now installed to the libexec directory.

https://code.qt.io/cgit/qt/qtreleasenotes.git/tree/qt/6.1.0/release-note.txt

It's possible to help the 'qt' module find the tools by adding Qt's
libexec directory to the PATH environment variable, but this manual
workaround is not ideal.

To compensate, meson now needs to look for moc, rcc, uic, etc. in
QT_HOST_LIBEXECS as well as QT_HOST_BINS.

Co-authored-by: Stefan Hajnoczi <stefanha@jammr.net>
2022-04-12 20:42:42 -04:00
Daniel Mensinger 589600cb51 cmake: Always use all compilers for LLVM (fixes #10249) 2022-04-12 18:25:38 -04:00
Matti Picus 73fa3aad43 python module: windows dll name for pypy needs special casing 2022-04-12 06:58:04 -04:00
Eli Schwartz 1420d0dace
mdist: use better approach to finding original configured options
Instead of reading intro-buildoptions.json, a giant json file containing
every option ever + its current value, use the private file that is
internally used by msetup for e.g. --wipe to restore settings.

This accurately tracks exactly the options specified on the command
line, and avoids lengthy summary messages containing all the overridden
defaults.

It also avoids passing potentially incompatible options, such as
explictly specifying -Dpython.install_env while also having a non-empty
-Dpython.{x}libdir

Fixes #10181
2022-04-11 14:10:59 -04:00
Jussi Pakkanen 3c80f8f965 Use a temp file to invoke the introspection command.
This is more reliable as '-c' can, for example, exhaust
the maximum command line length.
2022-04-10 17:13:51 +03:00
Eli Schwartz d27fd555e8 python module: restore logging for broken python
This check was erroneously removed in commit c5c02b72e1
2022-04-10 15:17:22 +03:00
Eli Schwartz e5aa47d8af Revert "wayland: Also lookup scanner in pkgconfig"
This reverts commit 7954a4c9cb.
2022-04-07 23:44:34 -04:00
Xavier Claessens 7954a4c9cb wayland: Also lookup scanner in pkgconfig
This moves generally useful logic from GNOME module's
_get_native_binary() into find_program() implementation. We could decide
later to expose it as public API.
2022-04-04 09:17:34 -04:00
Daniel Mensinger 4dd6cb8469 cmake: Better error message when configuring a CMake subproject fails. 2022-04-03 12:04:21 -04:00
Christoph Reiter 26903d7b12 main: Make the msys/python check work again, in some cases
msys/python in MSYS2 pretends to be cygwin in all cases for some time
now, so this check was impossible to hit.

The underlying confusion it tried to prevent is still there, namely trying
to build with mingw but wrongly using a msys/cygwin python/meson.

We can use the MSYSTEM env var to detect if we are in a mingw shell, and
in case the Python doesn't match we suggest installing mingw variants of both
python and meson.

Using msys/python + meson in a MSYS environment works fine on the other hand,
so no need to error out in that case.

Fixes #8726

Also addresses the concern raised in
https://github.com/mesonbuild/meson/issues/3653#issuecomment-474122564
2022-04-01 13:15:33 -04:00
Eli Schwartz fdcc566590
i18n: don't let our maintainer targets run via wrapped env
They are RunTargets because they are one-shot commands without outputs.
But we implement them purely via our internal wrapper for gettext, so
there is no reason to wrap them *again* in our internal wrapper for
meson_exe and set a bunch of environment variables we know we absolutely
do not need, use, or want.

This avoids the ugly "wrapped due to env" status, and allows users to
directly see the command being run without going into despair at obscure
pickled nonsense.

It also offers a tiny defense against upgrading Meson without
reconfiguring. People should not do that, and we error out about this in
a bunch of places, but `--internal gettext` has a perfectly stable
interface just like most build tools that aren't part of Meson
internals, since it uses command line arguments instead of pickling.
2022-03-31 22:52:31 -04:00
Eli Schwartz 8ae2bf5a9e
allow RunTarget to skip wrapping due to env
Forcing serialization on when writing out the build rule makes very
little sense. It was always "forced" on because we mandated a couple of
environment variables due to legacy reasons.

Add an attribute to RunTarget to say that a given target doesn't *need*
those environment variables, and let ninja optimize them away and run
the command directly if set.
2022-03-31 22:52:31 -04:00
Jussi Pakkanen a7356f6bf2 Handle same Framework multiple times in Xcode. 2022-03-31 21:30:16 -04:00
Jussi Pakkanen 6f24ab9407 Handle feed and capture in xcodebackend. 2022-03-31 21:30:16 -04:00
Eli Schwartz 1cfead6647
fix continued breakage in gnome module API
In commit 823da39909 we tried to fix
disappearing dependencies. Instead, we appended the replacement
dependencies to the existing ones. But this, too, was wrong. The
function doesn't return new dependencies... it returns a copied list
of all the dependencies, then alone of all parts of that API, expects to
overwrite the existing variable.

(Sadly, part of the internals actually uses the entire list for
something.)

As a result, we produced a repeatedly growing list, which eventually
scaled really badly and e.g. OOMed on gstreamer.

Instead, let's just replace the dependencies with the updated copy.
2022-03-31 14:50:27 -04:00
Jussi Pakkanen efc7604ca2
Merge pull request #9989 from ePirat/epirat-fix-uscore-prefix-detection
Fix underscore detection
2022-03-31 16:26:22 +03:00
Marvin Scholz 89620dc8e7 clike: print stderr instead of stdout for debugging
When something goes wrong with running the compiler in
_symbols_have_underscore_prefix_searchbin, print stderr instead,
as it actually contains helpful output while stdout is usually empty
in this case.
2022-03-31 10:55:55 +02:00
Marvin Scholz 1b03441bc4 visualstudio: do not query underscore define with MSVC
MSVC does not has the builtin define to check for the symbol
prefix, so do not try to query it at all, to save some time.
2022-03-31 10:55:55 +02:00
Marvin Scholz f02ffc007c clike: add more reliable ways to check underscore prefix
Fix #5482
2022-03-31 10:55:55 +02:00
Marvin Scholz 4b97c60650 compilers/gnu: use Popen_safe to prevent resource leaks
Fixes the following ResourceWarnings:

ResourceWarning: subprocess 25556 is still running
  _warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback

mesonbuild/compilers/mixins/gnu.py:195: ResourceWarning: unclosed file <_io.BufferedReader name=4>
  return gnulike_default_include_dirs(tuple(self.exelist), self.language).copy()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
2022-03-30 16:04:23 -04:00
Jussi Pakkanen be63e77949 Fix typos in Xcode backend. 2022-03-30 22:32:55 +03:00
Marvin Scholz 2cdddbab56 Add new debug() function
Adds a new debug() function that can be used in the meson.build to
log messages to the meson-log.txt that will not be printed to stdout
when configuring the project.
2022-03-30 06:57:30 -04:00
Elliott Sales de Andrade 969ae6e0e1 Correctly handle --version argument to runpython
Followup to #10204.
2022-03-29 21:57:46 -04:00
Eli Schwartz c9938f8f60
move a bunch of imports into TYPE_CHECKING blocks
These are only used for type checking, so don't bother importing them at
runtime.

Generally add future annotations at the same time, to make sure that
existing uses of these imports don't need to be quoted.
2022-03-29 16:44:54 -04:00
Xavier Claessens 05cfe756f1 Target: Stop passing environment in method args 2022-03-29 16:10:28 -04:00
Xavier Claessens 90310116ab Replace backend.get_option_for_target() with target.get_option()
That method had nothing specific to the backend, it's purely a Target
method. This allows to cache the OptionOverrideProxy object on the
Target instance instead of creating a new one for each option lookup.
2022-03-29 16:10:28 -04:00
Xavier Claessens e33ec88ac7 Pass environment down to base Target class 2022-03-29 16:10:28 -04:00
Tristan Partin d93fe56e89 Fix CMake deprecation warning generated from interpreter 2022-03-29 22:01:48 +03:00
Jan Tojnar b7686dfed5 gnome: Fix gtkdoc when using multiple Apple frameworks
The `-framework Foundation -framework CoreFoundation` ended up
de-duplicated by OrderedSet into `-framework Foundation CoreFoundation`.
2022-03-29 12:52:55 -04:00
Jan Tojnar 39623a36ca gnome: Fix typo in _get_dependencies_flags
This was introduced in 823da39909
2022-03-29 12:52:55 -04:00
Eli Schwartz 80192aa577
runpython: support --version
argparse is the gift that keeps on giving, hahaha. Suppress the script
argument when --version is specified to avoid "required argument not
provided" errors, and print the python version.

The version argument is required in order to make this baseline
functional as a resolved python for find_program, which may specify a
version and expect this to work with python itself. Our incomplete CLI
wrapper over the python CLI interface was missing this.

Fixes #10162
2022-03-29 01:26:18 -04:00
Eli Schwartz 823da39909
fix regression in propagating depends in gtkdoc
In commit 68e684d51f the function
signature was changed, but several places did not adapt. Additionally,
we now totally dropped the in-place update of gtkdoc's sole source of
dependencies, but didn't propagate them upward to assign the newly
collected dependencies anywhere.

Fixes building gtkdoc with internal dependencies and failing when
specified directly (when building the 'all' target with sufficiently
random parallelism, deps may be built on time).

Fixes:
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1008382
  https://gitlab.gnome.org/GNOME/libmediaart/-/issues/4
2022-03-28 23:33:28 -04:00
Eli Schwartz 479a84455f wrap: implement allow-insecure for 'meson wrap' 2022-03-27 18:57:07 -04:00
Eli Schwartz faafcc15e2 wrap: use shared function to connect to wrapdb with better errors
We currently inconsistently handle connection, `has_ssl`, and printing
errors on urlopen failure between `meson subprojects` and `meson wrap`.

Make the latter work more like the former.
2022-03-27 18:57:07 -04:00
Eli Schwartz b28e6aead4 wrap: add functionality to specify whether insecure downloads should be used
We have a fallback route in `meson subprojects download` and friends,
which tries to retrieve wrapdb urls via http, if Python was not built
with SSL support.

Stop doing this. Replace it with a command line option to specify that
insecure downloads are wanted, and reference it in the error message if
downloading fails due to SSL issues.
2022-03-27 18:57:07 -04:00
Marco Trevisan (Treviño) b0d300e788 install_symlink: Handle $DESTDIR case for links with absolute path
In case a link is pointing_to an absolute path and we are using $DESTDIR
we fail in case the target is missing.

This is incorrect because we may need to use an absolute path to an
already installed file that is in $DESTDIR.

So if an absolute target is not existing, check if we have such file in
$DESTDIR before failing for real.
2022-03-24 15:26:12 -04:00
Xavier Claessens b66a477bbc build.py: Simplify uses_rust()
There is no need to check all source files again, if there are .rs
sources then rust compiler is in self.compilers already.
2022-03-24 12:27:06 -04:00
Xavier Claessens c8c8aeef0f build.py: Simplify validate_sources()
There is no need to go through all sources again, we already did that to
populate self.compilers. When cs or java compilers are in the list, then
there must be only one compiler.

The code was also not considering generate sources any way.
2022-03-24 12:27:06 -04:00
Xavier Claessens f2d21bf8a9 Make compilers list per subproject
Previously subprojects inherited languages already added by main
project, or any previous subproject. This change to have a list of
compilers per interpreters, which means that if a subproject does not
add 'c' language  it won't be able to compile .c files any more, even if
main project added the 'c' language.

This delays processing list of compilers until the interpreter adds the
BuildTarget into its list of targets. That way the interpreter can add
missing languages instead of duplicating that logic into BuildTarget for
the cython case.
2022-03-24 12:27:06 -04:00
Xavier Claessens ebbe4425e7 Debian renamed cython to cython3, support both 2022-03-24 10:16:53 -04:00
Eli Schwartz c827462593
hotdoc module: use typed_pos_args to check positional arguments
We cannot use typed_kwargs though, because we allow fully arbitrary
kwargs and pass them as arguments to the hotdoc program.
2022-03-24 02:07:02 -04:00
Eli Schwartz 71a5db0a03
dub module: use typed_pos_args to check positional arguments
We cannot use typed_kwargs though, because we allow fully arbitrary
kwargs and add them as keys in the generated dub file.
2022-03-24 02:07:02 -04:00
Eli Schwartz 9c7868e343
python 3 module: type-check all posargs
Yes, it's deprecated, but we can still stop people doing the wrong thing
with it if they are still using it.
2022-03-24 02:07:02 -04:00