Commit Graph

19086 Commits

Author SHA1 Message Date
Christoph Reiter
180e59539c build: work around meson issue with too long filenames on Windows. Fixes #1556
When using glib as a meson subproject on Windows the build currently fails
due to too long paths during the build process. See
https://github.com/mesonbuild/meson/issues/4226 for the upstream bug.

To work around the issue shorten the filenames of the generated gdbus files.
2018-10-04 10:45:45 +02:00
Philip Withnall
da8f1c6ac3 Revert "ci: Enable FreeBSD CI"
This partially reverts commit bfc362cb68.

The FreeBSD CI runner still seems to be a bit flakey, and appears to be
offline entirely at the moment.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Reviewed-by: nobody
2018-10-03 13:12:22 +01:00
Philip Withnall
7b5756577f Merge branch 'fix-leaking-g_get_language_names_with_category' into 'master'
gcharset: fix leaking g_get_language_names_with_category

See merge request GNOME/glib!338
2018-10-02 10:42:14 +00:00
Philip Withnall
5002d87dec Merge branch '1525-task-result' into 'master'
gtask: Check an error hasn’t been returned when calling g_task_return*()

Closes #1525

See merge request GNOME/glib!368
2018-10-02 10:07:49 +00:00
Philip Withnall
290bb0dd1b gtask: Compress GTask struct using a bitfield
There are a lot of gbooleans in the private GTask struct, which seems a
bit wasteful. Use a bitfield to compress the struct a bit.

This reduces the size of the struct from 216 bytes to 168 bytes on my
64-bit machine.

One of the fields needs to remain separate, since it’s used from a
TRACE() macro which calls typeof() on it.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-10-02 09:59:13 +01:00
Philip Withnall
f0cecba199 tests: Add return ordering tests for GTask
These are based on an example test program provided by Will Thompson in
issue #1525.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1525
2018-10-02 09:59:13 +01:00
Philip Withnall
32e049b761 Merge branch 'win32-gstat-for-ucrt' into 'master'
W32: gstat fixes for ucrt

Closes #1452

See merge request GNOME/glib!257
2018-10-02 08:55:45 +00:00
Philip Withnall
bea3770935 gtask: Check an error hasn’t been returned when calling g_task_return*()
These functions already check to see if a successful result has already
been returned; expand them to also check to see if an error has been
returned.

We can’t just check GTask.result_set, as that’s actually an indicator
for whether the GTask.result member is filled — when
g_task_propagate_*() is called, it’s cleared again. We need a new state
bit.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1525
2018-10-01 21:45:48 +01:00
Philip Withnall
03232bd6a6 tests: Fix location of an unref in the GTask tests
This method drops the last reference *it* owns to the GTask, but then
continues to call methods on the GTask. This wasn’t resulting in
failures because a ref in another thread kept the GTask alive, but
that’s quite dodgy.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-10-01 21:45:48 +01:00
Philip Withnall
846a61457a Merge branch 'wjt/g_desktop_app_info_get_string_list' into 'master'
Add g_desktop_app_info_get_string_list(); fix g_key_file_free()

See merge request GNOME/glib!339
2018-10-01 19:21:05 +00:00
Will Thompson
5ca9eca632 gdesktopappinfo: add get_string_list() function
The X-Flatpak-RenamedFrom key is used in .desktop files to identify past
names for the desktop file. It is defined to be a list of strings.
However, there was previously no correct way to retrieve a list of
strings from the GKeyFile wrapped by GDesktopAppInfo, short of
re-parsing the file with GKeyFile.

Note that doing something like:

    g_strsplit (g_desktop_app_info_get_string (...), ";", -1)

is not correct: the raw value "a\;b;" represents the one-element list
["a;b"], but g_key_file_get_string() rejects the sequence "\;", and so
g_desktop_app_info_get_string() returns NULL in this case. (Of course, a
.desktop file with a semicolon in its name is a pathological case.)

Add g_desktop_app_info_get_string_list(), a trivial wrapper around
g_key_file_get_string_list(), similar to g_desktop_app_info_get_string()
and co.

The change from g_key_file_free() to g_key_file_unref() in the test is
needed because g_key_file_free() clears the contents of the keyfile.
This is fine for all the fields which are eagerly loaded and copied into
GDesktopAppInfo, but not when we want to access arbitrary stuff from the
keyfile.
2018-10-01 20:03:55 +01:00
Philip Withnall
e1f4ff6c25 Merge branch 'non-POSIX-spawn' into 'master'
Fix build failure on systems without POSIX spawn

See merge request GNOME/glib!345
2018-09-29 09:18:15 +00:00
Philip Withnall
4c05f339a9 Merge branch 'wip/lantw/enable-freebsd-ci' into 'master'
ci: Enable FreeBSD CI

See merge request GNOME/glib!364
2018-09-29 09:16:32 +00:00
Ryan Schmidt
a187c89002 Fix build failure on systems without spawn.h 2018-09-28 23:50:40 -05:00
Ting-Wei Lan
bfc362cb68 ci: Enable FreeBSD CI 2018-09-29 01:05:39 +08:00
Xavier Claessens
6e0a03ee07 Merge branch '1536-link-whole' into 'master'
Meson: Fix static linking of convenience libraries

Closes #1536

See merge request GNOME/glib!357
2018-09-28 14:54:40 +00:00
Simon McVittie
62af03bda8 Meson: Extract objects from convenience libraries to link them
This avoids the convenience library being treated as though it was
an installed static library (objects not included in the dependent
static library, and convenience library being listed in the pkg-config
metadata), both of which would make static linking impossible.
This is a workaround for meson not having
https://github.com/mesonbuild/meson/pull/3939 merged yet.

Fixes: https://gitlab.gnome.org/GNOME/glib/issues/1536
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-28 15:15:48 +01:00
Philip Withnall
0e117cffa5 Merge branch 'ci-meson-0-48' into 'master'
Ci meson 0 48

See merge request GNOME/glib!347
2018-09-28 13:47:40 +00:00
Philip Withnall
c824ffd377 Merge branch 'wip/rishi/docs-garray' into 'master'
Documentation tweaks for g_array_free

See merge request GNOME/glib!348
2018-09-28 13:06:04 +00:00
Xavier Claessens
24d7a73b93 Meson: Bump dependency to 0.48.0 2018-09-27 16:01:41 -04:00
Xavier Claessens
4b983e5122 ci: Upgrade meson to 0.48.0 and use --fatal-meson-warnings 2018-09-27 16:00:53 -04:00
Xavier Claessens
686d60d77b Merge branch 'printf' into 'master'
Tests: Mark printf wrappers with G_GNUC_PRINTF

See merge request GNOME/glib!363
2018-09-27 18:23:07 +00:00
Simon McVittie
6b0b4381bf Tests: Mark printf wrappers with G_GNUC_PRINTF
If we tell clang that we're passing the arguments on to a compatible
printf call, it can see that we're doing it right, and won't warn us
about -Wformat-nonliteral. This follows up from commit abac67c0.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-27 09:21:32 +01:00
Emmanuele Bassi
b71d7e4b33 Merge branch 'cross' into 'master'
Autotools: Always run glib-genmarshal, even if cross-compiling

Closes #1546

See merge request GNOME/glib!362
2018-09-26 21:16:17 +00:00
Simon McVittie
a5e900c329 Merge branch 'libmount' into 'master'
Autotools: Move libmount from Libs.private to Requires.private

See merge request GNOME/glib!358
2018-09-26 16:24:44 +00:00
Xavier Claessens
3b61570e06 Merge branch '1514-appinfo-test' into 'master'
Meson: appinfo tests are racy if run in parallel

Closes #1514

See merge request GNOME/glib!356
2018-09-26 16:13:48 +00:00
Simon McVittie
129512b67c Autotools: Always run glib-genmarshal, even if cross-compiling
glib-genmarshal is now written in Python rather than C, so we can
always run it directly, even if we're cross-compiling for an
architecture whose binaries we can't run. This matches the behaviour
of the Meson build system.

Fixes: https://gitlab.gnome.org/GNOME/glib/issues/1546
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908334
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-26 16:57:57 +01:00
Simon McVittie
59f3c1f17a Autotools: Move libmount from Libs.private to Requires.private
libmount depends on libblkid, so if we statically link a trivial
executable to GIO, we need to pull in both libmount and libblkid.
Linking with -lmount is not enough to achieve that, but recursing
into mount.pc is.

This makes the Autotools build a bit more like the Meson build,
which already puts mount in Requires.private.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-26 10:08:38 +01:00
Xavier Claessens
27b5fb5892 Meson: appinfo tests are racy if run in parallel 2018-09-25 15:14:53 -04:00
Xavier Claessens
88a1188fc1 Merge branch 'speling' into 'master'
Fix spelling mistakes detected by Debian's Lintian tool

See merge request GNOME/glib!354
2018-09-25 18:16:52 +00:00
Xavier Claessens
af9e67c776 Merge branch '1544-gtester-report' into 'master'
Generate gtester-report from .in file

Closes #1544

See merge request GNOME/glib!352
2018-09-25 18:00:13 +00:00
Simon McVittie
5040aee5bf Merge branch 'tap-fix' into 'master'
Meson: Do not run tests/refcount with --tap

See merge request GNOME/glib!353
2018-09-25 17:55:14 +00:00
Simon McVittie
8346017b17 Generate gtester-report from .in file
Previously, it was installed unmodified by the Meson build system.

We don't need to define @bindir@, because gtester-report never
actually referred to it. We also don't need a definition of
GTESTER_REPORT for use by GLib itself, because its last use was removed
in 2013 (https://bugzilla.gnome.org/show_bug.cgi?id=709995).

Fixes: https://gitlab.gnome.org/GNOME/glib/issues/1544
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-25 17:34:57 +01:00
Simon McVittie
1830ebba91 Spelling: Fix spelling of "interpreted"
Detected by Debian's Lintian tool.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-25 15:58:56 +01:00
Simon McVittie
ec951e9de8 Spelling: avoid the "allows to" pattern
This is detected by Debian's Lintian tool, which suggests
"allows one to" as a replacement. I've rephrased the documentation
in question to avoid both of those.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-25 15:57:49 +01:00
Simon McVittie
03cf374848 Spelling: Fix spelling of "unknown"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-25 14:35:13 +01:00
Simon McVittie
55cfbd3bc4 Spelling: Fix spelling of "constructed"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-25 14:35:13 +01:00
Simon McVittie
e0a8df12ef Spelling: Fix spelling of "similarly"
Detected by Debian's Lintian tool.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-25 14:35:13 +01:00
Simon McVittie
59bede934c Spelling: Fix a common en_FR spelling of "information"
Detected by Debian's Lintian tool.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-25 14:35:11 +01:00
Simon McVittie
7a903bd044 Spelling: fix spelling of specify
Detected by Debian's Lintian tool.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-25 14:34:48 +01:00
Simon McVittie
214c991d5b Spelling: fix "every time"
Detected by Debian's Lintian tool.

Also fix the spelling of "linking" in one error message.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-25 14:34:48 +01:00
Xavier Claessens
7c8e1f15cc Meson: Do not run tests/refcount with --tap
This is a partial revert of a change introduced in cbc7fbbf7.
2018-09-25 09:33:15 -04:00
Xavier Claessens
b6171b97bf Merge branch '1528-build-time-tap' into 'master'
meson: Run build-time tests with --tap where supported

Closes #1528

See merge request GNOME/glib!351
2018-09-25 11:25:53 +00:00
Simon McVittie
cbc7fbbf7d meson: Run build-time tests with --tap where supported
This makes it easier to debug test failures, by ensuring that g_debug()
and g_test_message() are printed as TAP diagnostics.

Fixes: https://gitlab.gnome.org/GNOME/glib/issues/1528
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-09-24 23:37:12 +01:00
Xavier Claessens
b803d94366 Merge branch '1541-timeloop-closure' into 'master'
Meson: Install timeloop-closure test

Closes #1541

See merge request GNOME/glib!349
2018-09-24 19:27:38 +00:00
Xavier Claessens
178b943be7 Meson: Install timeloop-closure test 2018-09-24 11:21:27 -04:00
Xavier Claessens
b512135fc6 Merge branch '1535-tap' into 'master'
Meson: Run in TAP mode installed tests that support it

Closes #1535

See merge request GNOME/glib!343
2018-09-24 14:49:40 +00:00
Xavier Claessens
8bfb1d0ea3 Merge branch '1537-fixxref' into 'master'
Meson: doc: fix cross references

Closes #1537

See merge request GNOME/glib!344
2018-09-24 14:49:02 +00:00
Debarshi Ray
0a8f3698a0 docs: Simplify the text for g_array_free
The text about deallocation of GArrays with elements containing
dynamically-allocated memory was confusing. It initially mentioned
clear_func, but later said elements with dynamically allocated memory
"should be freed separately".

Clarify this by using the same structure as g_ptr_array_free —
highlight the need to set a clear_func by consolidating the text about
it in a separate paragraph.

https://gitlab.gnome.org/GNOME/glib/merge_requests/348
2018-09-24 16:34:53 +02:00
Debarshi Ray
30ccd6f01b docs: Use the correct terminology for g_array_free
GArray uses the term clear_func (eg., g_array_set_clear_func), while
element_free_func comes from GPtrArray.

https://gitlab.gnome.org/GNOME/glib/merge_requests/348
2018-09-24 16:34:49 +02:00