Commit Graph

22454 Commits

Author SHA1 Message Date
Timm Bäder
a2e715a4fe strfuncs: Use a GPtrArray in strsplit()
This is more efficient and also much easier since we already have the
memory allocated that we're going to return from the function. No need
to do that ourselves or reverse a list.
2020-06-05 08:59:15 +02:00
Philip Withnall
c93318953e Merge branch 'threaded-socket-service-nullable-source-object' into 'master'
gthreadedsocketservice: Mark source_object of run signal as nullable

See merge request GNOME/glib!1516
2020-06-02 11:54:23 +00:00
Sebastian Dröge
2ed356cb67 Merge branch 'disable-ios-nsgetenviron' into 'master'
Various fixes when building for iOS

See merge request GNOME/glib!1512
2020-06-02 10:56:44 +00:00
Sebastian Dröge
4556bf1e24 gthreadedsocketservice: Mark source_object of run signal as nullable 2020-06-02 13:40:54 +03:00
Philip Withnall
3fd3a246f6 Merge branch 'bookmark-visited' into 'master'
Initialize the visited time of a new GBookmarkFile

See merge request GNOME/glib!1513
2020-05-30 18:03:08 +00:00
Emmanuele Bassi
9f7f2b4d55 Add a GBookmarkFile serialization test case
We're roundtripping from a valid file, but we should also roundtrip from
a newly created GBookmarkFile, to ensure that we set all the necessary
fields.
2020-05-30 17:40:52 +01:00
Emmanuele Bassi
909a8856ef Initialize the visited time of a new GBookmarkFile
Just like we do for the other fields. Otherwise, when we serialise the
item, we're going to hit a segmentation fault when trying to format a
NULL GDateTime.
2020-05-30 17:09:40 +01:00
Nirbheek Chauhan
ab6b764e24 ci: growing_stack should be true for android and ios
We can't run this test when cross-compiling, but we know what this
should be on Android and iOS.
2020-05-29 02:44:44 +05:30
Nirbheek Chauhan
e3ef2cdf82 .gitlab-ci: Add an example iOS cross file
This should be generated based on the available SDK versions and the
iPhone version you want to target, but that's something we can do
when adding macOS and iOS CI.
2020-05-29 01:17:14 +05:30
Nirbheek Chauhan
a28b52d7db meson: Only look for _NSGetEnviron when building for macOS
On iOS it can cause build failures with some SDK versions, and its
usage will also cause the app to be rejected on submission.
2020-05-29 00:31:35 +05:30
Nirbheek Chauhan
3c78d0cec6 meson: Autodetect when building for iOS
Instead of relying on `system` to be set correctly in the
cross-compile file, detect when we're building for iOS/watchOS/tvOS.
2020-05-29 00:31:35 +05:30
Nirbheek Chauhan
c6af3c7749 meson: host_system can be ios when cross-compiling
Cross-compile system names aren't standardized in Meson yet[1], but we
already use this name in `tests/meson.build`, so use it here too for
consistency.

1. https://mesonbuild.com/Reference-tables.html#operating-system-names
2020-05-29 00:31:35 +05:30
Emmanuele Bassi
3d0e1f5c85 Merge branch '1931-bookmark-file-y2038' into 'master'
Resolve "GBookmarkFile API involves time_t"

Closes #1931

See merge request GNOME/glib!1511
2020-05-28 15:41:04 +00:00
Philip Withnall
c45ad011f4 tests: Add tests for deprecated GBookmarkFile API
Just to check that it correctly wraps the new replacement APIs.

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

Helps: #1931
2020-05-28 14:55:53 +01:00
Philip Withnall
6147cae1c6 gbookmarkfile: Deprecate GBookmarkFile APIs which use time_t
They use the `time_t` type, which is not year 2038 safe on 32-bit
systems, so have to be deprecated.

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

Fixes: #1931
2020-05-28 14:55:53 +01:00
Philip Withnall
9b82fd021a tests: Update GBookmarkFile tests to use new APIs
In preparation for deprecating the old APIs. This shouldn’t functionally
affect the tests.

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

Helps: #1931
2020-05-28 14:55:53 +01:00
Philip Withnall
fbc1456971 gbookmarkfile: Add Y2038-proof APIs to GBookmarkFile
These are alternatives to the existing `time_t`-based APIs, which will
soon be deprecated due to `time_t` only being Y2038-safe on 64-bit
systems.

The new APIs take a GDateTime instead.

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

Helps: #1931
2020-05-28 14:55:53 +01:00
Nirbheek Chauhan
caec84ae1e Merge branch 'gdbus-codegen-exporting' into 'master'
Make symbols generated by gdbus-codegen exportable on Visual Studio-style builds

See merge request GNOME/glib!1452
2020-05-28 13:01:46 +00:00
Chun-wei Fan
cd229a2fb4 docs: Document --symbol-decorator for gdbus-codegen
This updates gdbus-codegen.xml to include documentation for the
--symbol-decorator, --symbol-decorator-header and
--symbol-decorator-define options, which is used to help to export
symbols in the generated code.
2020-05-28 18:24:57 +08:00
Nirbheek Chauhan
73d9b72fec Merge branch 'fix-gresource-export-msvc' into 'master'
glib-compile-resources: Fix exporting on Visual Studio

Closes #1215

See merge request GNOME/glib!1468
2020-05-28 10:03:28 +00:00
Philip Withnall
a3c1bce4fd Merge branch 'static-libintl' into 'master'
meson: Fix underlinking of static libintl by trying iconv and pthread

Closes #1851

See merge request GNOME/glib!1450
2020-05-28 09:36:36 +00:00
Chun-wei Fan
a94f32f140 gdbus-object-manager-example: Fix build on Visual Studio
This ensures that we do really export the symbols for Visual
Studio-style builds, by using _GLIB_EXTERN to decorate the generated
prototypes and including config.h so that we are sure the symbols are
actually exported.
2020-05-28 17:20:22 +08:00
Chun-wei Fan
d955719f04 gdbus-codegen: Allow decorating symbols in headers
This adds three options to gdbus-codegen so that we may be able to
use a self-defined symbol decorator, such as _GLIB_EXTERN, to decorate
the generated prototypes, to be used possibly to export the symbols, if
needed.

The other two options allows including headers that are required for the
specified symbol decorator to be usable and preprocessor macros that are
required for the symbol decorator to be defined appropriately, also when
needed.
2020-05-28 17:20:22 +08:00
Philip Withnall
11e9c5a9ce Merge branch 'clang-trap' into 'master'
Use __builtin_trap() on Clang on any platform

See merge request GNOME/glib!1430
2020-05-28 09:01:49 +00:00
Martin Storsjö
77346d903d Don't fall back to raise(SIGTRAP) on Windows
When targeting mingw on architectures other than x86, the earlier cases
don't apply, and the final fallback, raise(SIGTRAP) isn't usable there.

GCC and Clang both support __builtin_trap(), so in case we have no
other alternatives, and are on windows (where raise() isn't available),
we can resort to this.
2020-05-28 09:21:35 +01:00
James Le Cuirot
56271ff271 meson: Fix underlinking of static libintl by trying iconv and pthread
I thought about checking for an intl pkg-config file but upstream are
not interested in adding one so there seems little point.

Closes #1851
2020-05-28 09:16:32 +01:00
James Le Cuirot
842dccfce7 meson: Remove transitive dep workaround now we require newer Meson
https://github.com/mesonbuild/meson/issues/1426 was fixed in 0.48.0
but we require 0.49.2.
2020-05-28 09:16:32 +01:00
Sebastian Dröge
f733eff2ee Merge branch 'fix-fedora-ci-build' into 'master'
Rebuild Fedora CI image

See merge request GNOME/glib!1488
2020-05-26 16:09:39 +00:00
Chun-wei Fan
47716bcec9 glib-compile-resources: Fix exporting on Visual Studio
Have the generated .c code decorate the prototypes with "G_MODULE_EXPORT"
instead of "extern" when --internal is not being used, so that we also
export the symbols from the generated code on Visual Studio-style
compilers.  If --internal is used, we decorate the prototypes with
"G_GNUC_INTERNAL", as we did before.

Note that since the generated .c code does not attempt to include the
generated headers (if one is also generated), the gnerated headers are
still generated as they were before.
2020-05-23 10:35:05 +08:00
Philip Withnall
2ba0f14b52 Merge branch 'w32reg-mui' into 'master'
MUI capabilities for GWin32RegistryKey

See merge request GNOME/glib!1341
2020-05-22 16:21:41 +00:00
Руслан Ижбулатов
f77a6a1626 GWin32AppInfo: Drop read_resource_string(), use GWin32RegistryKey
Now GWin32RegistryKey can internally do the same thing that
read_resource_string() does, and more.
2020-05-22 14:17:12 +00:00
Sebastian Dröge
2730e5dcc3 Merge branch 'fix-file-test' into 'master'
tests: Speed up the file test and make it more reliable

See merge request GNOME/glib!1508
2020-05-22 10:54:58 +00:00
Sebastian Dröge
743bbb90da Merge branch 'cancellable-test-fix' into 'master'
tests: Speed up the cancellable test

See merge request GNOME/glib!1506
2020-05-22 10:36:11 +00:00
Philip Withnall
26c433d26c tests: Speed up the file test and make it more reliable
Sometimes this test was timing out due to the file monitor notifications
taking longer than the arbitrary 2s delay before ending the test and
checking its results at the end of `iclosed_cb()`.

Avoid that timing-dependence by ending the test when the expected file
monitor notifications are seen, or after a 10s timeout (if so, the test
is failed).

This makes the test run 4× faster in the normal case, as it’s no longer
waiting for a timeout to elapse if the file monitor notifications come
in sooner.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-05-22 11:05:27 +01:00
Philip Withnall
43969bf41a tests: Port file test to use g_assert_*() rather than g_assert()
g_assert() can be compiled out with G_DISABLE_ASSERT, which renders the
test rather useless.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-05-22 11:04:34 +01:00
Florentina Mușat
4f0b0e1b57 Update Romanian translation 2020-05-22 09:10:42 +00:00
Philip Withnall
60dd272b6a docs: Bump gtk-doc requirement for unit tests to 1.32.1
gtk-doc 1.33 hasn’t been released yet, but when it is, it’ll contain
three fixes which are necessary for correctly detecting which symbols
are undocumented/undeclared/unused in GLib:
 • gtk-doc@b866a90b
 • gtk-doc@ca42972c
 • gtk-doc@b922e148

1.32.1 is the development version number which will eventually be
released as 1.33.

Until then, we can’t run the gtk-doc tests in CI because they reliably
fail spuriously. See !1488.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-05-22 09:57:33 +01:00
Philip Withnall
57ed909857 ci: Document access token permissions needed for uploading images
New, finer-grained permissions are now supported in GitLab.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-05-22 09:32:44 +01:00
Philip Withnall
e89f41d3bf ci: Rebuild Fedora Docker image for latest Dockerfile changes
See !1464.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-05-22 09:32:44 +01:00
Philip Withnall
cbcc0aa1ea ci: Handle missing suite information in test output JSON
The gtk-doc tests are hardcoded by Meson to output as `glib /
gio-doc-check`, `glib / gobject-doc-check`, etc., without an explicit
project name and suite. This causes the following exception in the
report parser:
```
Traceback (most recent call last):
  File ".gitlab-ci/meson-junit-report.py", line 50, in <module>
    (project_name, suite_name) = full_suite.split(':')
ValueError: not enough values to unpack (expected 2, got 1)
```

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-05-22 09:32:44 +01:00
Philip Withnall
74f1e58219 ci: Add python3-pip to Fedora dependencies
It’s needed to provide the `pip3` executable, which the `Dockerfile`
later uses.

Follow-up to !1464.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-05-22 09:32:44 +01:00
Philip Withnall
31099d97eb Merge branch 'fix-2107-windows-gpoll-stall' into 'master'
win32 gpoll: Fix wait for at least one thread to return

Closes #2107

See merge request GNOME/glib!1504
2020-05-22 08:11:00 +00:00
Philip Withnall
8f291487fe Merge branch 'lcopyfail' into 'master'
gobject: Handle runtime checks as such

See merge request GNOME/glib!1505
2020-05-20 16:49:17 +00:00
Philip Withnall
9f27f49e34 tests: Speed up the cancellable test
The test added for #1841 spawned 100000 threads. That was fine on a
desktop machine, but on a heavily loaded CI machine, it could result in
large (and unpredictable) slowdowns, resulting in the test taking over
120s in about 1 in 5 runs, and hence failing that CI pipeline due to a
timeout. When passing normally on CI, the test would take around 90s.

Here’s a histogram of time per iteration on a failing (timed out) test
run. Each iteration is one thread spawn:

  Iteration duration (µs) | Frequency
  ------------------------+----------
                     ≤100 |     0
                  100–200 | 30257
                  200–400 | 13696
                  400–800 |  1046
                 800–1000 |   123
                1000–2000 |   583
                2000–4000 |  3779
                4000–8000 |  4972
               8000–10000 |  1027
              10000–20000 |  2610
              20000–40000 |   650
              40000–80000 |    86
             80000–100000 |    10
            100000–200000 |     2
                  >200000 |     0

There’s no actual need for the test to spawn 100000 threads, so rewrite
it to reuse a single thread, and pass new data to that thread.

Reverting the original commit (e4a690f5dd) reproduces the failure on
100 out of 100 test runs with this commit applied, so the test still
works.

The test now takes 3s, rather than 11s, to run on my computer, and has
passed when run with `meson test --repeat 1000 cancellable`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-05-20 17:21:14 +01:00
Edward Hervey
898baa07b1 gobject: Handle runtime checks as such
The various `g_strdup_printf()` returns values in the implementations of GValue
lcopy_func are runtime checks which could be disabled if one wants and therefore
should be handled as such with g_return_val_if_fail()
2020-05-20 17:37:46 +02:00
Руслан Ижбулатов
a22a15dc5a GWin32RegistryKey: add MUI capabilities to get_value()
An extra argument to g_win32_registry_key_get_value_w() and
g_win32_registry_key_get_value() indicates that RegLoadMUIStringW()
should be used instead of RegQueryValueExW(). It only works on
strings, and automatically resolves resource strings (the ones
that start with "@").

The extra argument is needed to find resource DLLs that are only
specified by their relative name.
2020-05-20 14:23:49 +00:00
majordaw
26991b6093 win32 gpoll: Fix wait for at least one thread to return
When timeout grater than 0 in g_poll function, the WaitForMultipleObjects
call will wait for all the threads to return, but when only one thread
got an event the others will sleep until the timeout elapses, and causes
a stall. Triggering the stop event in g_poll in this case is useless as
it is triggered when all the threads where already signaled or timed-out.

Closes: https://gitlab.gnome.org/GNOME/glib/issues/2107
2020-05-20 15:32:47 +02:00
Sebastian Dröge
e816e9c86f Merge branch 'docs-fix' into 'master'
docs: Add indexes for symbols added in 2.66

See merge request GNOME/glib!1503
2020-05-20 12:13:29 +00:00
Philip Withnall
9f421dd678 docs: Add indexes for symbols added in 2.66
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-05-20 12:20:28 +01:00
Sebastian Dröge
e992b9978e Merge branch 'value-interned' into 'master'
GValue: Add interned string support

Closes #2109

See merge request GNOME/glib!1497
2020-05-20 08:25:40 +00:00