Commit Graph

25938 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
30bd57ecf8
2.74.0
Signed-off-by: Marco Trevisan (Treviño) <mail@3v1n0.net>
2022-09-17 20:38:17 +02:00
Bruce Cowan
6d56a75ab2 Update British English translation 2022-09-17 07:54:29 +00:00
Marco Trevisan (Treviño)
2401e1a090 glocalfileoutputstream: Do not double-close an fd on unlink error
In case we fail unlinking a file we could close again an FD that has
been already just closed. So avoid this by unsetting it when closing.

Coverity CID: #1474462
2022-09-16 15:11:47 +02:00
Marco Trevisan
ee470da7c8 Merge branch 'pr-docs-improve-wording-glib-unix' into 'main'
docs: Improve wording in documentation of g_unix_signal_source_new()

See merge request GNOME/glib!2900
2022-09-16 12:30:43 +00:00
Tom Levy
eeaef8b950 docs: Improve wording in documentation of g_unix_signal_source_new()
- Insert missing word "from".

- Remove space between function name and "()" so syntax highlighting
  can recognise it as a function.

- Avoid "you"/"your" when discussing the reentrancy issues of regular
  UNIX signal handlers, because it gives the false impression that
  these issues are applicable to g_unix_signal_source_new().

Unrelated:

- Fix missing space in documentation of g_signal_new_class_handler().
2022-09-16 08:25:46 +00:00
Jason Francis
9cd9787c52
gio: make g_task_get_cancellable return value nullable 2022-09-16 01:27:12 -04:00
Kjell Ahlstedt
37dba1c425 gio-launch-desktop: Fix the G_STATIC_ASSERT expressions for clang
The clang compiler requires the static_assert expression to be an integral
constant expression. `"text"` is not, but `sizeof "text"` is.

Fixes #2740
2022-09-15 12:55:18 +02:00
Matthias Clasen
dcb459a0b0 Fix g_unichar_iswide for unassigned codepoints
There are a few blocks in Unicode (mainly ideographs)
which default to wide. These blocks are defined in the
header comment of EastAsianWidth.txt.

We have some tests which check that unassigned codepoints
in those blocks get reported as wide, so make sure we handle
this correctly.
2022-09-15 03:43:04 +02:00
Marco Trevisan (Treviño)
b3e32eda7c tests/unicode: Add more debugging messages 2022-09-15 03:43:04 +02:00
Marco Trevisan (Treviño)
0eb3a2440a unicode: Avoid adding trailing spaces to tables definitions 2022-09-15 03:43:04 +02:00
Marco Trevisan (Treviño)
65092de98f unicode: Update data to Unicode 15 2022-09-15 03:43:04 +02:00
Marco Trevisan (Treviño)
e8f31c43db tools/update-unicode-data.sh: Add a script to handle the unicode updates
We need to perform multiple actions on unicode updates, so let's handle
all the commands in a single script so that we don't have to remember
all the details each time.
2022-09-15 03:43:04 +02:00
Matthias Clasen
d37beda25e Merge branch 'expose-artifacts-in-pr' into 'main'
ci: Expose the coverage report and docs as links in the MR's

See merge request GNOME/glib!2820
2022-09-15 01:41:31 +00:00
Marco Trevisan (Treviño)
d6a378afa7 run-docker: Do not require sudo if the user is part of docker group 2022-09-15 03:16:52 +02:00
Marco Trevisan (Treviño)
3ddfb10b0b ci: Generate Cobertura XML and use it to feed gitlab for MR integration
gitlab has coverage integration in MRs, but we need a cobertura
formatted XML files (each must be less than 10 MB [1]) to show it, so
generate it using a python script and inform gitlab about it.

See https://docs.gitlab.com/ee/ci/testing/test_coverage_visualization.html

[1] https://gitlab.com/gitlab-org/gitlab/-/issues/328772#note_840831654
2022-09-15 03:16:52 +02:00
Marco Trevisan (Treviño)
29cf6b2b65 ci: Install lcov-cobertura and cobertura-split script in coverage images
These are needed to be able to get cobertura reports in gitlab.
2022-09-15 03:12:08 +02:00
Marco Trevisan (Treviño)
22f5016303 ci: Expose the coverage report as link in the MR's
It's making handier to check how changes are tested.
2022-09-15 01:44:29 +02:00
Marco Trevisan (Treviño)
4432f78407 CI: Do not allow failures in the valgrind job
We're no more leaks, so we can just be more restrictive at it, in order
to find new problems easier.
2022-09-14 22:03:00 +02:00
Marco Trevisan (Treviño)
505755e4d2 glib.supp: Ignore gutils leaks for user and system dirs
These leaks happens "by design" in case that the private API
g_set_user_dirs() is used to replace directories during some tests.
And we've to leak the previously set values (if any) not to free strings
that may be used by other user code before.

In fact we're already ignoring LSAN reports for the very same reason
here.

We could create a private suppression file too, but I don't think we've to
bother with that, given that user code should never hit this path
anyways.

It's the only leak we have, sooo:

Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/333
2022-09-14 22:03:00 +02:00
Alyssa Ross
7c74fe4c1d
tests: skip based on g_file_info_has_attribute
Per review request.  Matches the style for the newly introduced skip
check in test_g_file_info_access_time.
2022-09-14 13:21:53 +00:00
Alyssa Ross
7162b3c496
tests: skip g-file-info test if atime unsupported
For example, g_file_query_info will not be able to determine access
time for files on ZFS with atime=off.
2022-09-14 13:21:39 +00:00
Emmanuel Fleury
d9ba615090 Handling collision between standard i/o file descriptors and newly created ones
Though unlikely to happen, it may happen that newly created file
descriptor take the value 0 (stdin), 1 (stdout) or 2 (stderr) if one
of the standard ones have been dismissed in between. So, it may
confuse the program if it is unaware of this change.

The point of this patch is to avoid a reasign of standard file
descriptors on newly created ones.

Closes issue #16
2022-09-14 08:50:40 +02:00
Jiri Grönroos
4f4ac4ac1a Update Finnish translation 2022-09-13 20:06:48 +00:00
Marco Trevisan (Treviño)
c8e2d4a38d unix-streams: Ensure we get cancelled errors if the cancellable is cancelled 2022-09-13 16:30:12 +02:00
Marco Trevisan (Treviño)
d40ef833e3 tests/unix-streams: Free the cancelled error on cancelled cancellable
Helps with: https://gitlab.gnome.org/GNOME/glib/-/issues/333
2022-09-13 16:29:20 +02:00
Sebastian Dröge
a20a36b26f Merge branch 'revert-de57914b' into 'main'
Revert "Merge branch 'wip/smcv/deprecated-construct-prop' into 'main'"

See merge request GNOME/glib!2890
2022-09-13 11:32:48 +00:00
Sebastian Dröge
d41b5bf999 Revert "Merge branch 'wip/smcv/deprecated-construct-prop' into 'main'"
This reverts merge request !2888
2022-09-13 11:20:03 +00:00
Sebastian Dröge
de57914b83 Merge branch 'wip/smcv/deprecated-construct-prop' into 'main'
gobject: Only emit deprecation warnings for user-specified properties

Closes #2748

See merge request GNOME/glib!2888
2022-09-13 11:09:26 +00:00
Simon McVittie
fef0408eaa gobject: Add a test for deprecated properties
Reproduces: https://gitlab.gnome.org/GNOME/glib/-/issues/2748
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-09-13 11:20:45 +01:00
Simon McVittie
b88474ee7c gobject: Only emit deprecation warnings for user-specified properties
If a deprecated property only gets set because it is G_PARAM_CONSTRUCT
or G_PARAM_CONSTRUCT_ONLY, then there is nothing for the library user
to fix, and we should not emit a deprecation warning.

Resolves: https://gitlab.gnome.org/GNOME/glib/-/issues/2748
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-09-13 11:16:58 +01:00
Alexander Shopov
98d071498b Update Bulgarian translation 2022-09-13 08:31:20 +00:00
Marco Trevisan
0d823aa926 Merge branch 'wip/3v1n0/regex-pcre2-flags-fixes' into 'main'
GRegex flags fixes and cleanups

Closes gtksourceview#283, #2741, #2729, #2688 e gtksourceview#278

See merge request GNOME/glib!2878
2022-09-12 21:45:57 +00:00
Claude Paroz
a2a0441189 Update French translation 2022-09-12 18:00:20 +00:00
Xavier Claessens
dcb464f013 Merge branch 'install-tag' into 'main'
meson: Set install_tag on all tools

See merge request GNOME/glib!2882
2022-09-12 14:22:03 +00:00
Xavier Claessens
a1c78d63ef meson: Set install_tag on all tools
Those tools are not needed at runtime for typical applications,
distributions typically package them separately.

This makes `meson install --tag runtime` skip installation of those
tools. Omitting `--tag` argument will still install them, as well as
with `--tag bin,bin-devel`.

See https://mesonbuild.com/Installing.html#installation-tags.
2022-09-12 09:50:31 -04:00
Marco Trevisan (Treviño)
653f8eb020 tests/regex: Perform more tests both with and without optimizations 2022-09-12 14:08:13 +02:00
Marco Trevisan (Treviño)
bec68b2d74 glib/regex: Do not use JIT when using unsupported match options
Do not store jit status for regex unless during initial compilation.
After that, decide whether to use it depending on matching options.

In fact there are some matching options that are incompatible with JIT,
as the PCRE2 docs states:

  Setting PCRE2_ANCHORED or PCRE2_ENDANCHORED at match time is not
  supported by the just-in-time (JIT) compiler. If it is set, JIT
  matching is disabled and the interpretive code in pcre2_match() is
  run. Apart from PCRE2_NO_JIT (obviously), the remaining options are
  supported for JIT matching.

Fixes: GNOME/gtksourceview#283
2022-09-12 14:08:13 +02:00
Marco Trevisan (Treviño)
0831393dd0 tests/regex: Make possible to test replacements with options 2022-09-12 13:55:39 +02:00
Marco Trevisan (Treviño)
5e76cde5ff regex: Handle JIT errors more explicitly 2022-09-12 13:55:39 +02:00
Marco Trevisan (Treviño)
fe1c2628d5 regex: Avoid allocating offsets until we've a match
There's no much point of pre-allocating offsets given that we're doing
this when needed if only have matches to store.

So let's just allocate the spaces for the dummy offset we depend on,
while allocate the others on demand.
2022-09-12 13:55:39 +02:00
Marco Trevisan (Treviño)
e8628a7ed5 regex: Compute the offsets size based on match results
While the ovector count would include all the allocated space, we only
care about the actual match values, so avoid wasting allocations and
just use the ones we need to hold the offsets.
2022-09-12 13:55:39 +02:00
Marco Trevisan (Treviño)
aee84cb45c gregex: Avoid re-allocating if we have no size change
This is handled by the syscall underneath, but we can just avoid a call
cheaply.
2022-09-12 13:55:39 +02:00
Marco Trevisan (Treviño)
11521972f4 gregex: Handle the case we need to re-allocate the match data
In case PCRE2 returns an empty match

This can be easily tested by initializing the initial match data to a
value that is less than the expected match values (e.g. by calling
pcre2_match_data_create (1, NULL)), but we can't do it in our tests
without bigger changes.
2022-09-12 13:55:39 +02:00
Marco Trevisan (Treviño)
1d628dac92 regex: Use size types more in line with PCRE2 returned values
We're using int for every size value while PCRE uses uint_32t or
PCRE2_SIZE (size_t in most platforms), let's use the same types to avoid
using different signs.
2022-09-12 13:55:39 +02:00
Marco Trevisan (Treviño)
13ad4296ea gregex: Fix a potential PCRE2 code leak on reallocation failures
In case recalc_match_offsets() failed we were just returning, but in
such case, per the documentation we should still set the match_info (if
provided) and free the pcre2 code instance.

So let's just break the loop we're in it, as if we we've no matches set.
This also avoids re-allocating the offsets array and potentially
accessing to unset data.
2022-09-12 13:55:39 +02:00
Marco Trevisan (Treviño)
1f88976610 gregex: Do not try access the undefined match offsets if we have no match
In case we're getting NO-MATCH "errors", we were still recomputing the
match offsets and taking decisions based on that, that might lead to
undefined behavior.

Avoid this by just returning early a FALSE result (but with no error) in
case there's no result to proceed on.

Fixes: #2741
2022-09-12 13:55:39 +02:00
Marco Trevisan (Treviño)
1185a1304a gregex: Mark g_match_info_get_regex as transfer none
Since it had no explicit annotation, g-i was defaulting to transfer-full
while in this case the GRegex is owned by the GMatchInfo.
2022-09-12 13:55:39 +02:00
Aleksei Rybalkin
df66951b96 tests/regex: Add test for gtksourceview regression 2022-09-12 13:55:39 +02:00
Marco Trevisan (Treviño)
d639c4ec00 regex: Do not mix PCRE2 Compile, Match, Newline and BSR flags
As per the PCRE2 port we still used to try to map the old GRegex flags
(PCRE1 based) with the new PCRE2 ones, but doing that we were also
mixing flags with enums, leading to unexpected behaviors when trying to
get new line and BSR options out of bigger flags arrays.

So, avoid doing any mapping and store the values as native PCRE2 flags
internally and converting them back only when requested.

This fixes some regressions on newline handling.

Fixes: #2729
Fixes: #2688
Fixes: GNOME/gtksourceview#278
2022-09-12 13:55:39 +02:00
Marco Trevisan (Treviño)
d4966911e6 tests/regex: Actually check for match options changes 2022-09-12 13:55:39 +02:00