aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2021-08-27python module: produce the correct install path on every OSEli Schwartz1-1/+1
The sysconfig paths are, by default, correct for every OS -- they are supposed to follow the scheme that python knows about per default. For some reason, this overrode the scheme to posix_prefix, which is the default for posix OSes like linux and macOS, but wrong on Windows. Simply deleting this entirely makes everything that used to work, still work, and a couple new things start working.
2021-08-26Add typed_kwargs to add_languages()Tristan Partin2-4/+9
2021-08-23gnome: don't let fortify defines into the g-ir-scanner after stripping -OEli Schwartz1-1/+3
The tool needs to run the preprocessor (but does not actually produce compiled outputs), and meanwhile ignores lots of flags it doesn't think it needs. In the case of -D_FORTIFY_SOURCE=... this is only valid if -O is there too, but otherwise spits out confusing warnings. The warnings are spurious and can be safely ignored, but in this case let's go the extra mile and fix g-ir-scanner's upstream bug by removing the fortify flag first. Fixes #9161
2021-08-23java module: fix FeatureNew versionEli Schwartz1-1/+1
It should apply to the *next* stable release. Reported-by: Tristan Partin <tristan@partin.io>
2021-08-23interpreter: Fix dependency(..., static: true) fallbackXavier Claessens2-10/+59
It should build the fallback subprject with default_library=static and override the dependency for both static=True and static kwarg not given. Fixes: #8050.
2021-08-22python: Workaround broken install pathXavier Claessens1-3/+20
2021-08-22use even more informative error message for invoking meson in a subdirEli Schwartz1-1/+4
Follow-up on commit 5a7b8d86d0c455680096d47cb87f0de08c0954ac Sometimes, we find a parent meson.build which is also malformed, and we shouldn't suggest that maybe the user meant to use that, if it isn't a valid project() either. Do a rough and dirty check to see if the very first line is a project() declaration, and if not, don't try to be clever and suggest using it. The "invalid source tree" error suffices here, since we're not absolutely sure meson can be successfully run in that parent directory and actually advising people about the wrong location is a lot more confusing than just saying "please figure this out yourself, here is what to look for". Granted, we miss cases where project() comes after blank lines and/or comments, but doing a full AST parse here is excessively overkill and probably too painful to do, and we don't need to be *that* clever. So let's be content with merely going above and beyond the call of duty.
2021-08-22Add Java moduleTristan Partin2-4/+81
The Java module will serve as a source for easing Java development within Meson. Currently it only supports generating native header files.
2021-08-22Add typing to ModuleState machine membersTristan Partin1-4/+4
2021-08-22Add subscript to subprocess.PopenTristan Partin1-2/+2
2021-08-22fix coding errors in unstable-coredata subcommandEli Schwartz1-2/+2
One percent-formatted string had a .format() method style placeholder and thus never output anything other than TypeError: not all arguments converted during string formatting The other error may be due to changing format elsewhere, because it attempted to treat an entire tuple as though it only contained one element. Based on context, it's clear this is supposed to be the actual dependency name, but the internal representation may have changed over time. These fixes allow the command to run to completion successfully; of course it is still unstable and possibly not actually maintained, since it's been broken for 2 years and no one actually noticed.
2021-08-22use a more informative error message for invoking meson in a subdirEli Schwartz1-2/+14
Explicitly mention that the project definition is invalid, and clarify that project is `project()` -- a function. Also try to walk the directory tree upward, and if there are parent meson.build files, just say this isn't the project root, and "maybe you meant to run meson there instead?" This won't catch calls to subdir('foo/bar') but we can't be perfect, only better than before and catch the *majority* of such cases, and hopefully it's a lot more clear if meson protests that the project is "invalid, there is no project() function", where the user should look for a potential solution. Fixes #3426
2021-08-22Fix incomplete guidance on solving sandbox violationsEli Schwartz1-0/+4
We recommend people use declare_dependency and access it via dependency() in a parent project. But this requires a wrap file (or to use override_dependency and an explicit subproject call). Let's actually mention that. Fixes #9146
2021-08-21Fix duplicated frameworks in the Xcode backend.Jussi Pakkanen1-1/+7
2021-08-21Fix multiple generators in target in Xcode.Jussi Pakkanen1-2/+2
2021-08-21Path special casing for the Xcode backend.Jussi Pakkanen2-2/+10
2021-08-21Handle .C extension in Xcode.Jussi Pakkanen1-1/+4
2021-08-20Merge pull request #9012 from dcbaker/submit/qt-custom-targetsJussi Pakkanen1-38/+86
Qt module generated sources
2021-08-20backend/backends: use a TypedDict for introspection dataDylan Baker1-1/+11
Which is easier to reason about as a human, and narrower, allowing for more accurate type checking.
2021-08-20backend/backends: Add type annotations to BackendDylan Baker1-147/+223
2021-08-20backend/backends: Add verbose to ExecutableSerialisiation initializerDylan Baker1-1/+2
There are cases in the backend like this: ```python e = ExecutableSerialisation(...) e.verbose = v ``` setting it from the initializer is cleaner.
2021-08-20backend/backends: Add type annotations to ExecutableSerilalisationDylan Baker1-3/+12
2021-08-20backend/backends: Add type annotations to SubdirInstallDataDylan Baker1-1/+2
2021-08-20backend/backends: Add type annotations to TargetInstallDataDylan Baker1-3/+6
2021-08-20backend/backends: Add type annotations to CleanTreesDylan Baker1-1/+1
2021-08-20backend/backends: add type annotations to RegenInfoDylan Baker1-1/+1
2021-08-20backends/xcode: remove unused compiler parameter from escape_extra_argsDylan Baker1-2/+1
2021-08-20backends: remove unused name parameter from as_meson_exe_cmdlineDylan Baker4-10/+7
This parameter isn't used, at all, so just remove it
2021-08-20ninjabackend: add missing type annotationDylan Baker1-1/+1
I needed to figure this out for the purposes of annotating CleanTrees anyway.
2021-08-20backends: move method from ninjabackend to base classDylan Baker2-8/+8
The baseclass has code that assumes said method exists, and it really doesn't seem to do anything ninja specific, so move it to the generic backend.
2021-08-20compilers: Add get_no_warn_args to the base Compiler classDylan Baker1-0/+4
Because it should be defined there.
2021-08-20interpreterobjects: fix Test annotationsDylan Baker1-3/+6
2021-08-20environment: add annotations and fix get_meson_commandDylan Baker1-3/+7
It is theoretically possible for the command to be None so we should handle that.
2021-08-20environment: add some missing annotationsDylan Baker1-5/+5
2021-08-20mesonlib: Fix typing of substitute_valuesDylan Baker1-5/+27
This is really, really, annoying. What we really want is (psuedocode): ```python class SubValues(TypedDict[str, str], total=False): @INPUT@: T.List[str] @OUTPUT@: T.List[str] ``` Which would specifiy that `@INPUT@` and `@OUTPUT@` *may* be present and if they are, then they are lists. There may be additional keys, which have a single string as a value. Of course there is currently no way to do that with typing, so we have to instead take a union type and then use asserts to help the type checker unerstand this. More info: https://github.com/python/mypy/issues/4617
2021-08-20mesonlib: Add an exception for what should be unreachable codeDylan Baker1-0/+2
It gives us a little more saftey, and makes pylance happy.
2021-08-20mesonlib: Fix type annotationsDylan Baker1-5/+4
get_compiler_for_source and classify_unity_sources are both wrong, in that they expect to be given a seqence of strings, but they really should take a `Sequence[str | File]`. Additionally, they're using `CompilerType`, which we don't need anymore, and should stop using, most methods for the Compiler are actually defined in the base compiler class.
2021-08-20build: Add type annotations to Target.get_debug_filenameDylan Baker1-2/+2
2021-08-20build: Add annotations to the CustomTargetIndex classDylan Baker1-5/+4
These are not complete, and are just enough for backends/backends.py
2021-08-20build: Add a `name` property to CustomTargetIndexDylan Baker1-0/+4
This is needed to make CustomTargetIndex polymorphic with Target derived classes, and is used in the build module.
2021-08-20build: Fix CustomTarget initializer annotationDylan Baker1-1/+1
the `output` parameter is a string, not an int.
2021-08-20build: Add a couple of annotations to RunTargetDylan Baker1-1/+2
2021-08-20build: Add type annotations for CustomTargetDylan Baker1-12/+11
Again, this is not complete and is just enough for backend.py. Again, typing these is complicated massively by the layering violations in the Target classes and the interpreter.
2021-08-20build: type get_import_filenamesDylan Baker1-2/+2
2021-08-20build: Add some type annotations to BuildTargetDylan Baker1-24/+21
This is not complete, it's just enough for backend/backend.py. A more completely typing would be more difficult, especially whithout untangling the layering violation between the build targets and the interpreter.
2021-08-20build: Add type annotations for ExtractedObjectsDylan Baker1-11/+18
2021-08-20build: Add missing annotations for Build.get_* methodsDylan Baker1-4/+4
The underlying attributes are typed properly, but the getters are not
2021-08-20build: fix annotation for Build.targetsDylan Baker1-2/+2
This really does need to be an OrderedDict, not a MutableMapping, as there are consumers in the backend that need dictionary only methods.
2021-08-20build: add annotation for build.postconf_scriptsDylan Baker1-2/+2
2021-08-20backends/vs: add a missing annotationDylan Baker1-1/+1