Skip to content

Conversation

@3v1n0
Copy link
Contributor

@3v1n0 3v1n0 commented Sep 11, 2025

GLib typelibs have changed in 2.86.0, see:

So, backporting the gjs changes that landed as part of:

I don't plan to update this MR much unfortunately, so this is a best effort to get the Gio and Intorspection tests to pass,

3v1n0 and others added 9 commits September 12, 2025 00:10
GLib will not expose anymore platform specific functions in Gio
namespace as it used to do when GI Repository 1.0 was used, in order to
keep retro-compatibility in gjs applications, generate wrappers for
Gio platform-specific definitions that we used to provide inside the
main Gio object, but warn the users of these APIs that they should
migrate to GioUnix or GioWin32 instead.
Expose it in the print module

Co-Authored-By: <marco.trevisan@canonical.com>
Re-use the C definition to warn when using a deprecated namespace
instead of doing the same in pure JS.
When using warnDeprecatedOncePerCallsite() from JS we need to use a
larger stack to track the call site, otherwise we may end up considering
the same call site for different actual callers.

In fact when using this in Gio.js override the call site is always the
same, but we care about where that function is being invoked from.
In previous versions of GLib, platform-specific symbols such as
GUnixMountMonitor were mapped in the Gio namespace as Gio.UnixMountMonitor,
while since commit 0565682 we create wrappers such as
Gio.MountMonitor.

This is not correct, and does not serve the initial purpose of providing
a backward compatible wrapper.

So, use the same logic that we had before: if the GType of a symbol starts
with G{Unix,Win32} we use the platform specific name as prefix of the
wrapper type, so that it will be Gio.{Unix,Win32}TypeName
JS functions have a name properties by default, but we did not implement
it for our function wrappers.

Given that there's no a defined specification for it and that it can be
used for debugging purposes, use it to store the original C function
name.
In case a platform-only function is being mapped inside the Gio
namespace and that has a platform-specific prefix, then we should use it
inside the more generic Gio namespace.

This is preserving the pre-girepository-2.0 behavior
GObject.type_default_interface_ref() is no longer
introspectable for some reason, but as it is deprecated
in favor of GObject.type_default_interface_get() anyway,
use that instead.
@leigh123linux
Copy link
Member

It works fine here, I didn't use the cinnamon PR, just a rebuilt cinnamon against patched cjs and glib-2.86
Thank you for the PR.

image

@mtwebster mtwebster merged commit 1f39576 into linuxmint:master Sep 15, 2025
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants