aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-03-07Fix default install tag for shared lib symlinksXavier Claessens7-28/+65
Versioned shared libraries should have .so file in devel, .so.1 and .so.1.2.3 in runtime. Fixes: #9811
2022-03-07Merge pull request #9743 from mensinda/cmakeGeneratorFixedJussi Pakkanen8-9/+149
cmake: Add TARGET_ generator expression support (fixes #9305)
2022-03-06find_program: add a version() method to match the one for dependenciesEli Schwartz4-0/+28
It is often useful to check the found version of a program without checking whether you can successfully find `find_program('foo', required: false, version: '>=XXX')`
2022-03-06i18n.merge_file: do not disable in the absence of gettext toolsEli Schwartz2-4/+16
Disabling targets because the tools used to build them aren't available is a pretty suspicious thing to do. Users who want this are probably, in general, advised to check themselves whether it is possible to build those targets with find_program(..., required: false) The i18n.gettext() invocation is a bit unusual because the product of running it is non-critical files, specifically, translation catalogs. If users don't have the tools needed to build them, they may not be able to use them either, because perhaps they have NLS disabled on their platform or it's difficult to put it in the bootstrap path. So, for this reason, it was made non-fatal and the message catalogs are just not created, and the resulting build is still perfectly usable *unless* you want to use it in another language, at which point it "works" but the text is all inscrutable to the end user, and that's a feature of the target platform. That's an acceptable tradeoff for translation catalogs. It is NOT an acceptable tradeoff for merge_file, which produces desktop files or MIME database catalogs or other files which have crucial roles to perform, without which the software in question simply doesn't work at all. In such cases, this just fails to install crucial files, users report bugs to the project in question, and the project adds `find_program('xgettext')` to guarantee the hard error due to lack of confidence in Meson. Fixes #6165 Fixes #8436
2022-03-06i18n module: report initial call site when disabling translation supportEli Schwartz1-4/+5
2022-03-06i18n module: detect gettext tools at configure timeEli Schwartz1-13/+27
Use this instead of shutil.which to detect whether they will be available, and pass the ExternalProgram object to CustomTarget invocations, or else make use of the new functionality to specify the correct program path in wrapper scripts. Drop duplicate reporting for itstool missing. Since we use find_program in required mode, its absence is already fatal, and already has a really good error description.
2022-03-06scripts: accept the path of the gettext commands to run as an argumentEli Schwartz3-11/+18
Don't assume itstool, msgfmt et al. are just magically on the path. Normally for commands being processed in build.ninja we'd look up the program in order to run it. Offer the same guarantee for programs being passed through an awkward script wrapper.
2022-03-06i18n module: fix bug that made msgfmthelper die on combinations of argsEli Schwartz3-2/+3
Due to misuse of argparse in commit 82492f5d765b70cc87385fb887008df89fac878e it was impossible to use both --datadirs and extra args passed directly to msgfmt at the same time. I'm not sure anyone actually knows how argparse works, so misusing it is easy. What is definitely known is that argparse is NOT a POSIX compliant parser and doesn't behave the way you'd expect a standards based parser to handle options. Instead it caters to the easy use case, and hopes and prays you don't need to do anything too complicated "with the wrong kind of complicated". Apparently, this particular type of complicated is when you have mixed option_arguments and operands while simultaneously passing some operands as nargs after a --. It totally breaks, and interprets --datadirs, which is supposed to be an option_argument, as an operand, eats it up as a msgfmt wrapped argument, and breaks. But if you don't pass additional arguments with -- then it interprets --datadirs after operands as an option_argument. This is what we were doing. Instead pass option_arguments before all operands (including the ones specified via `-- ...`). Add test case to pass meaningless datadirs (we don't actually care if $GETTEXTDATADIRS is set to something that doesn't contain gettext data).
2022-03-06wayland module: Allow building both client and server sidesXavier Claessens11-67/+95
- Change `scope` kwarg to `public` boolean default to false. - Change `side` kwarg to `client` and `server` booleans. - Document returned values - Aggregate in a single unit test because have lots of small tests increases CI time. Fixes: #10040.
2022-03-04[skip ci] fix syntax typoDarren Ng1-1/+1
2022-03-04Port JavaModule to NewExtensionModule APITristan Partin1-18/+25
2022-03-04Fix @typed_pos args on java.generate_native_headerTristan Partin1-2/+1
2022-03-04Add modules kwarg to JNI system depTristan Partin4-7/+83
This allows someone to link against libjvm.so and libjawt.so.
2022-03-03CI images: add the JRE to UbuntuEli Schwartz2-0/+2
This is needed in order to test a pending improvement to the jni dependency in #10048.
2022-03-03add release snippet for declare_dependencyRemi Thebault1-0/+14
2022-03-03ignore dub.json in test "d/11 dub"Remi Thebault1-0/+1
2022-03-03Document D features in `declare_dependency`Remi Thebault1-0/+17
2022-03-03add test d/13 declare depRemi Thebault3-0/+29
2022-03-03add D features to InternalDependencyRemi Thebault5-12/+29
2022-03-02document and raise an error for disallowed combination of install_headers argsEli Schwartz2-4/+10
It makes no sense to specify both: - install_dir, which overrides the -Dincludedir= builtin option - subdir, which suffixes the -Dincludedir= builtin option We've always silently ignored the subdir in this case, which is really surprising if someone actually passed it and expected it to do something. We also confusingly didn't say anything in the documentation about it. Document that the options are incompatible, and explicitly check to see if they are both passed -- if so, raise an error message pointing out that only install_dir should be used. Fixes #10046
2022-03-02Rename JDK system dep to JNITristan Partin15-64/+100
JNI is a more apt name because it currently only supports the JNI. I also believe that CMake uses the terminology JNI here as well. JNI is currently the only way to interact with the JVM through native code, but there is a project called "Project Panama" which aims to be another way for native code to interact with the JVM.
2022-03-02compilers/gnu: set level 0 optimization to '-O0'Dylan Baker1-1/+1
GCC with optimization set to 0 does not actually result in no optimizations, which can be annoying when trying to use a debugger like gdb, and finding that your variable has been optimized out. We already do this with clang, so gcc is a bit of an outlier here.
2022-03-01fix missing encodingsEli Schwartz2-1/+7
These were caught by the testsuite erroring out with a fatal EncodingWarning due to the previous commit. Fixes #9996
2022-03-01use a more sane check instead of run_custom_lintEli Schwartz5-86/+13
Unfortunately, checking for strings without context is exceedingly prone to false positives, while missing anything that indirectly opens a file. Python 3.10 has a feature to warn about this though -- and it uses a runtime check which runs at the same time that the code fails to open files in the broken Windows locale. Set this up automatically when running the testsuite. Sadly, Python's builtin feature to change the warning level, e.g. by setting EncodingWarning to error at startup, is utterly broken if you want to limit it to only certain modules. This is tracked in order to be more efficiently ignored at https://bugs.python.org/issue34624 and https://github.com/python/cpython/pull/9358 It is also very trigger happy and passing stuff around via environment variable either messes with the testsuite, or with thirdparty programs which are implemented in python *such as lots of gnome*, or perhaps both. Instead, add runtime code to meson itself, to add a hidden "feature". In the application source code, running the 'warnings' module, you can actually get the expected behavior that $PYTHONWARNINGS doesn't have. So check for a magic testsuite variable every time meson starts up, and if it does, then go ahead and initialize a warnings filter that makes EncodingWarning fatal, but *only* when triggered via Meson and not arbitrary subprocess scripts.
2022-03-01compilers/d: fix mangling of rpath-link in DMD-like compilersEli Schwartz1-1/+1
We didn't consider that it has arguments following it, so the resulting compiler command line ended up with stuff like: -L=-rpath-link -L=-L=/path/to/directory -L=more-args and the directory for rpath-link got eaten up as a regular -L path to the compiler rather than being passed as -Xlinker to the linker. Then the -rpath-link would consume the next -Xlinker argument, end up with the wrong rpath-link (may or may not cause link errors) and then disappear arguments we need. As an example failure mode, if the next argument is -soname this treats the soname text as an input file, which probably does not exist if it was generated in a subdirectory, and also because it can never be successfully built in the first place -- though if it did, it would link to itself which is very wrong.
2022-03-01Deprecate java.generate_native_header() in favor of ↔Tristan Partin5-6/+127
java.generate_native_headers() After implementing a much more extensive Java native module than what currently exists in the tests, I found shortcomings. 1. You need to be able to pass multiple Java files. 2. Meson needs more information to better track the generated native headers. 3. Meson wasn't tracking the header files generated from inner classes. This new function should fix all the issues the old function had with room to grow should more functionality need to be added. What I implemented here in this new function is essentially what I have done in the Heterogeneous-Memory Storage Engine's Java bindings.
2022-03-01mesonlib: use Literal to tighten configure_file formatsDylan Baker1-14/+17
Now that we have strong type checking in the interpreter, we can tighten the type checking in the mesonlib side by using the same Literals.
2022-03-01interpreter: delete now unnecessary codeDylan Baker1-5/+0
Only func_configure_file could reach this code, but now it cannot due to the use of typed_kwargs, so delete it.
2022-03-01interpreter: use typed_kwargs for configure_fileDylan Baker2-79/+82
2022-03-01interpreter: use a shared KwargInfo for install_tagDylan Baker2-3/+6
The kind that takes a single argument, not the custom_target version that takes an array
2022-03-01interpreter: fix notfound_program methodDylan Baker1-2/+4
Which should take a File or str, but only handles str correctly. Which mypy would have caught for us, if we just had annotations here.
2022-03-01build: Add a `__bool__` dunder to ConfigurationDataDylan Baker1-0/+3
Which will be used by the `configure_file` method of the interpreter.
2022-03-01cheat and evade the detection of "open()" in custom_lintEli Schwartz1-6/+6
It's a dumb check which doesn't know the difference between python functions and string data. Work around this by changing the message output to not include an opening parenthesis, and changing other similar strings the same way for consistency.
2022-03-01mark a bunch of dependencies with the version they were introducedEli Schwartz2-0/+7
All these dependencies are impossible to find on versions of Meson older than the ones they got custom lookups in, because they don't provide pkg-config files. So they should not / cannot be reasonably used on older versions, and it is easy to say "yep, these should emit a FeatureNew for the versions they got added in".
2022-03-01allow dependency checks to bubble up feature warnings to the interpreterEli Schwartz2-0/+8
It would be too difficult and probably a layering violation to give an interpreter handle to the inner guts of every dependency. What we can do instead is let every dependency track: - the Feature checks it can produce, - the version attribute for when it was implemented while leaving the interpreter in charge of actually emitting them.
2022-03-01clean up FeatureCheck signature to move location to use timeEli Schwartz3-17/+15
The point of a .use() function is because we don't always have the information we need to use a feature check, so we allow creating the feature and then storing it for later use. When implementing location checks, although it is optional, actually using it violated that design. Move the location out of the init method for FeatureCheck itself. It remains compatible with all cases of .single_use(), but fix the rest up.
2022-03-01remove useless kwarg that was never usedEli Schwartz1-2/+1
I am not sure why it ever got added. It looks superficially similar to FeatureCheck itself, but doesn't need to.
2022-02-28Allow setting method/separator in environment() and meson.add_devenv()Xavier Claessens10-30/+131
2022-02-28devenv: Do not prepend empty list to PATH and LD_LIBRARY_PATHXavier Claessens1-7/+9
2022-02-28devenv: Add --dump optionXavier Claessens3-11/+33
It prints all envorinmente variables that have been modified. Can be used by shell scripts that wish to setup their environment themself.
2022-02-28devenv: Setup GDB auto-load scriptsXavier Claessens3-2/+65
When the project instals GDB helper scripts, copy them into meson-private directory with the right tree layout and write a .gdbinit script to load them automatically.
2022-02-28devenv: Source bash completion scriptsXavier Claessens4-15/+47
2022-02-28devenv: Set PYTHONPATH where we install python modulesXavier Claessens8-7/+94
2022-02-28Add API for modules that wants to define their devenvXavier Claessens3-2/+15
2022-02-28modules: Make ExtensionModule inherit from NewExtensionModuleXavier Claessens1-22/+7
It reduces duplicated code.
2022-02-28backends: Cache creation of install dataXavier Claessens1-0/+1
It is created twice for ninja and for introspection.
2022-02-28Cache the result of python.find_installation()Xavier Claessens1-29/+34
This avoids running sanity checks everytime find_installation() is called.
2022-02-28doc: Fix spelling developper->developerXavier Claessens1-1/+1
Mistaken from French développeur.
2022-02-28Add missing install_tag kwarg to install_emptydir()Christian Wendt1-2/+3
2022-02-28Change jar() default install dirTristan Partin3-0/+12
The previous install dir seemed incorrect when looking at various Linux distributions.