Commit Graph

12432 Commits

Author SHA1 Message Date
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
Önder Görmez aa495ff758 Fix typo 2022-03-27 08:25:30 -04:00
Eli Schwartz d82d1b0d86
docs: add missing docs for new pkgconfig feature
Added in commit 6240920c21 and documented
in release notes but not in module docs.
2022-03-27 07:08:59 -04:00
Eli Schwartz 0022e1863d
cygwin CI: work around gcovr bug
Due to https://github.com/gcovr/gcovr/pull/576 it is not possible to
`pip install gcovr` and have it work.

It is possible, but not ideal, to install the cygwin gcovr package,
which is unmaintained and built for python36 while only depending on
python39.

This is of course not a problem on the other CI jobs, where we either
install it from a distro repository that ensures it is stable and
backports patches, or simply tests that the resulting image passes tests
before baking it as a CI images update.

gcovr upstream isn't sure when they are going to release a new version
that fixes this bug. There is a new feature release scheduled "soon".
2022-03-25 01:32:08 -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
Antoine Jacoutot dac212e1bb gnome module: properly fallback to gtk-update-icon-cache
Commit a0cade8f introduced a typo and wrongly check for
gtk4-update-icon-cache twice.
If gtk4-update-icon-cache (gtk4) is not found, look for
gtk-update-icon-cache (gtk3) instead.
2022-03-23 17:54:12 -04:00
Tristan Partin c65abc568c Add support for cython_args
cython_args was previoously ignored by Meson.
2022-03-23 15:44:01 -04:00
Xavier Claessens eccdbfe3d1 Make sure we support "<lang>_args" kwarg for all languages 2022-03-23 15:44:01 -04:00
Hemmo Nieminen ceb6e26ff1 boost: preserve compiler/linker argument order
Looks like boost dependency mixes up it's compiler and linker argument
order when it is removing duplicates (?) from those. This causes
unnecessary recompilations of everything depending on those components.

Use OrderedSet to remove the duplicates while also maintaining
consistent order for them.
2022-03-23 20:46:59 +02:00
Remi Thebault cc880d3ad5 add test d/14 dub with deps 2022-03-23 10:21:21 -07:00
Remi Thebault 04fca24355 Fix DUB dependencies
- fix the research of target built by DUB
 - explicitely state that DUB dynamic libraries and source libraries are not supported (yet) (mesonbuild#6581)
 - fix the build settings of recipes having sub-dependencies (mesonbuild#7560)
 - fix winlibs added from dub recipe
 - sanitization, comments, explanations...
2022-03-23 10:21:21 -07:00
Eli Schwartz 7b78c6b41b ninja backend: do not fatally error on compdb failure
We print a warning if a compilation database isn't successfully
generated, which is good, because that gives some visibility in case the
user really wanted to use the compdb. But warnings default to being
fatal with --fatal-meson-warnings, which is not so good, because this
isn't a very important warning at all, and we'd rather not error out in
such cases when building works fine and a random bonus IDE feature
doesn't work.

Mark this particular warning as non-fatal.

Fixes side issue in https://github.com/mesonbuild/wrapdb/pull/343#issuecomment-1074545609
2022-03-23 15:46:01 +05:30
rusty-snake 90fba42511 Fix missing ' in custom_target docs 2022-03-22 19:11:29 -04:00
Dylan Baker b5375eb90f docs/rust: fix markdown title
VSCode is perfectly happy with the trailing `---`, hotdoc only likes
`...` apparently.
2022-03-22 19:09:21 -04:00
Xavier Claessens 8867fb7999 interpreter: Make compiler options per-subproject 2022-03-22 17:20:48 -04:00
Xavier Claessens 999fb3d1e9 coredata: Do not forget subproject's default_options 2022-03-22 17:20:48 -04:00
Xavier Claessens 34f442a365 OptionOverrideProxy: Handle per-subproject options 2022-03-22 17:20:48 -04:00
Xavier Claessens 06d12064d0 OptionOverrideProxy: Make it immutable to avoid copies
It is always used as an immutable view so there is no point in doing
copies. However, mypy insist it must implement the same APIs as
Dict[OptionKey, UserOption[Any]] so keep faking it.
2022-03-22 17:20:48 -04:00
Xavier Claessens 86aaac8e42 backends: Stop separating base and compiler options
Since OptionKey is used we can mix all options together in a single
dictionary. That's already what we do in coredata.options.
2022-03-22 17:20:48 -04:00
Dylan Baker 6c5a0f8332 unittests: Fix rpath tests no nixos
Which insert a bunch of rpath entries we strip, but then don't check if
they're empty and fail anyway.
2022-03-22 15:15:29 +02:00
Dylan Baker 9ee0de427c envconfig: use $PKG_CONFIG for pkg-config find_program as well as pkgconfig
It looks like internally we use pkgconfig, even though the installed
name is pkg-config. This fixes `tests cases/common/44 pkgconfig-gen`,
which will ignore PKG_CONFIG and select the wrong pkg-config binary if
you have $PKG_CONFIG set.
2022-03-22 15:15:29 +02:00
Dylan Baker d3e3733c1a tests/common/44: Prepend to PKG_CONFIG_PATh instead of replacing it
Which is required to make this test work when PKG_CONFIG_PATH is
required to get a working system, such as on nixos
2022-03-22 15:15:29 +02:00
Dylan Baker f0b27964ca tests/linuxlike: prepend rather than override PKG_CONFIG_PATH
If you rely on PKG_CONFIG_PATH to make anything work (like nixos) then
these tests cannot pass without the system values appended to the
override values.
2022-03-22 15:15:29 +02:00
Dylan Baker b43cf097c2 tests/linuxlike: Honor PKG_CONFIG envvar
For some of us, we need to use this to get the right pkg-config. If the
variable is unset, `'pkg-config'` is used.
2022-03-22 15:15:29 +02:00
Dylan Baker 655746e8b4 compilers: fix mypy warning in Rust detection 2022-03-22 15:15:29 +02:00
Tristan Partin 39f1d52e4a Add ability to add resources to jars
Previously Meson lacked the ability to add resources to jar files.

Fixes #9945
2022-03-22 13:21:26 +02:00
Jussi Pakkanen a559dbe70d Bump version number for new development. 2022-03-22 00:13:50 +02:00
Jussi Pakkanen fb67adf3e6 Prepare the 0.62.0 release. 2022-03-21 23:24:01 +02:00
Jussi Pakkanen 42af1f7092
Merge pull request #10147 from dcbaker/submit/structured-sources-subdir
structured_sources: fix subdir handling
2022-03-21 23:16:41 +02:00
Dylan Baker cf4d02d82a tests/rust: renumber structred sources test 2022-03-21 11:26:52 -07:00
Dylan Baker 9b83fc5ece ninja: fix handling of rust structured_sources in rare case
In the even that all of the inputs are generated, and they're all
generated into the same folder, and there are no subfolders, we would
fail to correctly handle all of the files after the main file. Let's fix
that.t
2022-03-21 11:26:52 -07:00
Dylan Baker adc509ed98 modules/rust: set bindgen include_dirs for both build and source dir
Which we pretty obviously need if any of our headers are generated
2022-03-20 11:00:53 -04:00
Eli Schwartz bf5d11f049
docs: fix incorrect default for test is_parallel
In the original RefMan 2.0 implementation, this incorrectly started
claiming that the default is false.

Fixes #10155
2022-03-20 10:24:03 -04:00
Dylan Baker f9445300b3 structured_sources: fix subdir handling
We currently don't handle subdirectories correctly in
structured_sources, which is problematic. To make this easier to handle
correctly, I've simply changed `structured_sources` to only use Files
and not strings as an implementation detail.
2022-03-18 19:46:24 -07:00
Eli Schwartz a0cade8f1d
gnome module: fix incorrect lookup of nonexistent dependencies in post_install
While gtk+-3.0 / gtk4 do exist, they have never provided the location of
the gtk-update-icon-cache program as a pkgconfig variable. Trying to
find one anyway, resulted in two things happening:
- a useless dep lookup
- a fatal-meson-warnings error and build failure because the
  get_pkgconfig_variable() in question never existed

The desktop-file-utils package is a package solely providing some
command line programs, and has never provided a pkg-config file in the
first place, so this always logged that the dependency was not found and
fell back to normal find_program_impl(), although without
fatal-meson-warnings build errors.

Fixes #10139
2022-03-18 12:52:06 -04:00
Eli Schwartz 041c372048 tests: make python2 dependency on 32-bit windows non-fatal
Apparently Azure provides 64-bit python2 when we try to test 32-bit, and
that breaks everything on the 32-bit test runner.

I don't understand the environment setup, and that runner is
disappearing soon anyway. Hopefully this shuts up the known breakage.
2022-03-18 18:21:21 +02:00
Eli Schwartz fe2c0ff1e2
tests: don't skip python version tests if python is found but its dep is broken
If a version of python is installed for testing against, we should
assume it's actually important to test against it.
2022-03-17 07:29:55 -04:00
Eli Schwartz 4b0c0810df
unittests: convert python tests to project tests
Perhaps when this test case was originally created, project tests could
not use a matrix of options? This is certainly possible today, so don't
write special unittest handling for this instead.

This adds proper visibility into what gets run and what doesn't. Now we
know which python executables got tested and which got skipped.
2022-03-16 18:39:02 -04:00
Paolo Bonzini ff844f3a1f fix detection of language standard library paths
The code in the C++ and Fortran compilers' language_stdlib_only_link_flags
method is broken and cannot possibly have ever worked.  Instead of
splitting by line, it splits by whitespace and therefore, instead of
the last line of the compiler output:

 programs: =/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
libraries: =/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0

it is only the last field that has its first 11 characters removed.
Instead of reinventing the wheel with a new and brittle pattern,
reuse get_compiler_dirs.

Fixes: 64c267c49 ("compilers: Add default search path stdlib_only_link_flags", 2021-09-25)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-03-16 09:24:57 -07:00
Paolo Bonzini ca7b16f937 coredata: be even more robust on unpickling errors
When reverting from 0.62 to 0.59, one can see an error like this:

line 1003, in load
    obj = pickle.load(f)
  File "/Users/pm215/src/qemu-for-merges/meson/mesonbuild/mesonlib/universal.py",
line 2076, in __setstate__
    self.__init__(**state)  # type: ignore
TypeError: __init__() got an unexpected keyword argument 'module'
FAILED: build.ninja

Raise a MesonException for TypeError as well, so that reconfiguration
proceeds using cmd_line.txt.
2022-03-16 10:49:26 -04:00
Xavier Claessens 54213683e2 python: Remove warning about invalid install path
It was originally added because proper detection was not working on
Debian, but that has been fixed since. It was causing annoying warning
by default when prefix is /usr/local that can only be avoided by setting
options.
2022-03-16 07:03:43 -04:00