summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* gimarshallingtests: Add some-string property to PropertiesObjectMarco Trevisan (Treviño)2022-01-112-0/+17
| | | | It's the only basic type missing, better to have for consistency.
* regress: Add a function to enable conversion between different fundamentalMarco Trevisan (Treviño)2022-01-114-147/+184
| | | | | We want to be able to test whether it's possible to convert two different fundamental types through GValue, so add a function for this.
* Regress: Add further subtype of fundamental with no set/get functionsMarco Trevisan (Treviño)2022-01-114-151/+242
| | | | | This can be used to test we don't do unexpected conversions between invalid types.
* regress: Add Fundamental type with no set/get-value-func'sMarco Trevisan (Treviño)2022-01-1126-149/+1184
| | | | | | | | | | A fundamental type may or may not provide set and get value functions, the regress implementations always provide one, so define a new type with no such functions so that we can test this case in Gjs. To avoid repeating lots of duplicated code, we re-use the same functions of RegressTestFundamentalObject when possible, by using the same structure.
* ci: Update the Docker imagesEmmanuele Bassi2022-01-113-4/+4
|
* ci: Update the installed version of MesonEmmanuele Bassi2022-01-114-4/+4
|
* cmph: Handle fgets() return valueEmmanuele Bassi2022-01-111-1/+1
| | | | | Newer versions of the GNU libc have started to warn if the result of the call is unused.
* build: Do not use deprecated APIEmmanuele Bassi2022-01-112-11/+11
|
* build: Avoid the doctemplates hackEmmanuele Bassi2022-01-114-22/+98
| | | | | | | | | | | | The hack that copies the doctemplates directory into the build directory has stopped working with newer versions of Meson; while it's possible to copy files, custom_target() cannot depend on a directory. Additionally, the dependency has always been broken. Instead, we enumerate the template files—after all, it's not like they change a lot—and then we list them as dependencies for the test targets. Fixes: #414
* Depend on Meson >= 0.58.2Emmanuele Bassi2022-01-111-1/+1
| | | | | We are going to use additional API that is only available since 0.57, but since 0.57 is a very old version, let's skip it.
* doctool: Add templates_dir CLI argumentEmmanuele Bassi2022-01-112-7/+11
| | | | | | We can find the templates directory using the module file once installed, but when running uninstalled we need to have a way to specify where the templates can be found in the sources directory.
* Add "forever" scopeEmmanuele Bassi2022-01-098-11/+22
| | | | | | | | Some functions are meant to exist for the entire duration of the process, and thus have no need for a notification function because one will never be called. Fixes: #49
* license: Update FSF addressDavid King2022-01-092-7/+6
|
* Update giannotations.rst Emmanuele Bassi2021-12-071-9/+9
| | | | | | Don't use a real function to describe optional/nullable differences, to avoid getting into the weeds when it comes to edge cases. Fixes: #211
* Update build_test.rst Emmanuele Bassi2021-12-071-21/+5
| | | | | Remove mentions of Autotools: we only support Meson. Fixes: #327
* gitypelib.c: on macOS, treat @-prefixed shlib paths as absoluteRok Mandeljc2021-11-271-0/+10
| | | | | | | | On macOS, @-prefixed shlib paths (@rpath, @executable_path, and @loader_path) need to be treated as absolute. Trying to combine them with a configured library path produces a mangled path that is unresolvable and may cause unintended side effects (such as loading the library from a fall-back location on macOS 12.0.1).
* Do not use GLib versioning symbolsEmmanuele Bassi2021-11-241-30/+40
| | | | | | | | | Libgirepository is not GLib, and it should not use GLIB_DEPRECATED, GLIB_DEPRECATED_FOR, and GLIB_UNAVAILABLE macros (as the GLib documentation clearly states). When using them, we don't get the proper macro expansion, so deprecated symbols suddenly disappear from our shared library.
* Correct logic for legacy ffi free_closureCimbali2021-11-231-1/+2
| | | | | | Legacy logic, except: - on linux with recent libffi - on macOS with AMD64 architectures
* Remove runtime warnings, add doxygen deprecation noticesCimbali2021-11-231-8/+8
|
* Fix styling issues from suggestionsEmmanuele Bassi2021-11-231-5/+7
|
* Avoid leaking memory from FFI closure if no segfault riskCimbali2021-11-232-4/+13
|
* Create new API for libffi closuresCimbali2021-11-233-16/+94
| | | | Deprecate the previous API as per discussion in !283.
* girffi.h: add g_callable_info_get_closure_native_address() APISergei Trofimovich2021-11-232-0/+22
| | | | | | | | | | | | | Commit 6bab939bf ("girffi.c: fix return value for g_callable_info_prepare_closure()") effectively changes semantics of return value from code pointer to data pinter (closure). `gjs` (and probably other software) relies on old (incorrect) semantics of g_callable_info_prepare_closure(): https://gitlab.gnome.org/GNOME/gjs/-/issues/428 This change exposes the API that allows extracting directly callacble code pointer. `gjs` will have to adapt to the new API. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* girffi.c: fix return value for g_callable_info_prepare_closure()Sergei Trofimovich2021-11-231-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initial failure was observed on `meld` against recently released `libffi-3.4-rc1`. There `meld` crashes as: ``` $ meld Segmentation fault (core dumped) $ gdb --args /usr/bin/python3.9 /usr/bin/meld (gdb) run ... Thread 1 "python3.9" received signal SIGSEGV, Segmentation fault. 0x00007fffe9ac1ae8 in g_callable_info_free_closure ( callable_info=0x555555d45990, closure=0x7fffe9e70c20) at ../gobject-introspection-1.68.0/girepository/girffi.c:428 428 g_free (wrapper->ffi_closure.cif->arg_types); (gdb) bt callable_info=0x555555d45990, closure=0x7fffe9e70c20) at ../gobject-introspection-1.68.0/girepository/girffi.c:428 data=0x555555d252d0) at ../pygobject-3.40.1/gi/pygi-closure.c:635 ... ``` The bug here is in type mismatch between expected return value of `g_callable_info_prepare_closure()` and actual value (executable code pointer): ```c ffi_closure * g_callable_info_prepare_closure(...) { gpointer exec_ptr; ... status = ffi_prep_closure_loc (&closure->ffi_closure, cif, callback, user_data, exec_ptr); return exec_ptr; } ``` Note: `exec_ptr` is a code pointer that could be directly executed by caller, like `((rt (*)(a1,a2))exec_ptr)(1,2);` It should never be wrapped into an `ffi_closure*`, which is normally called via `ffi_call(closure, ...)`. We see the problem when we try to free direct code pointer instead of `ffi_closure()` as starting from libffi-3.4 executable trampoline and `ffi_closure()` don't necessarily live in the same block: https://github.com/libffi/libffi/commit/9ba559217bea0803263a9a9a0bafcf9203606f5b Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Open g-i for 1.71 developmentEmmanuele Bassi2021-11-231-1/+1
|
* docwriter.py: change DocFormatterGjs to return Uint8ArrayAndy Holmes2021-11-231-1/+1
| | | | | | GJS now maps GLib.ByteArray and GLib.Bytes to Uint8Array whenever possible. Change the string returned by docwriter for devdocs to reflect that.
* ci: Fix pcre subproject promotionEmmanuele Bassi2021-11-071-1/+1
| | | | | The pcre subproject in GLib was renamed, so we need to fix the incantation that promotes the subproject in our own CI.
* docs: Point to the GObject reference on docs.gtk.orgEmmanuele Bassi2021-11-072-5/+3
| | | | Do not use the snapshot of the old developer.gnome.org website.
* docs: Point to the GitLab page for libgrepository's API referenceEmmanuele Bassi2021-11-072-3/+3
| | | | | Do not use the snapshot of the old developer.gnome.org website; we generate and publish the API reference ourselves.
* docs: Fix documentation links in the GIR schemaEmmanuele Bassi2021-11-071-6/+6
|
* giscanner.ast: map uintptr_t and intptr_tMarc-André Lureau2021-10-281-0/+2
| | | | | | | | | Those types should map by definition to guintptr and gintptr. They are fairly common in Rust cbindgen projects, which maps usize->uintptr_t for ex. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* Post-release version bump to 1.70.1masterEmmanuele Bassi2021-09-171-1/+1
|
* Relase GObject-Introspection 1.701.70.0gi-release-1-70Emmanuele Bassi2021-09-172-1/+6
|
* Update the annotations for GLib 2.70Emmanuele Bassi2021-09-173-4/+47
| | | | | | | GLib 2.70 has just been released, so let's sync up the documentation and annotations. Fixes: #402
* Update the GLib annotationsglib-annotationsEmmanuele Bassi2021-08-241-9/+11
|
* Post-release version bump to 1.69.1Emmanuele Bassi2021-08-241-1/+1
|
* Release gobject-introspection 1.69.01.69.0Emmanuele Bassi2021-08-241-0/+16
|
* scanner: Handle constructors with mismatched GTypesEmmanuele Bassi2021-08-161-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For historical reasons, we have boxed types that do not follow the typical conversion from CamelCase to snake_case when it comes to their get_type function. The introspection scanner will correctly detect that a type is matched to that get_type function, but then it will default to tokenize the get_type function to set the c_symbol_prefix of the given type. The method pairing code in the main transformation path takes that mismatch into consideration, but the constructor pairing code does not. This leads to interesting cases, like GString. GString is correctly detected as GLib.String, and correctly matched to its `g_gstring_get_type()` type function, but its c_symbol_prefix is set to `gstring` after the tokenization. While methods like `g_string_append()` are correctly paired to the `GLib.String` node, constructors like `g_string_new()` do not, and end up being turned into function nodes, like `GLib.string_new`, even if they are annotated as constructors. I'm not entirely confident that changing the c_symbol_prefix tokenization this late in the game is going to be free of regressions; instead, we provide a way for pairing constructors if they are annotated as such. In other words: non-annotated constructors of types that have a different symbol prefix than the one of the get_type function will stay as they are today—a global function. To enforce the matching, we rely on an explicit `(constructor)` annotation; at least, this should ensure that we have explicit buy in from the maintainers of the API. Fixes: #399
* docs: Fix the "final" attribute in the GIR schemaEmmanuele Bassi2021-08-051-1/+1
| | | | | | The "final" attribute is not namespaced. Like "abstract", the "final" flag is shared across type systems, it's not strongly related to GObject types.
* Ignore accessor annotations for non-introspectable propertiesEmmanuele Bassi2021-08-052-3/+29
| | | | | | | If a property is not introspectable we need to decouple it from its accessors; the property data will not be compiled into the typelib, and when the compiler will try to resolve the offsets into the binary blob we'll get a fatal exception.
* Improve readability of error messageEmmanuele Bassi2021-08-051-3/+3
| | | | | Use the parent type and the function symbol when erroring out if we can't find a property accessor.
* Improve getter function matching heuristicEmmanuele Bassi2021-08-051-8/+13
| | | | | | | Some readonly boolean properties in the form of 'has-foo' or 'is-bar' expose a getter function in the form of `get_has_foo()` or `get_is_bar()`, according to extant coding practices. We should ensure we still check for those.
* scanner: Warn if property annotations are mismatchedEmmanuele Bassi2021-08-052-17/+37
| | | | | | If the (set-property) and (get-property) annotations on methods do not round trip with the (setter) and (getter) annotations on the corresponding property, we want to emit a warning.
* docs: Clarify scope of property-related annotationsEmmanuele Bassi2021-08-051-4/+4
| | | | | | | | The `set-property` and `get-property` identifier annotations only apply to methods. The `setter` and `getter` identifier annotations only apply to properties.
* Use a macro for the missing accessor sentinel valueEmmanuele Bassi2021-08-053-8/+10
| | | | Easier to read than `0x3ff`.
* scanner: Add an heuristic for property gettersEmmanuele Bassi2021-08-051-1/+6
| | | | | | | | If a property is boolean and read-only, the getter method can be the same as the property name, for instance: - gtk_widget_has_focus() - gtk_media_stream_has_audio()
* scanner: Try to pair properties with accessor methodsEmmanuele Bassi2021-08-052-2/+30
| | | | | | | The heuristic is pretty trivial: for any given non-construct-only, writable property, we check if there's a `set_<property>` method; for any given readable property, we check if there's a `get_<property>` method.
* docs: Clarify the meaning of accessor functionsEmmanuele Bassi2021-08-051-4/+16
| | | | | Public accessor functions are the functions typically called through g_object_set_property() and g_object_get_property().
* Document the new property accessors annotationsEmmanuele Bassi2021-08-052-0/+12
|
* tests: Add a Regress test for the property accessors annotationsEmmanuele Bassi2021-08-052-5/+9
|