| Age | Commit message (Collapse) | Author |
|
The cleanup this allows lower down points out that we don't properly
validate the value passed to `as_system()`. I have no idea what happens
if you pass a non-valid value, but it's a bug and I've simply made it a
hard error. We can re-assess if necessary.
|
|
This allows us to check that all of the keyword arguments are of the
correct type.
|
|
All that is needed is the subdir, pass it explicitly (and make it
an optional argument so that the backend does not have to pass it).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Objects like targets already store the environment in which they
were created, do the same for Generator: pass it to the constructor
and use it in process_files.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
There is no generator list in the Interpreter.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This reverts https://github.com/mesonbuild/meson/pull/15107
Explicit objections regarding the design were raised and not answered,
so it shouldn't have been merged. It needs to be discussed and
revisited.
|
|
|
|
|
|
This has the "processed" keyword arguments that the interpreter is
supposed to create for us, or that we expect internal users to build by
build.
This requires some hacking around in the rust module for the moment
because we suddenly have a type.
|
|
|
|
|
|
|
|
Meson sets 64-bit offsets as the default for all platforms but MSVC.
Lets do the same for bindgen, to ensure we get compatible definitions.
Do this by calling `get_always_args()` on the first C'ish host compiler
we can find.
Note that the `libc` crate does not expose 64-bit types as the default
and there is no intention to do so. Instead, it exposes 32-bit default
types, plus the 64-bit extended types with the `*64` suffix. This is
quite unfortunate, but it seems unlikely to change [1].
However, use of `bindgen` is usually not tied to the `libc` crate.
Instead, it is tied to whatever other C code in the same project does.
And Meson sets `_FILE_OFFSET_BITS=64` unconditionally for all this C
code. It thus seems much more plausible for Meson to also imply it for
bindgen.
Given that Rust code that uses the `libc` crate very likely already uses
the `*64` suffixed variants, they are unaffected by whether
`_FILE_OFFSET_BITS=64` is set. If they use `libc::off_t`, they already
explicitly state that they use the 32-bit variant on 32-bit platforms.
Hence, it is inherently incompatible to C code that uses
`_FILE_OFFSET_BITS=64`.
And lastly, if a Meson project is Rust-only, but generates its internal
code from its public C headers, then it is better suited to actually
call `add_language('c')` and ensure that Meson knows what the compiler
configuration for the target platform actually is. Otherwise, bindgen
cannot know what platform options to enable. Hence, warn loudly if
`rust.bindgen()` is used without a configured C compiler (even if the
compiler used by bindgen does not necessarily match the configured one).
[1] https://github.com/rust-lang/libc/issues/3223#issuecomment-2033298952
|
|
The `rc.exe` resource compiler neither provides *depfile* support nor
allows showing includes, as is possible with C or C++ compilers.
Therefore, changes to files included by the `.rc` file did not trigger
recompilation of the resource file.
A workaround was added to *meson* by calling the preprocessor on the
`.rc` file to detect the included headers and adding the result as a
dependency to the resource compilation.
|
|
There are a lot of spelled out unions for these types, lets reduce that
number
|
|
Fix the original bug fix for #13950 to only warn
about empty required strings, instead of failing
the entire build. This will simplify the workflow
for users that build the string from a possibly
empty list, and save them the need for the added
if-check.
Signed-off-by: Eyal Itkin <eyal.itkin@gmail.com>
|
|
Add missing checks for correctness of string dependency, including
case for malformatted versioned dependency.
Resolves #13950.
Signed-off-by: Eyal Itkin <eyal.itkin@gmail.com>
|
|
The method is unused since commit c8aecc768 ("hotdoc module: add partially typed
kwargs", 2022-10-24). Found while looking for callers of OptionStore.get_value.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
The two methods are identical.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Fixes #15054
|
|
The majority of this is just adding annotations to convince mypy that
everything is okay. There is one place where there is a real change,
which is validating that the keyword arguments (which are unbound) are
of a valid type to be encoded as JSON.
|
|
Reduces 3 errors that show up in newer mypy versions than pinned in CI.
It is new since 1.16 and a likely future default for mypy 2.0. It allows
things like:
```
for i in ['one', 'two', 'three']:
frob_a(i)
for i in [1, 2, 3]:
frob_b(i)
```
since "i" is obviously used as a loop holder and its type can be freely
reinvented. Note: allow-redefinition-new isn't actually about this at
all, it has greater scope than loop holders and allows redefining
"unannotated variables" of all kinds. No granularity in what to accept
redefinition of. :P
To enable this, we must also opt in to local-partial-types, which has
some overlap with None-safety. Specifically:
> the most common cases for partial types are variables initialized
> using None, but without explicit X | None annotations. By default, mypy
> won’t check partial types spanning module top level or class top level.
> This flag changes the behavior to only allow partial types at local
> level, therefore it disallows inferring variable type for None from two
> assignments in different scopes.
So with this, we also fix a couple of actual type errors this revealed.
Where possible, stop None-initializing at all -- it's not strictly
needed for global variables, anyway, and it's a coding error if it is
possible to hit these variables without defining them first.
Bug: https://github.com/python/mypy/issues/19280
|
|
Added in #14750 for 1.9.0.
Also add FeatureNew.
|
|
|
|
Signed-off-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Michał Górny <mgorny@quansight.com>
|
|
|
|
This reverts commit 5e627c9b421a4cebb0e112af6a432fec66640c28.
|
|
g-ir-scanner is a pair of Python script + pymod, and the latter must be
available at any time the script is executed. The changes in the below
commit removed the ordering guarantee, breaking GStreamer introspection
building on Windows when using the monorepo.
This reverts commit ab57be75148c2faac67dba7877167772410ca5ef.
Fixes #14908
|
|
We're going to use this in the Python module as well.
|
|
It is more logical, since those functions depend on a build target,
and do not require anything specific to the backend.
Furthermore, it will allow us to call determine_rpath_dirs from the
linker in a following commit, without the need to depend on the backend.
|
|
When giving a dependency object as requires, allow to use the dependency from a
subproject (that is an InternalDepdency).
|
|
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
|
|
_gir_has_option runs g-ir-scanner --help | grep <option> to determine if
the current version of g-ir-scanner supports a particular option. This
already early exists if g-ir-scanner is a OverrideProgram, as it cannot
be executed if it is (technically OverridePrograms can actually be
executed during configure time, but not g-ir-scanner; as it depends on
native modules). Do the same in case g-ir-scanner is an executable (it
currently isn't but I might want to move it into one, as to avoid the
rule-dependency issue with the aforementioned native module)
|
|
This requires g-ir-scanner >=1.85.0, if this isn't the case we'll just
fail.
|
|
The --version argument was only added in g-ir-scanner 1.58, but the
bionic ci still uses g-ir-scanner 1.56. Don't fail if that is the case
and assume the version comparison is void.
|
|
There isn't really any point in doing this, given that it doesn't
provide any headers & libraries by itself and means projects that
conditionally build introspection behind a feature only need to check
for the existence of g-ir-scanner, not gobject-introspection-1.0
anymore.
|
|
|
|
|
|
|
|
Rust doctests implicitly use the base target as a crate. This is not
possible unless the target uses the Rust ABI.
If someone uses a C-ABI target with rust.doctest(), you get an unresolved
module error and it is not clear what's really going on, so add a more
specific error. Cargo does the same, though it only reports a warning.
Fixes: #14813
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
I ran into GStreamer's CI being overwhelmed by a 5k long command line to
g-ir-scanner. This will help bypass the limitation.
See https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/532
See #6710
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
gdbus-docgen supports reStructuredText output since 2.71.1 and markdown
since 2.75.2, allow to simply generate it.
|
|
The CFLAGS environment variable is used for g-ir-scanner's linking pass,
It is emptied since commit 237513dff ("modules/gnome, modules/Python:
Allow injecting RPATH flags through LDFLAGS if needed", 2025-04-09);
which could even be considered a bugfix if it didn't break Fedora
quite badly.
I could not write a testcase, but the culprit seems to be the
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 that Fedora places
in CFLAGS. The file contains
*cc1_options:
+ %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}}
and the lack of -fPIE option upsets the linker. Fix by priming
the contents of the CFLAGS variable with the c_link_args being used
for the build.
Fixes: #14631
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Append to scan_env_ldflags instead of overwriting it.
Fixes: #14631
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Also ensure that .get_version() can be called on the output of
_find_tool by the modules (kind of required for #14422).
|
|
Fixes #6710
|
|
"rustdoc --test" relies on running host binaries, and has no way of wrapping
them with Meson's exe_wrapper. Just skip the doctests in that case.
Fixes: #14583
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Fixes #14270.
|
|
|