Commit Graph

13019 Commits

Author SHA1 Message Date
Jussi Pakkanen 46acd6cd4a
Merge pull request #8941 from xclaesse/wrapdb
Automatically use WrapDB fallback
2022-10-10 22:17:00 +03:00
Xavier Claessens 8c3a87847e Document and test new WrapDB auto fallback 2022-10-10 12:47:32 -04:00
Xavier Claessens 39d825fabf Get fallback varname from wrap file after it has been configured
When _subproject_impl() is called the wrap file could not have been
downloaded form wrapdb yet, it is done when fetching the subproject.
Delay getting the variable name to when we actually need it, at that
point we are sure the wrap file has been downloaded.
2022-10-09 13:04:04 -04:00
Xavier Claessens ced9efb579 Get wrap from wrapdb when not found locally
Download wrap file from wrapdb automatically when it is not found
locally but we have it in wrapdb.json.

This makes for example `dependency('glib-2.0')` work out of the box
simply by running `meson wrap update-db`, even if the project does not
provide any wraps.
2022-10-09 13:04:03 -04:00
Xavier Claessens 6776bfad3c Add "meson wrap update-db" command
It downloads releases.json from wrapdb and store it in
subprojects/wrapdb.json. That file will be used by Meson to find
dependency fallbacks offline.
2022-10-09 12:58:59 -04:00
Tristan Partin 58581ae3de Fix some wording in a JNISystemDependency comment 2022-10-09 16:47:47 +03:00
Tristan Partin 80b101443d Add BSD support to the JNISystemDependency
Supports all BSDs that Meson currently supports.

Fixes #10883
2022-10-09 16:47:47 +03:00
Eli Schwartz 2cb7350d16 run wrapped-due-to-env commands on unix via the env program
First, check if the env program exists. If it does, it is faster than
doing it via a python script `basically-env.py` that maybe imports all
of mesonbuild.* as a side effect of project structure.

We do not, however, use env for setting up PATH additions, since env can
override an environment variable but not extend it. So in that case we
still need to wrap the command via python.

By default, all run_targets (at least) are wrapped and now wrap via the
`env` program as they export e.g.
MESONINTROSPECT='/usr/bin/meson introspect'
2022-10-09 08:03:58 -04:00
Jan Tojnar a590cfde0c compilers: Add optimization=plain option
https://github.com/mesonbuild/meson/pull/9287 changed the `optimization=0`
to pass `-O0` to the compiler. This change is reasonable by itself
but unfortunately, it breaks `buildtype=plain`, which promises
that “no extra build flags are used”.

`buildtype=plain` is important for distros like NixOS,
which manage compiler flags for optimization and hardening
themselves.

Let’s introduce a new optimization level that does nothing
and set it as the default for `buildtype=plain`.
2022-10-09 14:43:18 +03:00
Christoph Reiter e945f35cd7 CI: add potential workaround for python crashes in MSYS2
There hasn't been any progress on this upstream lately, so
try what we use in MSYS2 CI right now
2022-10-07 18:35:03 -04:00
Hagen Möbius 9add5d03b6 Add handling Qt6's EntryPoint library.
- this fixes #10792
- Qt6EntryPoint(d) replaces qtmain(d) from Qt 4 & 5
- uses the same mechanism: `main: true`
- uses a special mixin class for pkg-config and config-tool dependency calculation
2022-10-06 04:29:25 -04:00
Jussi Pakkanen b0eecda108 Only use Debian path fixing on old distros. 2022-10-06 01:07:17 +03:00
Dylan Baker df1b95cf2b
pylint: enable consider-merging-isinstance 2022-10-04 00:33:14 -04:00
Dylan Baker a72840cd2e
pylint: enable use-a-generator
This catches some optimization problems, mostly in the use of `all()`
and `any()`. Basically writing `any([x == 5 for x in f])` vs `any(x == 5
for x in f)` reduces the performance because the entire concrete list
must first be created, then iterated over, while in the second f is
iterated and checked element by element.
2022-10-04 00:33:04 -04:00
Dylan Baker f11ebf20ff
pylint: enable unnecessary-lambda 2022-10-03 00:16:09 -04:00
Dylan Baker 20d76b8353
pylint: enable unnecessary-comprehension 2022-10-03 00:14:43 -04:00
Dylan Baker 676e66f853
pylint: enable consider-using-(min|max)-builtin
There's only one case of each, in the same function, so I've handled
both in the same commit.
2022-10-03 00:02:20 -04:00
Dylan Baker 8c819ab805
pylint: enable unspecified-encoding 2022-10-03 00:02:02 -04:00
Dylan Baker 988a50b19c
pylint: enable unnecessary-dunder-call 2022-10-03 00:00:26 -04:00
Andres Freund db7503690c AIX: allow link_whole, it's the only supported behaviour anyway
As ld's manpage says:
"The ld command processes all input files in the same manner, whether they are
archives or not"
2022-10-03 01:16:35 +03:00
Eli Schwartz 72e0a95f7f
Add stable regression test
This tests stable maintenance branches, to ensure that build directories
created with older versions of Meson continue to work without wiping,
after updating to a bugfix release.
2022-10-02 14:22:21 -04:00
Nirbheek Chauhan c20fb659f6 ci: Fix llvm detection on macOS CI
Downgrade to LLVM-14 from LLVM-15 which is somewhat broken when using
static linking at present:

https://github.com/Homebrew/discussions/discussions/3666#discussioncomment-3681821

We can't use LLVM's lld instead of ld on macOS because we don't detect
it as an Apple linker and pass --as-needed etc to it. Even when that
is fixed and we set -lto_library etc correctly, the linker just hangs.

LLVM@14 is keg-only, so we need to add CPPFLAGS / LDFLAGS to the keg
subdir inside /usr/local

The LLVM@15 test is shared-only now and moved to the qt4 macOS job.
2022-10-02 09:06:18 +05:30
Xavier Claessens 9fd5eb6056 doc: Add missing netrc release notes 2022-09-29 14:05:30 -04:00
Xavier Claessens 8e0bf28ba6 doc: Fix wayland release notes
The core_only kwarg got renamed to include_core_only.
2022-09-29 14:05:30 -04:00
Caleb Cornett e574eba0a5 Add cross-compile support for Microsoft GDK platforms 2022-09-29 07:52:07 -04:00
Xavier Claessens 2dfd952eb9 Move classes used by scripts to their own module
Those classes are used by wrapper scripts and we should not have to
import the rest of mesonlib, build.py, and all their dependencies for
that.

This renames mesonlib/ directory to utils/ and add a mesonlib.py module
that imports everything from utils/ to not have to change `import
mesonlib` everywhere. It allows to import utils.core without importing
the rest of mesonlib.
2022-09-28 19:36:13 -04:00
Paolo Borelli a58ec322b3 gnome: add support for update-mime-database
Fixes https://github.com/mesonbuild/meson/issues/10865
2022-09-28 12:07:24 -04:00
Eli Schwartz 56a6ee1e5d find_library with argument beginning in "lib" is a bad idea, warn about it
We need to support cases where the library might be called "foo.so" and
therefore we check for exact matches too. But this also allows
`cc.find_library('libfoo')` to find libfoo.so, which is strange and
won't work in many cases. Emit a warning when this happens.

Fixes #10838
2022-09-28 12:53:46 +03:00
Xavier Claessens 05da4b087c mlog: Use less from git on Windows 2022-09-28 12:48:22 +03:00
Xavier Claessens ed129a5311 wrap: If the directory exists in a sub-subproject, uses it inplace
A subproject could have a sub-subproject as a git submodule, or part of
the subproject's release tarball, and still have a wrap file for it
(e.g. needed for [provide] section). In that case we need to use the
source tree for the sub-subproject inplace instead of downloading a new
copy into the main project.

This is the case with GLib 2.74, it has a subproject "gvdb" as git
submodule, and part of release tarball, it ships gvdb.wrap file as well.
2022-09-28 00:17:42 -04:00
Xavier Claessens b9e382835e wrap: Small simplification 2022-09-28 00:17:42 -04:00
Xavier Claessens b314d1f7c1 wrap: Set self.directory only once
It can wait until after parsing the wrap file to set it.
2022-09-28 00:17:42 -04:00
Xavier Claessens 2a262d2936 Automatically tag systemtap files 2022-09-28 00:13:49 -04:00
Xavier Claessens a010274d4b Automaticall tag installed tests
It is common, at least in GNOME projects, to install tests. Files goes
into various locations, including:
- /usr/lib/x86_64-linux-gnu/installed-tests
- /usr/share/installed-tests
- /usr/libexec/installed-tests

It is safe to assume that everything that goes into a "installed-tests"
subdir should be tagged as "tests" by default.
2022-09-28 00:13:49 -04:00
Jan Tojnar c8d5f93cb0 gnome/yelp: fix `xml:lang` attributes
itstool detects a language code from the mo file’s basename,
so when 26c1869a14
changed the file name to be prefixed with project name,
values like “my-project-xx” ended up in the `xml:lang` attribute
of the generated page files, instead of the expected
IETF BCP 47 language tag.

Let’s fix it by passing a locale code to itstool explicitly.
2022-09-27 22:04:45 +03:00
Xavier Claessens 195aae6a84 mconf: Do not print None for empty choices 2022-09-27 11:15:51 -04:00
Xavier Claessens 4fce954f97 mconf: Use pager only when printing configuration
Fixes: #10845
2022-09-27 11:15:51 -04:00
Xavier Claessens e1db50d4d9 compilers: Cleanup a bit languages/suffixes lists
Use set where order does not matter, fix is_source() to really mean only
source suffixes.
2022-09-27 11:15:07 -04:00
Tristan Partin 838367ca60 Fix mypy lint
Unused "type:ignore"
2022-09-27 11:14:19 -04:00
Xavier Claessens fa254229b7 ninjabackend: Fix get_target_generated_sources() return type
Type annotation, documentation string, and implementation were doing 3
different things. Change implementation to match type annotation which
makes the most sense because it match what get_target_sources() does.

All callers only use keys from the returned dictionary any way, but
that's going to change in next commits.
2022-09-26 15:39:06 -04:00
Eli Schwartz 462759dd33
mtest: implement a maxfail option
This allows early exit of the project tests once a certain number of
failures are detected. For example `meson test --maxfail=1` will abort
as soon as a single test fails.

Currently running tests are marked as failed via INTERRUPT.

Resolves #9352
2022-09-23 16:10:32 -04:00
Xavier Claessens bed5b31079 mlog: disable usage of global for log_pager 2022-09-23 11:40:53 -04:00
Christoph Reiter b5710ac4f4 CI: don't set BOOST_ROOT to an empty string
This was initially added in eb76ba7031 to avoid picking
it up from azure/gha images.

Looks like it is no longer set for some time now though:
https://github.com/actions/runner-images/pull/540
so should no longer be needed.

The empty string makes some meson tests fail which expect a path.
A recent msys2-runtime change now lets empty env vars through to child processes
whereas before they would get filtered out, which is why this worked before.
2022-09-23 11:13:11 -04:00
Christoph Reiter efc6e40e2a Revert "CI: Add a temporary workaround for broken MSYS2 Python path separator behaviour"
This reverts commit 3fd2459a74.

The underlying issue has been fixed and deployed:
https://github.com/msys2-contrib/cpython-mingw/pull/107
2022-09-23 11:13:11 -04:00
Dylan Baker f5283dd63f pylint: enable global-statement
This does force a number of uses of `# pylint: disable` comments, but it
also finds a couple of useless global uses and one place (in the
previous commit) that an easy refactor removes the use of global. Global
is a code smell, so forcing adding a comment to disable helps force
developers to really consider if what they're doing is a good idea.
2022-09-22 18:17:43 -04:00
Dylan Baker 3ef332e89a pylint: enable global-variable-not-assigned
The `global` statement is only needed to assign to global variables, not
read or mutate them. So calling `global.mutate()` is fine, but not
`var = foo`, which would otherwise shadow `var`.
2022-09-22 18:17:43 -04:00
Dylan Baker 1917b9253e modules/gnome: make_native_glib_version an instance var
This removes the need for the use of the global statement. I've also
updated the test that overrides this to use mock.patch instead of hand
monkey patching.
2022-09-22 18:17:43 -04:00
Eli Schwartz 30b1774628 compilers: unify fortran sanity check with its parent Clike handling
We *mostly* just need to do the same thing. Plug in one utility method
to make sanity_check_impl find the right compile args, and plug in
DEVNULL to the test run. It's that simple.

This solves a few inconsistencies. The main one is that fortran never
logged the sanity checks to the Meson debug log, making it hard to
debug.

There's also some interesting quirks we built up in the dedicated
fortran handling. For example:

- in commit 5b109c9ad2 we added cwd to
  building the fortran executable, with a wordy comment about how the
  compiler has defects. But the clike base has always done that on
  general principle anyway, so we would never have had that bug in the
  first place.

- in commit d6be7822a0 we added special
  deletion of an old "bad existing exe file" just for fortran. Looking
  at the PR discussion for this odd requirement, it turns out that the
  real problem is mixing WSL and native Windows without deleting the
  build directory. This is apparently fortran specific simply because
  "contemporary Windows 10 Fortran users" switch between the two?

  The actual problem is that this never used .exe as the output name, so
  Windows thinks you want to run something other than the thing you
  asked to run, because it's not even a Window executable. But... the
  common clike handling could have fixed that without needing special
  cases.
2022-09-22 18:15:25 -04:00
Eli Schwartz 332968da1b use simpler subprocess.run interface instead of manual Popen
This code dates back to 2012 and probably has no specific reason...
2022-09-22 18:15:25 -04:00
Eli Schwartz 0d354588ca compilers: make sanity checks log commands using join_args
It is more correct to join commands with a command joiner than a
whitespace joiner.
2022-09-22 18:15:25 -04:00