aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2023-01-04clang-cl: supports /std:c++20 now.Luke Elliott1-1/+1
See https://github.com/llvm/llvm-project/commit/a8f75d49
2023-01-04forbid using declare_dependency(objects: ...) with pkg-config modulePaolo Bonzini1-0/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2023-01-04add objects keyword argument to declare_dependenciesPaolo Bonzini5-8/+13
2023-01-04allow passing generated objects in the "objects" keyword argumentPaolo Bonzini1-6/+5
Generated objects can already be passed in the "objects" keyword argument as long as you go through an extract_objects() indirection. Allow the same even directly, since that is more intuitive than having to add them to "sources". Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2023-01-03modules/gnome: use `mlog.log(once=True)` in a few more placesDylan Baker1-2/+2
It's probably not useful to spam the user with warnings that old versions of software may not behave correctly when the first warning was perfectly valid.
2023-01-03Add fatal=False to many mlog.warnings()Dylan Baker5-11/+16
There are lots of warnings that become fatal, that are simply unfixable by the end user. Things like using old versions of software (because they're using some kind of LTS release), warnings about compilers not supporting certain kinds of checks, or standards being upgraded due to skipped implementations (MSVC has c++98 and c++14, but not c++11). None of these should be fatal, they're informative, and too important to reduce to notices, but not important enough to stop meson if they're printed.
2023-01-03wrap: use log once instead of hand rollingDylan Baker1-5/+1
2023-01-03mparser: Don't create an exception to pass to mlog.warningDylan Baker1-5/+4
Just call `mlog.code_line` directly, since the exception is never raised.
2023-01-03mlog: move code for printing code with a caret to the mlog moduleDylan Baker2-1/+12
We need this outside the constructor for the ParseException class, so let's pull it out. mlog seemed like a good place since it's a text formatting function, and has no dependencies.
2023-01-03reformat some warnings for better code readabilityDylan Baker2-5/+7
2023-01-03backends/backends: Add helpful message for getting rid of warningDylan Baker1-1/+1
2023-01-03mlog: use an enum instead of stringsDylan Baker1-11/+19
enum comparisons are ultimately ints, so they're faster, plus they're exhaustive, so mypy can statically determine that we've passed a valid value rather than via an assertion at runtime.
2023-01-03mlog: Remove using of `**kwargs: T.Any`Dylan Baker1-29/+59
This is annoying because we can't get proper auto-completion of mlog, and because ultimately it was allowing keyword arguments to be silently dropped on the floor. This does make the code a little more verbose, but I think the trade-offs of completion + better safety are worth it. PEP692, which will be part of python 3.12, provides a more elegant solution using `TypedDicts` to annotate `**kwargs`, which we should consider in the future.
2023-01-03msetup: do some stupid casting to make mypy happyDylan Baker1-4/+5
mypy is pretty dumb when it comes to unions of callables (pylance is also dumb in this regard), and can't figure out that our use of `mlog.debug | mlog.log` is perfectly safe. We also can't annotate them properly to cast them to a valid subset of arguments because you can't have splats in `typing.Callable`, so I've done enough to make it work.
2023-01-03dependencies/dev: refactor some code to make mypy happyDylan Baker1-4/+10
There should be a way to make mypy happy without casting, but I can't figure it out, since the mlog.error and mlog.debug actually have different signatures.
2023-01-03mparser: don't pass a SimpleNamespace where a BaseNode is expectedDylan Baker1-2/+1
mypy spotted this as well. And it turns out that we're not setting the column either for the warning, so improvements!
2023-01-03mesonlib: remove filename parameter to mlog.warningDylan Baker1-1/+1
After tracing all the way down to the bottom of this (or really, adding annotations so mypy can) it turns out that passing file would just be ignored at the end of the mlog call stack, so it should be removed
2022-12-27add builtin option to install licensesEli Schwartz3-6/+14
Unless `meson.install_dependency_manifest()` is explicitly used, this will cause a default implied one to be installed.
2022-12-27add license_files kwarg to projectEli Schwartz4-3/+35
Hook this up to installed dependency manifests. This is often needed above and beyond just an SPDX string -- e.g. many licenses have custom copyright lines.
2022-12-27emscripten: remove no longer relevant commentKleis Auke Wolthuizen1-2/+1
This was fixed in Emscripten 1.39.16, see: https://github.com/emscripten-core/emscripten/commit/d4fabf3da40e7f556700b16950739d5960a91559
2022-12-27emscripten: enforce version 1.39.19 or higherKleis Auke Wolthuizen2-0/+4
2022-12-27emscripten: remove redundant `thread_flags` implementationKleis Auke Wolthuizen1-3/+0
Since it's the same as the one in `CLikeCompiler`.
2022-12-27emscripten: use single arguments when specifying optionsKleis Auke Wolthuizen2-3/+3
i.e. without a space between the "-s" and option name. See: https://github.com/emscripten-core/emscripten/issues/11463 This is supported since Emscripten 1.39.19, see: https://github.com/emscripten-core/emscripten/commit/f45bea21f3a8f74a68ed4e3e3d7e290807ee2aff
2022-12-27emscripten: prefer `-pthread` over `-s USE_PTHREADS=1`Kleis Auke Wolthuizen1-2/+2
See: https://github.com/emscripten-core/emscripten/issues/12346 This is supported since Emscripten 1.38.33, see: https://github.com/emscripten-core/emscripten/commit/24350798a8570f567327f873cf1efb0361aec284
2022-12-25dependencies: better logging of pkg-config call outputsEli Schwartz1-1/+5
If `pkg-config --modversion foobar` fails, we don't know why. The general issue here, though, is that call_pkgbin routinely logs stdout for informational purposes, but not stderr. Fixes #11076
2022-12-24interpreter: use static_lib's already calculated pic valueDylan Baker1-9/+1
Instead of re-calculating it when building both libraries
2022-12-23Bump version number for new development.Jussi Pakkanen1-1/+1
2022-12-23This is it. The 1.0.0.1.0.0Jussi Pakkanen1-1/+1
2022-12-22meson: Cache os.path.realpath in CLikeCompilerArgsNirbheek Chauhan1-4/+9
Profiling showed that we were spending 25s inside os.path.realpath() on Windows while generating compile lines for build.ninja, inside NinjaBackend.generate() The real path for these will not (should not) change during a single meson invocation, so cache all these. Brings build.ninja generation from 73s to 47s on my machine.
2022-12-17Bump version number for rc2.1.0.0rc2Jussi Pakkanen1-1/+1
2022-12-17mtest: handle TAP tests with unknown version.Eli Schwartz1-1/+4
TAP 14 states: > Harnesses may treat any TAP stream lacking a version as a failed test. TAP 13 states: > In the absence of any version line version 12 is assumed. It is an > error to explicitly specify any version lower than 13. So, modern TAP is saying that we should treat a missing version as a test definition bug, it's no longer okay to use a missing version as saying "let's use TAP 12". But, we can choose whether to treat it that way or error out. Let's do a diagnostic, as we do elsewhere. But allow TAP streams that aren't well defined, if they used to be well defined (back in TAP 12).
2022-12-16Merge pull request #11174 from bgilbert/jar-manifestJussi Pakkanen1-2/+7
depfixer: silence `fix_jar()` and make it do something
2022-12-16Merge pull request #11181 from tristan957/backendsJussi Pakkanen1-15/+29
JNISystemDependency fixes
2022-12-15Change double quote doc comment to sinqle quoteTristan Partin1-2/+2
2022-12-15Try to find the jni dependency when javac is a Darwin stubTristan Partin1-11/+25
Darwin-based systems, at least macOS, provide various JDK executable stubs in /System/Library/Frameworks/JavaVM.framework/Versions/*/Commands. These stubs are placed in such a way that they break the heuristics of the JNI system dependency. If a javac being analyzed to find a Java home is a stub, use /usr/libexec/java_home. See https://stackoverflow.com/a/15133344/7572728 for more details. Closes #11173
2022-12-15delay importing ctypes unless it is actually usedEli Schwartz1-1/+1
ctypes uses FFI, and surprisingly often people's Python installations will be broken because ctypes is broken (e.g. the system libffi has been updated and Python needs to be recompiled). That is not our fault, but it does manifest as Meson failing to run. It turns out we aren't even using it though. At least, pretty often. We have two uses of ctypes, and both of them are for Windows. One of them is already conditionally imported in the function that uses it, but the other is imported at startup. Move this down into the invoking function. On non-Windows systems, it is now impossible for Meson to fail to run when ctypes is broken, because we don't use it. Anecdotally, this issue tends to come up on Linux systems primarily. Fixes #11111 Closes #11112
2022-12-14Deduplicate code in JNISystemDependency conditionalTristan Partin1-2/+2
2022-12-14depfixer: silence fix_jar() and make it do somethingBenjamin Gilbert1-1/+6
fix_jar() tries to remove an existing Class-Path entry from the jar manifest by postprocessing the manifest and passing it to `jar -um`. However, `jar -um` can only add/replace manifest entries, not remove them, and it also complains loudly when replacing an entry: Dec 13, 2022 7:11:19 PM java.util.jar.Attributes read WARNING: Duplicate name in Manifest: Manifest-Version. Ensure that the manifest does not have duplicate entries, and that blank lines separate individual sections in both your manifest and in the META-INF/MANIFEST.MF entry in the jar file. Thus fix_jar() produces one such warning for each entry in the manifest and accomplishes nothing else. Use jar -uM instead. This completely removes the manifest from the jar and allows adding it back as a normal zip member, fixing fix_jar() and avoiding the warnings. Fixes: https://github.com/mesonbuild/meson/issues/10491 Fixes: c70a051e93 ("java: remove manifest classpath from installed jar")
2022-12-13depfixer: don't extract MANIFEST.MF verboselyBenjamin Gilbert1-1/+1
Avoids non-actionable output when installing a jar: inflated: META-INF/MANIFEST.MF Fixes: c70a051e93 ("java: remove manifest classpath from installed jar")
2022-12-13Revert "openbsd: execinfo is not a compiler lib"Brad Smith1-6/+2
OpenBSD now has execinfo as compiler lib. DragonFly has all along. This reverts commit 0241948d8fa37f59eb93088a26e9b7ae642cc2d0.
2022-12-12Fixing typosAndreas Deininger1-1/+1
Convert http to https in some links
2022-12-12mlog: set LV environment variable for pager.Phil Jones1-0/+3
2022-12-12mlog: set LESS environment variable for pager.Phil Jones1-5/+11
Rather than passing arguments directly to less, set the LESS environment variable to contain the desired arguments instead. This allows passing arguments in case the user has PAGER=less set in their environment.
2022-12-11fix broken fs.copyfile function that crashed if you tried to use itEli Schwartz3-6/+4
At least, if you tried to use it when passing an install_dir. Because T.Sequence is horrible and we should never use it, and the annotations are a lie that produces bugs. So, fix the annotations on CustomTarget to never allow this to happen again, and also fix the function too. Move some definitions elsewhere inline to satisfy the linter. Fixes #11157
2022-12-11typing: fix some broken Sequence annotationsEli Schwartz5-6/+6
T.Sequence is a questionable concept. The idea is to hammer out generic, maximally forgiving APIs that operate on protocols, which is a fancy way of saying "I don't care if you use tuples or lists". This is rarely needed, actually, and in exchange for this fancy behavior you get free bugs. Specifically, `somestr` is of type `T.Sequence[str]`, and also `somestr[0]` is another string of type you guessed it. It's ~~turtles~~ strings all the way down. It's worth noting that trying to code for "protocols" is a broken concept if the contents have semantic meaning, e.g. it operates on "the install tags of this object" rather than "an iterable that supports efficient element access". The other way to use T.Sequence is "I don't like that T.List is invariant, but also I don't like that T.Tuple makes you specify exact ordering". This sort of works. In fact it probably does work as long as you don't allow str in your sequences, which of course everyone allows anyway. Use of Sequence has cute side effects, such as actually passing lists around, knowing that you are going to get a list and knowing that you need to pass it on as a list, and then having to re-allocate as `list(mylist)` "because the type annotations says it could be a str or tuple". Except it cannot be a str, because if it is then the application is fatally flawed and logic errors occur to disastrous end user effects, and the type annotations: - do not enforce their promises of annotating types - fail to live up to "minimal runtime penalties" due to all the `list()` Shun this broken concept, by hardening the type annotations. As it turns out, we do not actually need any of this covariance or protocol-ism for a list of strings! The whole attempt was a slow, buggy waste of time.
2022-12-11simplify install_tag handling according to the accepted APIEli Schwartz2-5/+5
There are two problems here: a typing problem, and an algorithm problem. We expect it to always be passed to CustomTarget() as a list, but we ran list() on it, which became horribly mangled if you violated the types and passed a string instead. This caused weird*er* errors and didn't even do anything. We want to do all validation in the interpreter, anyway, and make the build level dumb. Meanwhile we type it as accepting a T.Sequence, which technically permits... a string, actually. This isn't intentional; the point of using T.Sequence is out of a misguided idea that APIs are supposed to be "technically correct" by allowing "anything that fulfills an interface", which is a flawed concept because we aren't using interfaces here, and also because "technically string fulfills the same interface as a list, if we're talking sequences". Basically: - mypy is broken by design, because it typechecks "python", not "what we wish python to be" - we do not actually need to graciously permit passing tuples instead of lists As far as historic implementations of this logic go, we have formerly: - originally, typeslistified anything - switched to accepting list from the interpreter, redundantly ran list() on the list we got, and mishandling API violations passing a string (commit 11f96380351a88059ec55f1070fdebc1b1033117) - switched to accepting anything, stringlistifying it if it was not `None`, mishandling `[None]`, and invoking list(x) on a brand new list from stringlistify (commit 157d43883515507f42618b065a64fb26501734a0) - stopped stringlistify, just accept T.List[str | None] and re-cast to list, violates typing because we use/handle plain None too (commit a8521fef70ef76fb742d80aceb2e9ed634bd6a70) - break typing by declaring we accept a simple string, which still results in mishandling by converting 'foo' -> ['f', 'o', 'o'] (commit ac576530c43734495815f22456596772a8f6a8cc) All of this. ALL of it. Is because we tried to be fancy and say we accept T.Tuple; the only version of this logic that has ever worked correctly is the original untyped do-all-validation-in-the-build-phase typeslistified version. Let's just call it what it is. We want a list | None, and we handle it too.
2022-12-11Fix package kwarg typeTristan Partin1-2/+3
2022-12-11Rename java.generate_native_headers to java.native_headersTristan Partin1-0/+18
This follows the Meson naming scheme which typically leaves off a verb like generate.
2022-12-11Remove java.generate_native_headerTristan Partin1-45/+0
This API existed for 2 minor releases and was worthless for pretty much every usecase.
2022-12-11debug cygwin CIEli Schwartz1-0/+1