Commit Graph

29945 Commits

Author SHA1 Message Date
Philip Withnall
06a7258a8c girepository: Add g_autoptr() and g_auto() support
This should make the code a bit more usable in situations where people
aren’t potentially using MSVC.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3255
2024-02-14 11:54:48 +00:00
Philip Withnall
39afe18221 girepository: Add GI_REPOSITORY_LOAD_FLAG_NONE
This just makes code using the load flags a little more readable.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-14 11:54:21 +00:00
Philip Withnall
f4f38c233f girepository: Move internal gi_typelib_blob_type_to_info_type() function
`GITypeInfo` isn’t defined in `libgirepository-internals`, and that was
forcing us to do some header includes which violated the layering
between `libigrepository-internals` and `libgirepository`. Fix that by
moving the helper function to the header/source where `GITypeInfo` is
defined.

This fixes commit 54f156bd63.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-14 11:52:33 +00:00
Philip Withnall
75820a6941 gibaseinfo: Remove an unused private macro
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-14 11:52:02 +00:00
Philip Withnall
ec9a73a262 gibaseinfo: Allow gi_base_info_clear() to be idempotent
When called on an already-cleared `GIBaseInfo` it should do nothing.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Fixes: #3255
2024-02-14 11:51:08 +00:00
Simon McVittie
f80e978f00 girwriter: Take the GIRepository as a parameter
We certainly won't find the requested namespace in a newly-created
repository with no typelibs loaded.

Fixes: 9ab84bc1 "girwriter: Stop using the singleton GIRepository"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-14 11:13:04 +00:00
Simon McVittie
e6d2c2c040 g-ir-compiler: Only accept one input file
The positional parameters are declared as G_OPTION_ARG_FILENAME_ARRAY,
but only the first one is used.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-14 11:11:14 +00:00
Yuri Chornoivan
b974fa4e50 Update Ukrainian translation 2024-02-14 11:00:38 +00:00
Simon McVittie
4180a2069c gi-decompile-repository: Remove unused --shlib option
This seems to have been a remnant of support for embedding the typelib
in the shared library, which was removed from this tool in commit 4bf5ef6b
"[girepository] Actually verify header of loaded typelibs in
g_irepository_require" (originally gobject-introspection@05ffd857).

The feature of embedding the typelib in a shared library was itself
removed in commit b2df59c3 "compiler: Remove --code argument",
originally gobject-introspection@ac81f3e8, with a note that because
we rely on being able to load the shared library into g-ir-scanner,
anything that links g-ir-scanner output into the shared library would be
a circular dependency.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-14 10:42:39 +00:00
Simon McVittie
d40e1b9db3 gi-compile-repository: Make file-scoped variables static
This means the compiler will warn us if they become unused.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-14 10:36:34 +00:00
Simon McVittie
3f6de0706e girparser: Don't rely on gi-compile-repository exporting debug level
It seems cleaner to store this in the parser, rather than having the
compiler export a global variable that the parser must read.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-14 10:36:34 +00:00
Simon McVittie
a41496643b gi-compile-repository: Remove unused variable
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-14 10:21:44 +00:00
Simon McVittie
d3325bf879 gi-compile-repository: Remove unused --module option
This hasn't actually done anything since commit 45a04358
"[gircompiler] Clean up parsing" (originally
gobject-introspection@8942500c).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-14 10:20:08 +00:00
Ekaterine Papava
5d2ac37d5d Update Georgian translation 2024-02-14 09:30:19 +00:00
Philip Withnall
43924f7cf5 Merge branch 'fix-issue-3210' into 'main'
GWinHttpFile: Add support for G_FILE_ATTRIBUTE_STANDARD_TYPE

Closes #3210

See merge request GNOME/glib!3908
2024-02-14 09:22:36 +00:00
Luca Bacci
6ee0772146 GWinHttpFile: Add support for G_FILE_ATTRIBUTE_STANDARD_TYPE
Fixes #3210
2024-02-14 10:06:50 +01:00
Daniel Rusek
48e3fa1e17 Update Czech translation 2024-02-14 00:26:44 +00:00
Philip Withnall
3a2dea839b Merge branch 'wip/pwithnall/gutils-user-database-crash' into 'main'
ci: Fix printing the execution environment

See merge request GNOME/glib!3921
2024-02-13 23:44:56 +00:00
Yuri Chornoivan
4d120017e4 Update Ukrainian translation 2024-02-13 17:58:24 +00:00
Artur S0
8478898242 Update Russian translation 2024-02-13 16:38:19 +00:00
Philip Withnall
f3064e8a5c gutils: Make a variable const to avoid an unnecessary cast
And fix a typo in a comment. This introduces no functional changes.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-13 15:22:04 +00:00
Philip Withnall
7420f9eccd ci: Fix printing the execution environment
Deriving from two templates means the `before_script` from the second
one overrides, rather than adding to, the one from the first.

Avoid that when using `.build-linux` and `.with-git` by explicitly
joining both scripts.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-13 15:22:04 +00:00
Philip Withnall
060a7c2740 Merge branch 'wip/smcv/issue3252' into 'main'
gdatetime: Fix ja_JA.eucjp expectations when eras are unsupported

Closes #3252

See merge request GNOME/glib!3920
2024-02-13 13:31:29 +00:00
Emmanuele Bassi
7d6b2d7385 Merge branch 'wip/smcv/i386' into 'main'
girepository test: Don't assume doubles are naturally-aligned

See merge request GNOME/glib!3923
2024-02-13 12:27:07 +00:00
Philip Withnall
25c68a16e0 Merge branch 'wip/smcv/gdatetime-assertions' into 'main'
gdatetime test: Produce more helpful output on mismatches

See merge request GNOME/glib!3922
2024-02-13 11:57:00 +00:00
Simon McVittie
2b2b6de70b girepository test: Don't assume doubles are naturally-aligned
On i386 Linux, the minimal ABI alignment of a double is only 4, and
therefore the alignment of GDoubleIEEE754 is also 4.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-13 11:33:54 +00:00
Philip Withnall
c250c7b925 Merge branch 'lint-no-valgrind' into 'main'
tests: Don’t run lint tests under valgrind

See merge request GNOME/glib!3918
2024-02-13 11:00:46 +00:00
Simon McVittie
9ceed6f0de gdatetime test: Produce more helpful output on mismatches
It's helpful for the assertion message to say what we were expecting and
what we actually got. It's also useful to have g_test_message()
diagnostics to indicate how far into the test we were.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-13 10:39:49 +00:00
Simon McVittie
342d6176e7 gdatetime: Exercise %c, %C format placeholders in ja_JP.eucjp
Previously we didn't test these at all, which made it hard to determine
whether %Ec, %EC had appropriate output on platforms where era-based
dates are unsupported. Now we do, and we can observe that on platforms
with no support for era-based dates, %c matches %Ec and %C matches %EC,
as desired.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-13 10:20:11 +00:00
Simon McVittie
988f4204a1 gdatetime: Fix ja_JA.eucjp expectations when eras are unsupported
I can't read Japanese, but these match the output of:

    env TZ=UTC LC_ALL=ja_JP.eucjp date -d2009-10-24T00:00:00Z '+%c' | iconv -f eucjp -t UTF-8
    env TZ=UTC LC_ALL=ja_JP.eucjp date -d2009-10-24T00:00:00Z '+%C' | iconv -f eucjp -t UTF-8

which seem like a reasonable thing to use as a reference.

According to Google Translate, 平成 refers to the Heisei era, which was
current during 2009, and seems unreasonable to expect as output on a
platform where era-based dates are unsupported.

Resolves: https://gitlab.gnome.org/GNOME/glib/-/issues/3252
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-13 10:20:02 +00:00
Philip Withnall
c0f5e6d217 Merge branch 'threadtests-performance' into 'main'
tests: Speed up threaded toggle notify test unless -m slow is passed

See merge request GNOME/glib!3919
2024-02-13 09:46:15 +00:00
Ekaterine Papava
4d7409334e Update Georgian translation 2024-02-13 09:45:09 +00:00
Philip Withnall
3c39a23a7e tests: Speed up threaded toggle notify test unless -m slow is passed
On a fast laptop, this test currently takes about 7s to run, which is a
significant portion of the overall test suite time.

On a slower CI machine, especially running the test under valgrind, the
test can time out.

There’s no need to always run so many iterations: we run the tests under
CI so often that it’s likely a failure will eventually be hit (if there
is a bug) even with fewer iterations. We also now run the tests once a
week with `-m slow`, so the original iteration count will also still be
used then.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-13 08:52:15 +00:00
Philip Withnall
80e878005f tests: Don’t run lint tests under valgrind
That’s not useful, as the lint tests aren’t actually GLib code.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-13 08:41:59 +00:00
Philip Withnall
342fa9c161
2.79.2
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-12 23:36:25 +00:00
Philip Withnall
6791878b97 Merge branch '3037-split-platform-docs' into 'main'
introspection: Generate separate GIR files and documentation for platform specific APIs

See merge request GNOME/glib!3892
2024-02-12 18:57:50 +00:00
Philip Withnall
19308d6c18 introspection: Re-add platform specific APIs to GLib-2.0.gir and Gio-2.0.gir
To avoid a big introspection API break.

These APIs are now listed in the new `{GLib,Gio}{Unix,Win32}-2.0.gir`
files, but for backwards compatibility they need to continue to be
listed in `Gio-2.0.gir` and `GLib-2.0.gir` as well, until the next major
introspection API break (and none is planned).

No new platform specific APIs should be added to these GIR files, but
these existing ones must remain.

See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3892#note_2001361

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-12 17:54:36 +00:00
Philip Withnall
4314944e56 introspection: Drop Unix and Win32 prefixes from platform specific APIs
So now introspection users will have to call `GLibUnix.open_pipe()`
rather than `GLibUnix.unix_open_pipe()` — or
`GLibWin32.check_windows_version()` rather than
`GLibWin32.win32_check_windows_version()`.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2024-02-12 17:54:36 +00:00
Philip Withnall
2b4bfadfb7 tests: Remove an unnecessary include from test-common.h
It causes a build failure on mingw32, as `_WIN32_WINNT` is redefined.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-12 17:54:36 +00:00
Philip Withnall
c428d6e673 ci: Build and tar the platform specific documentation
Enable the msys2-mingw32 CI job for merges, just like the fedora-x86_64
job is. The pair of them can then build the platform specific GIR and
documentation files.

The `download-reference.sh` script in the `docs-gtk-org` branch of GTK
can then download the docs as an artifact from the latest GLib build of
`main`, and publish them on docs.gtk.org, as is currently done for the
platform agnostic documentation.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2024-02-12 17:54:35 +00:00
Philip Withnall
434d3ff524 docs: Mention GioUnix-2.0 GIR namespace alongside gio-unix-2.0.pc
This should clarify things a little for users of language bindings, who
don’t directly use `.pc` files.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-12 17:54:10 +00:00
Philip Withnall
c498c9a8c9 docs: Split out platform specific GIO and GLib documentation
This creates `GioUnix`, `GioWin32`, `GLibUnix` and `GLibWin32`. These
bodies of documentation are in addition to the main, platform agnostic,
documentation for both libraries.

This commit necessarily includes various mechanical changes to update
the repository namespace used in various existing documentation links to
platform specific APIs.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2024-02-12 17:54:10 +00:00
Philip Withnall
5021d002ab introspection: Generate separate GIR files for platform specific APIs
For both GLib and GIO. (GObject, GIRepository and GModule don’t have any
platform specific APIs.)

This is needed for two reasons:
 * If the same GIR file is shipped on multiple platforms, it has no way
   to conditionally define/not-define an API based on the platform (like
   an `#ifdef` in a C header). So we either end up shipping differing
   GIR APIs on different platforms, or shipping a GIR file which
   declares APIs which aren’t resolvable by `dlopen()` on certain
   platforms, and will cause a language runtime error.
 * The API reference documentation is now generated from the GIR, and
   similar problems are present there: if the GIR contains different
   symbols depending on the platform, there is no way to generate API
   documentation for the union of all of them.

The fix is to ensure that there are no conditional symbols in a GIR, by
splitting out the platform specific symbols into platform specific GIR
files. Platform specific documentation can then be generated from these,
in addition to the main, platform agnostic, documentation.

The documentation changes will following in a subsequent commit.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2024-02-12 17:54:10 +00:00
Philip Withnall
1f9e44d623 glib: Install platform specific headers in a separate step
Maintain them in separate lists within `meson.build`. This makes no
functional difference at the moment, but will be used in an upcoming
commit to generate separate GIR files per platform.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2024-02-12 17:54:10 +00:00
Philip Withnall
0d9170c6b8 gio: Remove unnecessary appinfo_sources variable
There was no obvious logical need to list the `GAppInfo` subclass
sources separately in the build. It makes more sense to add them to the
platform-specific source lists, since they are platform specific.

This will be used in an upcoming commit which generates
platform-specific GIR files, so needs the full platform-specific lists
of sources.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2024-02-12 17:54:10 +00:00
Philip Withnall
f63cc38328 gfiledescriptorbased: Move across typedef from giotypes.h
`GFileDescriptorBased` is in `gio-unix-2.0` rather than `gio-2.0`, so
its types shouldn’t be declared in a header belonging to the latter.

This hasn’t been a problem previously because C is fine with that. But
upcoming commits are going to split the introspection scanning for
`gio-2.0` and `gio-unix-2.0`, and the introspection scanner is a little
more picky about declarations not being spread all over the place.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2024-02-12 17:54:10 +00:00
Philip Withnall
4c178fa623 build: Combine duplicate urlmap.js files
Seems no point in keeping them separate. It doesn’t seem to matter if
they contain entries which are unused for a particular docs build.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-12 17:54:10 +00:00
Philip Withnall
3695249ebb docs: Drop unnecessary GdkPixbuf reference from urlmap.js
It was unused.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-12 17:54:10 +00:00
Philip Withnall
e58abedf28 Revert "gwin32: Un-hide symbols when building GIR"
This reverts commit 50d432c77b.

The platform-specific headers of GLib and Gio are now introspected
separately, so the documentation for them can be built separately, and
this workaround is no longer needed.

Helps: #3037
2024-02-12 17:54:10 +00:00
Philip Withnall
19f7143ae2 Merge branch 'build-girepository-docs' into 'main'
ci: Build and tar libgirepository documentation

See merge request GNOME/glib!3917
2024-02-12 17:34:35 +00:00