31425 Commits

Author SHA1 Message Date
Philip Withnall
30ed00b8e5 Merge branch 'test-fixes' into 'main'
tests: Minor fixes to reference and stream-rw_all tests

See merge request GNOME/glib!4540
2025-03-06 00:13:41 +00:00
Michael Catanzaro
8622f4511c Merge branch 'debug-controller-docs-fix' into 'main'
gdebugcontrollerdbus: Fix a minor typo in a code example in the docs

See merge request GNOME/glib!4542
2025-03-04 19:16:49 +00:00
Philip Withnall
4f2877c502
gdebugcontrollerdbus: Fix a minor typo in a code example in the docs
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-03-04 16:29:23 +00:00
Philip Withnall
429661491c Merge branch 'translation-ko-202503' into 'main'
Update Korean translation

See merge request GNOME/glib!4539
2025-03-04 14:22:51 +00:00
Philip Withnall
3920e0f172
tests: Fix an incorrect array length in stream-rw_all test
The array was declared one byte too short to contain the trailing nul
byte for the string literal. Spotted by gcc 15.

Fix it by allowing the compiler to work out the array length.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-03-04 14:20:48 +00:00
Philip Withnall
4d566e47d7
tests: Skip a hard-to-reproduce race in reference tests under valgrind
Fixes test timeouts like this one:
https://gitlab.gnome.org/GNOME/glib/-/jobs/4827270

The race will continue to be reproduced when running the tests not under
valgrind.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-03-04 12:43:44 +00:00
Changwoo Ryu
661b45923c Update Korean translation 2025-03-04 21:24:28 +09:00
Philip Withnall
0e10a629a5 Merge branch '3590-sl-translation' into 'main'
Update Slovenian translation

Closes #3590

See merge request GNOME/glib!4538
2025-03-03 12:49:07 +00:00
Martin
da893484f6 Update Slovenian translation
Submitted at
https://gitlab.gnome.org/GNOME/glib/-/issues/3590#note_2366863,
committed by Philip Withnall.
2025-03-03 12:00:59 +00:00
Philip Withnall
84f555a3aa
2.83.5
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2.83.5
2025-02-28 14:02:50 +00:00
Philip Withnall
49b3271e6b Merge branch 'main' into 'main'
Update Galician translations

See merge request GNOME/glib!4535
2025-02-28 13:50:31 +00:00
Philip Withnall
0b62f3dd82 Merge branch 'wip/smcv/subprojects' into 'main'
Improve test behaviour when using Meson subprojects

Closes #3625 and #3626

See merge request GNOME/glib!4534
2025-02-28 12:46:31 +00:00
Fran Diéguez
ab3ed81415 Update Galician translations 2025-02-28 12:26:19 +00:00
Simon McVittie
66bca5f78b build: If pcre2 is a subproject, disable its unit tests by default
Debugging pcre2's test suite is out-of-scope for GLib, or for any larger
project that embeds GLib as a subproject.

Resolves: https://gitlab.gnome.org/GNOME/glib/-/issues/3626
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-02-28 12:17:29 +00:00
Simon McVittie
12171f6fe7 tests: Don't check for missing install_tag if GLib is a subproject
The test script checks the entire Meson build, not just GLib, so it will
fail if GLib is a fallback subproject within some larger project that
does not use `install_tag` as systematically as GLib does.

In particular, if the larger project has a very conservative minimum
Meson version (like for example dbus), it might not be possible to
add `install_tag` to it.

Resolves: https://gitlab.gnome.org/GNOME/glib/-/issues/3625
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-02-28 11:52:09 +00:00
Philip Withnall
69462f4921 Merge branch 'update-sv-translation' into 'main'
Update Swedish translation

See merge request GNOME/glib!4531
2025-02-27 23:07:38 +00:00
Anders Jonsson
af83e3a6ea Update Swedish translation 2025-02-27 22:26:01 +01:00
Philip Withnall
db26eb22fd Merge branch 'wip/refi64/fix-marshaller-args' into 'main'
gdbus-codegen: Fix callback GUnixFDList parameter order

See merge request GNOME/glib!4524
2025-02-27 14:21:43 +00:00
Philip Withnall
4303aadb59 Merge branch 'gapplication-examples' into 'main'
doc: remove unnecessary and confusing code from examples

Closes #3615

See merge request GNOME/glib!4528
2025-02-27 14:10:37 +00:00
Philip Withnall
3662159809 Merge branch '3272-disable-assert-debugging' into 'main'
tests: Only change the behaviour of getpwuid() inside each test function

Closes #3272

See merge request GNOME/glib!4519
2025-02-27 14:08:22 +00:00
Philip Withnall
ef2234540b Merge branch 'th/gobj-performance-2' into 'main'
[th/gobj-performance-2] more improvements to GObject's `performance.c` and add test "property-set-signaled"

See merge request GNOME/glib!4526
2025-02-27 10:06:34 +00:00
Philip Withnall
84665e7a76 Merge branch 'update_pt.po' into 'main'
Update Portuguese translation

See merge request GNOME/glib!4529
2025-02-27 10:05:52 +00:00
Thomas Haller
b93108f07e gobject/performance: decrease warmup time and cleanups
Some tweakings of the time spend during warm up. That mostly matters if
you set very short "--seconds", which can make sense for quickly
checking something. Then the warmup should not take more thatn a certain
percentage of the requested runs.

When we have a constant factor, we still want not to run for more than
10% of the overall test time ... except, we still want to run at least
ESTIMATE_ROUND_TIME_N_RUNS (because we skip the estimation step below).

Also, adjust WARM_UP_ALWAYS_SEC to be only 20% of the test time, for
short test runs.

Also, don't print the messages about "Estimating round time" with a
fixed "--factor".
2025-02-27 07:38:17 +01:00
Thomas Haller
fa66978cd5 gobject/performance: support sub-seconds test lengths on the command line
One test round aims to run for 8msec (TARGET_ROUND_TIME).

As the "--seconds" parameter previously took whole integer numbers, that
meant that we would run at least 125 rounds.

For a quick run, we should also support even faster runs, e.g. to select
only 0.5 seconds.
2025-02-27 07:35:21 +01:00
Thomas Haller
a88a58a23a gobject/performance: only print test message in verbose mode
Historically, there was a verbose mode and a non-verbose mode.
In non-verbose mode (the default), we would still print two lines:

  Running test property-set
  Property set per second: 39329344

Later, this was changed to include the test name in the second line, so
we would print:

  Running test property-set
  property-set: Property set per second: 39329344

But this first line is really just noise, making parsing and reading the
results harder. Hence a "--quiet" mode was added, that only printed one
line per test while keeping the previous default behavior. And all was
good.

Except, unless you want verbose mode, this "Running test" line is still
not very useful and mainly clutters the output.

Supporess it now also in normal mode. It is now only printed in verbose
mode.

This also makes the "--quiet" option do nothing. The option is still
there, maybe we find a future use and we should not break the command
line API by dropping an argument.
2025-02-27 07:33:57 +01:00
Thomas Haller
f0d8eaf83a gobject/performance: add "property-set-signaled" test
g_object_set() optimizes the case where there are no signals connected.
Add a test that sets the property with signals. Obviously, this one is
much slower, since we will freeze and thaw the notifications.
2025-02-27 07:32:46 +01:00
Thomas Haller
6610be0ef9 gobject/performance: also print stddev of runs
It seems useful to me to get an idea of the variance of the timing
measurements. Calculate and print the sample standard deviation of the
timings.
2025-02-27 07:32:46 +01:00
Thomas Haller
1527e1a448 gobject/performance: drop wrong additional warm up during test run
For the test, we actually care to find the fastest test run (and take
"min_elapsed"). That is useful, because that is the run where we
possibly have the least interference from external factors, it was the
run where the CPU solved the problem as fast as it could.

As such, we should not reject the first 5% as additional warm up. If the
first 5% are slower (and part of "warmup"), then they are anyway not
considered. If there is a the fastest run in the first 5 percent, then
we want to take that.

Also note, that the calculation of "avg_elapsed" was wrong, since it
divided by the full "num_rounds" while only summing 95% of the runs.
This is fixed too by now considering all runs.

Fixes: 282d536fd229 ('tests/performance: ensure to always warm up for 2 seconds')
2025-02-27 07:31:06 +01:00
Hugo Carvalho
e96ca5e021 Update Portuguese translation 2025-02-27 01:27:37 +00:00
Ryan Gonzalez
04ecfa9a30 gdbus-codegen: Fix callback GUnixFDList parameter order
GUnixFDList actually comes *after* the GDBusMethodInvocation, but this
was mistakenly putting it first.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2025-02-26 17:06:46 -06:00
Reuben Thomas
e99dbb943b doc: remove unnecessary and confusing code from examples
Three of the four GApplicationCommandLine examples contained this line:

  g_application_set_inactivity_timeout (app, 10000);

It is not explained (which could be confusing for readers trying to
understand the examplese), or necessary. Worse, it causes two of the
examples to pause for ten seconds if they are invoked with no command-line
arguments, which makes them seem broken (and would presumably be reported
as a bug in any real application).

So, remove these calls.

Fixes #3615
2025-02-26 21:48:30 +00:00
Philip Withnall
53b0ba327b Merge branch 'update-lt-main' into 'main'
Updated Lithuanian translation

See merge request GNOME/glib!4527
2025-02-26 21:36:26 +00:00
Aurimas Černius
87e5be59a3 Updated Lithuanian translation 2025-02-26 23:14:56 +02:00
Philip Withnall
22c1762dff Merge branch 'meson-no-lint-tests-if-disabled' into 'main'
Meson: Disable lint+no-valgrind tests when tests option is set to false

See merge request GNOME/glib!4522
2025-02-26 12:34:44 +00:00
Marvin W
040b05649f
Meson: Disable lint+no-valgrind tests when tests option is set to false 2025-02-26 13:12:28 +01:00
Philip Withnall
c73df43854 Merge branch 'th/gobj-performance-fixes' into 'main'
[th/gobj-performance-fixes] improvements and fixes for gobject's `performance.c` benchmark

See merge request GNOME/glib!4523
2025-02-26 12:12:13 +00:00
Thomas Haller
201628f87f gobject/performance: improve "performance-run.sh" script
- fix and improve usage output for "performance-run.sh" script.

- add a sleep after compilation. It seems to me, that the first run
  usually performs better, which might be because the temperature of the
  CPU raises and the CPU gets throttled. Unclear whether that is really
  the case, but add a sleep so that all runs start under similar
  conditions where the CPU was idle for a moment.
2025-02-26 12:22:24 +01:00
Thomas Haller
1c9d54d4ea gobject/performance: normalize base factors for test runs
When running the test (without parameters), it estimates a factor for
the run size for each test. That is useful for running a reasonable size
of the test, on different machines.

However, when comparing two runs, it seems important that both runs
share a common factor. Otherwise, the factor is determined differently,
and the test is less comparable. For that there is the "--factor" option
or the GLIB_PERFORMANCE_FACTOR environment variable.

However, the factor option can only set the factors for all tests at the
same time. Optimally, one factor is roughly suitable for all tests, but
it is not, as currently the detected factors on my machine are widely
different

  $ ./build/gobject/tests/performance/performance -v > p
  $ cat p | sed -n -e 's/^Running test //p' -e 's/.*correction factor //p' | sed 'N;s/\n/ /'
  simple-construction 34.78
  simple-construction1 145.45
  complex-construction 11.08
  complex-construction1 20.46
  complex-construction2 23.74
  finalization 4.74
  type-check 37.74
  emit-unhandled 5.63
  emit-unhandled-empty 49.69
  emit-unhandled-generic 7.17
  emit-unhandled-generic-empty 50.63
  emit-unhandled-args 5.20
  emit-handled 3.86
  emit-handled-empty 4.01
  emit-handled-generic 3.96
  emit-handled-generic-empty 7.04
  emit-handled-args 3.78
  notify-unhandled 52.63
  notify-by-pspec-unhandled 156.86
  notify-handled 2.55
  notify-by-pspec-handled 2.66
  property-set 34.63
  property-get 32.92
  refcount 0.83
  refcount-1 2.30
  refcount-toggle 1.33

Adjust the base factors with these measurements.

  PERFORMANCE_FILE="./gobject/tests/performance/performance.c"
  IFS=$'\n'
  for LINE in $(cat p | sed -n -e 's/^Running test //p' -e 's/.*correction factor //p' | sed 'N;s/\n/ /') ; do
    (
      IFS=' '
      set -- $LINE
      TESTNAME="$1"
      FACTOR="$2"

      LINENUMBER="$(grep -n "^    \"$TESTNAME\",$" "$PERFORMANCE_FILE" | cut -d: -f1)"
      LINENUMBER=$((LINENUMBER + 2))

      OLD_FACTOR="$(sed -n "$LINENUMBER s/^    \([0-9]\+\),$/\1/p" "$PERFORMANCE_FILE")"

      NEW_FACTOR="$(awk -v factor="$FACTOR" -v old_factor="$OLD_FACTOR" 'BEGIN {print int(factor * old_factor + 0.5)}')"

      sed -i "$LINENUMBER s/^    \([0-9]\+\),$/    $NEW_FACTOR,/" "$PERFORMANCE_FILE"
    )
  done

Afterwards, we get comparable factors:

  $ ./build/gobject/tests/performance/performance -v > p2
  $ cat p2 | sed -n -e 's/^Running test //p' -e 's/.*correction factor //p' | sed 'N;s/\n/ /'
  simple-construction 0.98
  simple-construction1 0.75
  complex-construction 0.99
  complex-construction1 0.96
  complex-construction2 1.02
  finalization 1.05
  type-check 0.98
  emit-unhandled 1.01
  emit-unhandled-empty 1.10
  emit-unhandled-generic 1.03
  emit-unhandled-generic-empty 1.07
  ...

Of course, this measurement was taken in my setup.  But I think it
brings the base factors into a comparable range for most users.

Also, the commit message shows an ugly script how you can re-generate
this for your own purposes.
2025-02-26 12:22:24 +01:00
Thomas Haller
0e1597ffb9 gobject/performance: rework setting the base factor for number of rounds
Move the factor inside the PerformanceTest structure, so it can be
programatically accessed.

More importantly, the number is now expressed directly beside the test
setup (the PerformanceTest structure), all at one place.

Also, each test now gets a separate factor.

This change will be useful in the next commit. So far there is no
notable change in behavior.
2025-02-26 12:22:24 +01:00
Thomas Haller
6a231008e4 gobject/performance: fix "type-check" test to not optimize out test code
Despite assigning the function to a variable, gcc can still detect that
the function never changes and most of the test code is optimized out.
Initialize it somewhere, where the compiler cannot prove that this
function pointer is always set to the same value.

We could also make the pointer volatile, but this approach seems
preferable to me.
2025-02-26 12:22:24 +01:00
Emmanuele Bassi
af586fdd8d Merge branch 'attr-docs-fix' into 'main'
docs: Fix man page link for xattrs

See merge request GNOME/glib!4521
2025-02-26 10:41:40 +00:00
Philip Withnall
73ee0d5e53
docs: Fix man page link for xattrs
It seems to have moved.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-02-26 10:16:57 +00:00
Philip Withnall
cd32927cdb Merge branch '3424-release-instructions' into 'main'
docs: Tweak release instructions around signing

Closes #3424

See merge request GNOME/glib!4474
2025-02-26 09:30:02 +00:00
Philip Withnall
2cee7809d1 Merge branch 'main' into 'main'
Update Georgian translation

See merge request GNOME/glib!4511
2025-02-25 14:47:46 +00:00
Philip Withnall
f8341632fe
tests: Only change the behaviour of getpwuid() inside each test function
The `gutils-user-database` test uses `LD_PRELOAD` to load
`getpwuid-preload.so`, which contains overrides for `getpwuid()`,
`getpwnam_r()` and `getpwuid_r()`. These overrides clear the `pw_name`
field to `NULL` to test handling of a weird error case from an old
systemd implementation of those functions (see !2244).

When running the `G_DISABLE_ASSERT` CI job, this test was crashing
without any debugging output. The `G_DISABLE_ASSERT` CI job runs its
tests under `--setup thorough`, which was the culprit here: the function
overrides in `getpwuid-preload.so` were being loaded (via `LD_PRELOAD`)
into the `bash` process which runs `thorough-test-wrapper.sh` and
causing it to crash.

Interestingly, this couldn’t be reproduced locally with a comparable
version of bash. Perhaps it depends on the CI machine’s environment,
triggering bash to make a `getpwuid()` (or similar) call which it
wouldn’t normally do locally.

So, slightly change `getpwuid-preload.so` to additionally link to
`libglib-2.0.so` and query `g_test_get_path()` to work out whether it’s
being called inside a unit test. If not, don’t modify the return value.

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

Fixes: #3272
2025-02-25 11:42:52 +00:00
Philip Withnall
1438e1c12e Merge branch 'translation' into 'main'
Update Chinese translation

See merge request GNOME/glib!4518
2025-02-25 09:44:59 +00:00
lumingzh
74ec63e29e update Chinese translation 2025-02-25 01:16:33 +00:00
Philip Withnall
3f323fe94f Merge branch 'main' into 'main'
doc: point to iconv(3) and iconv(3posix) for more details about iconv

See merge request GNOME/glib!4515
2025-02-25 00:56:09 +00:00
Reuben Thomas
5fc4248b74 doc: point to iconv(3) and iconv(3posix) for more details about iconv
The documentation in GLib of iconv is forgivably brief. Advanced users (e.g.
for streaming use, for which this API is recommended over the simpler GLib
APIs) will want to know more detail about what happens when there’s an
error: without knowing, you can’t really use this function for streaming.

Point to both iconv(3posix), which gives the fully-portable details, i.e.
all that a user of GLib can rely on, and iconv(3), which is rather easier to
read, and may be of interest to those writing GNU-specific code, or who know
that their GLib is built with libiconv.

The API already promises that it’s the “[s]ame as the standard UNIX routine
iconv()”, so it’s quite safe to point to the relevant man pages; looking at
the source code bears this out, as g_iconv merely calls iconv.
2025-02-25 00:56:07 +00:00
Philip Withnall
87dfae2246 Merge branch 'update_uk1' into 'main'
Update Ukrainian translation

See merge request GNOME/glib!4514
2025-02-24 23:54:57 +00:00