Commit Graph

30207 Commits

Author SHA1 Message Date
Rachida SACI
e9cd534a14 Update Kabyle translation
(cherry picked from commit 573bce8187)
2024-04-02 00:18:32 +00:00
Philip Withnall
2cee8e3d06 Merge branch 'port-gaction-comments-2' into 'main'
Port the remaining documentation comments in `gio/gaction.c` to GI-Docgen

See merge request GNOME/glib!3986
2024-04-01 15:33:54 +00:00
Sudhanshu Tiwari
57d6b945f1 Ported the remaining documentation comments in gio/gaction.c to GI-Docgen 2024-04-01 16:00:23 +01:00
Philip Withnall
e46f2347d2 Merge branch 'style/spelling' into 'main'
docs: spelling and grammar fixes

See merge request GNOME/glib!3990
2024-04-01 14:13:19 +00:00
Philip Withnall
ccc6867391 Merge branch 'fix/gsettings-completion-unset-schemadir' into 'main'
completion: make gsettings work in nounset mode

See merge request GNOME/glib!3989
2024-04-01 14:04:37 +00:00
Philip Withnall
ef461fb391 gsubprocess: Globally ignore SIGPIPE
Just like we already do in `GSocket`.

This is necessary when using `g_subprocess_communicate()` with a
subprocess which calls `close()` on its stdin FD at some point. `cat`
does this just before exiting, for example.

This causes a `write()` to the stdin pipe in the parent process to fail
with `EPIPE` and `SIGPIPE`. The condition is not detectable in advance,
because the `close()` call could happen after the `GMainContext` has
dispatched a `g_subprocess_communicate()` callback.

If it weren’t for the `SIGPIPE`,`g_subprocess_communicate()` would be
able to handle the `EPIPE` just fine. `SIGPIPE` seems like a default
error handling path which was useful in 1980 for writing pipe-heavy
command line apps, but which is more of a broken stair for writing
larger modern apps which have more than one data flow path.

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

Fixes: #3310
2024-04-01 14:41:33 +01:00
Ville Skyttä
b20647c2e2 docs: spelling and grammar fixes
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
2024-04-01 11:01:06 +00:00
Ville Skyttä
bf1508fa76 completion: make gsettings work in nounset mode
With the shell in nounset mode, an error is emitted on referencing
`schemadir` as it is not initialized in all code paths.

Initialize to an empty string to fix.

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
2024-04-01 10:31:34 +00:00
Christian Kirbach
573b4e35d1 Update German translation 2024-03-30 22:19:23 +00:00
Athmane MOKRAOUI
28f9f1c626 Add Kabyle translation
(cherry picked from commit 5e89951a70)
2024-03-29 12:42:15 +00:00
Martin
61c5d91440 Update Slovenian translation 2024-03-29 06:46:59 +00:00
Sabri Ünal
9455ea6038 Update Turkish translation 2024-03-28 14:34:24 +00:00
Philip Withnall
ad903074a4 Merge branch 'sa-onstack-unix-signals' into 'main'
gmain: Use alternate signal stack if the application provides one

See merge request GNOME/glib!3983
2024-03-28 09:09:16 +00:00
Michael Catanzaro
6c95e07b7e Merge branch '3269-en-gb' into 'main'
gio: Change ‘unrecognised’ to ‘unrecognized’ in various user-visible places

See merge request GNOME/glib!3985
2024-03-27 18:31:34 +00:00
Philip Withnall
ed4f29cce8 gio: Change ‘unrecognised’ to ‘unrecognized’ in various user-visible places
The source language of GLib is technically en-US, so we should
consistently use en-US spellings.

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

Helps: #3269
2024-03-27 12:07:42 +00:00
Emmanuele Bassi
9bb63af72e Merge branch 'main' into 'main'
Fix a typo

See merge request GNOME/glib!3984
2024-03-27 09:54:17 +00:00
liulinsong
ce39797fa3 Fix a typo 2024-03-27 17:37:55 +08:00
Marco Trevisan (Treviño)
280c8d41fb gmain: Use alternate signal stack if the application provides one
Some applications, toolkits or languages may define an alternative stack
to use for traces. This is for example the case of go.

So, in case an application defines an alternate signal stack, GLib should
use that instead of the default one to receive signals otherwise it may
break the application expectations and write where it's not allowed to.
2024-03-26 16:29:39 +01:00
Emmanuele Bassi
abd19dbe5c Merge branch 'dataset-failure' into 'main'
tests: Remove unnecessary subprocess from dataset tests

See merge request GNOME/glib!3977
2024-03-26 11:11:06 +00:00
Philip Withnall
faf7874af3 Merge branch 'python-interpreter' into 'main'
Use the python found by meson as the interpreter for installed scripts

Closes #3301

See merge request GNOME/glib!3982
2024-03-26 11:06:44 +00:00
Calvin Walton
013980d839 Use the python found by meson as the interpreter for installed scripts
The python interpreter found by `/usr/bin/env python3` is not
necessarily the same installation as the one that's found by meson's
`pymod.find_installation('python')`. This means that even though meson
is checking that the python installation it found includes the
'packaging' module, the scripts might not have access to that module
when run.

For distribution packaging, it's usually desirable to have python script
interpreters be fully specified paths, rather than use `/usr/bin/env`,
to ensure the scripts run using the expected python installation (i.e.
the one where the python 'packaging' dependency is installed).

The easiest way to fix this is to set the script interpreter to the
`full_path()` of the python interpreter found by meson. The specific
python interpreter that will be used can be selected through the use of
a meson machine file by overriding the "python" program. Many
distributions already have this set up using meson packaging helpers.
2024-03-25 15:17:59 -04:00
Michael Catanzaro
0888d8d5f2 Merge branch 'fix-ncpu' into 'main'
Don't assume CPU_ISSET will return 0 or 1

See merge request GNOME/glib!3979
2024-03-25 14:22:22 +00:00
q66
cc25486b23 Use CPU_COUNT to get the number of set CPUs
This fixes an issue with the number getting very big due to
CPU_ISSET not returning exactly 0 or 1.

This also fixes scenarios where there are holes in the CPU
set. E.g. for a simple run like `taskset --cpu-list 1,2,4 ...`
the old code would return 2 instead of 3, due to iterating
until `ncores` (which is 3) and therefore not accounting for
CPUs further in the set.

Ref https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3784
2024-03-25 12:37:15 +01:00
Michael Catanzaro
e124c34ad6 Merge branch 'io-priority-docs' into 'main'
gio: Fix docs links to description of I/O priority

See merge request GNOME/glib!3978
2024-03-22 15:16:11 +00:00
Philip Withnall
63548f63ec Merge branch 'ebassi/strvbuilder-util' into 'main'
Add unref-to-strv to GStrvBuilder

See merge request GNOME/glib!3952
2024-03-22 01:23:18 +00:00
Philip Withnall
71d60faef3 Merge branch 'copy-move-async-with-closures' into 'main'
Add g_file_copy_async_with_closures() and g_file_move_async_with_closures()

See merge request GNOME/glib!3939
2024-03-22 00:55:07 +00:00
Philip Withnall
7feeafd9db gio: Fix docs links to description of I/O priority
There are a lot of links to the description of I/O priority in the GIO
docs, and they’re all currently broken since the docs build was ported
to gi-docgen.

Use a simple find and replace (see below) to fix them. This doesn’t port
any of the surrounding docs to gi-docgen format, but should still
improve things overall.
```sh
git search-replace --fix '\[I/O priority\]\[io-priority\]///[I/O priority](iface.AsyncResult.html#io-priority)'
```

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

Helps: #3250
2024-03-22 00:53:05 +00:00
Philip Withnall
daaa447620 tests: Add copyright/licensing header to dataset
This is put together through git archaeology:
```
git log -- glib/tests/dataset.c
```

The following commits were too trivial to have meaningful copyright:
 - 1a2c5e155d
 - ea06ec8063
 - 0178402c6d
 - e3d1869ee3
 - c34cc2348c
 - d15e6f7c9c
 - de8672fe0b

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

Helps: #1415
2024-03-22 00:47:28 +00:00
Philip Withnall
44609c3b15 tests: Use g_assert_*() rather than g_assert() in dataset tests
It won’t get compiled out with `G_DISABLE_ASSERT`.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-03-22 00:42:27 +00:00
Philip Withnall
1df5759db9 tests: Remove unnecessary subprocess from dataset tests
The dataset tests are using a subprocess to catch possible deadlocks
within the `test_datalist_clear()` test. However, that’s causing
occasional spurious test failures on the slower CI runners, where the
subprocess can take longer than 500ms to run due to the machine being
overloaded.

Remove the subprocess from the test, and allow the test to deadlock if
it fails. The Meson test harness has a timeout for catching things like
this.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-03-22 00:35:05 +00:00
Philip Chimento
64b06c633a gfile: Add g_file_{copy,move}_async_with_closures
g_file_copy_async() and g_file_move_async() are written in a way that is
not bindable with gobject-introspection. The progress callback data can
be freed once the async callback has been called, which is convenient
for C, but in language bindings the progress callback closure is
currently just leaked.

There is no scope annotation that fits how the progress callback should
be treated:

- (scope call) is correct for the sync versions of the functions, but
  incorrect for the async functions; the progress callback is called
  after the async functions return.
- (scope notified) is incorrect because there is no GDestroyNotify
  parameter, meaning the callback will always leak.
- (scope async) is incorrect because the callback is called more than
  once.
- (scope forever) is incorrect because the callback closure could be
  freed after the async callback runs.

This adds g_file_copy_async_with_closures() and
g_file_move_async_with_closures() for the benefit of language bindings.

See: GNOME/gjs#590
2024-03-22 00:20:00 +00:00
Philip Withnall
1c5f5a6914 Merge branch 'wip/chergert/gpoll-for-gmain' into 'main'
Use ppoll() when possible for more precise timeouts

See merge request GNOME/glib!3958
2024-03-22 00:17:21 +00:00
Emmanuele Bassi
1a5b1393bd Add unref-to-strv to GStrvBuilder
For those projects that cannot use `g_autoptr()`, GStrvBuilder's end
plus unref is not really convenient.

We can crib the "unref to data type" model from GBytes, and have an
additional unref function that also returns the just built GStrv.
2024-03-22 00:08:26 +00:00
Philip Withnall
768b7a6a03 Merge branch '564-gsettings-bind-with-closures' into 'main'
Add g_settings_bind_with_mapping_closures()

Closes #564

See merge request GNOME/glib!3971
2024-03-22 00:00:23 +00:00
Christian Hergert
368cb7eb7b glib/gmain: use ppoll() when possible
If our GPollFunc is set to g_poll() then we can optionally use a poll()
alternative with higher precision. ppoll() provides poll() equivalence
but with timeouts in nanoseconds.

With more precise polling timouts, frame clocks and other timing sensitive
APIs are not restricted to a minimum of 1 millisecond timeout.
2024-03-21 23:46:20 +00:00
Christian Hergert
c840d75395 glib/gmain: plumb timeout as microseconds
This gets access to the timeout as microseconds up until we are about to
enter the GPollFunc. This is useful so that alternative means may be used
to poll with more precision for timeout.
2024-03-21 23:46:20 +00:00
Philip Chimento
685d3dfbdc gsettings: Add g_settings_bind_with_mapping_closures()
This is an introspection-friendly version of g_settings_bind_with_mapping.
Having two callbacks that share the same user data is not supported by
girepository, so the existing function is not introspectable.

Closes: #564
2024-03-21 23:38:13 +00:00
Philip Withnall
afcb839121 Merge branch '3286-strfuncs-annotations' into 'main'
gstrfuncs: Add missing (transfer none) annotations for several funcs

Closes #3286

See merge request GNOME/glib!3963
2024-03-21 23:33:07 +00:00
Emmanuele Bassi
6946c79c7d Merge branch 'version-bump' into 'main'
build: Post-release version bump

See merge request GNOME/glib!3975
2024-03-21 23:30:42 +00:00
Philip Withnall
0cb5a86745 build: Post-release version bump
This opens up the development cycle for 2.82.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-03-20 11:54:39 +00:00
Philip Withnall
e583a35096 Merge branch 'wip/chergert/fix-gvariant-compile' into 'main'
glib/gvariant: fix compile error with GCC 14.0.1

See merge request GNOME/glib!3973
2024-03-20 11:44:17 +00:00
Philip Withnall
bb0e2dc375 Merge branch 'port-gaction-comments-1' into 'main'
Ported the first few documentation comments in `gio/gaction.c` to gi-docgen

See merge request GNOME/glib!3969
2024-03-20 11:34:33 +00:00
Sudhanshu Tiwari
fa5237650b Ported the first 3 documentation comments in gaction.c to gi-docgen 2024-03-20 11:34:33 +00:00
Christian Hergert
e5409374b2 glib/gvariant: fix compile error with GCC 14.0.1
This was erroring on recent GCC because `struct heap_dict` is smaller than
the publicly provided size (guintptr[16]) in the header for GVariantDict.

Port to use `g_malloc()` directly, and use a static assertion to ensure
we’re allocating the larger of the two struct sizes.
2024-03-20 11:18:11 +00:00
Philip Withnall
9828b50b99 Merge branch 'hurd-test-failures' into 'main'
tests: Mark several additional tests as can_fail on GNU Hurd

See merge request GNOME/glib!3974
2024-03-19 13:16:23 +00:00
Philip Withnall
e83e4c5535 tests: Mark several additional tests as can_fail on GNU Hurd
These consistently fail on scheduled CI runs, which is not helping our
ability to catch Hurd regressions.

For example, https://gitlab.gnome.org/GNOME/glib/-/jobs/3709402

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

See: #3148
2024-03-19 13:01:26 +00:00
Philip Withnall
5b9dac546e Merge branch 'th/performance' into 'main'
[th/performance] add script for combining performance results

See merge request GNOME/glib!3954
2024-03-18 15:07:03 +00:00
Philip Withnall
9d9029c50a Merge branch 'th/gobject-toggle-refs-check' into 'main'
[th/gobject-toggle-refs-check] Fix critical warning for toggle notifications in g_object_ref()/g_object_unref()

See merge request GNOME/glib!3959
2024-03-18 14:21:29 +00:00
Thomas Haller
4d5047e0e7 tests/performance: add performance-run.sh script for running performance test
The main use of the performance test is to run it for two (or more) commits
and compare the results. Doing that manually, is cumbersome.

Add a (very hacky) script to help with that. For usage, see the comment
on top of the script.

Example:

  # first:
  meson build -Dprefix=/tmp/glib/ -Db_lto=true --buildtype release -Ddebug=true

  # then:
  GLIB_PERFORMANCE_FACTOR=17.06 \
  PERF='perf stat -r 4 -B' \
  PATCH="2.80.0..th/performance" \
  COMMITS="2.79.3 2.80.0" \
  /tmp/performance-run.sh -s 1 property-get property-set

This will build the requested $COMMITS and print something like:

  ...
  >>> combined result > /tmp/glib-performance-output.all
  Running test property-get
  property-get: Property get per second: 35742719 37208288 (+4.1%)
  Running test property-set
  property-set: Property set per second: 32341232 36942399 (+14.2%)
  Running test property-get
  property-get: Property get per second: 36934401 37143479 (+0.566%)
  Running test property-set
  property-set: Property set per second: 38046387 38165548 (+0.313%)
  Running test property-get
  property-get: Property get per second: 34759576 36359761 (+4.6%)
  Running test property-set
  property-set: Property set per second: 35262505 37651733 (+6.78%)
  Running test property-get
  property-get: Property get per second: 37014537 32870906 (-11.2%)
  Running test property-set
  property-set: Property set per second: 36633026 38216846 (+4.32%)

   Performance counter stats for './build/gobject/tests/performance/performance -s 1 property-get property-set' (4 runs):

            1,312.18 msec task-clock:u                     #    1.000 CPUs utilized               ( +-  4.82% )
                   0      context-switches:u               #    0.000 /sec
                   0      cpu-migrations:u                 #    0.000 /sec
                 121      page-faults:u                    #   92.213 /sec                        ( +-  0.24% )
       5,221,701,009      cycles:u                         #    3.979 GHz                         ( +-  2.61% )
      19,035,814,175      instructions:u                   #    3.65  insn per cycle              ( +-  0.00% )
       4,335,306,010      branches:u                       #    3.304 G/sec                       ( +-  0.00% )
              13,031      branch-misses:u                  #    0.00% of all branches             ( +-  4.17% )
                          TopdownL1                 #     10.3 %  tma_backend_bound
                                                    #      5.3 %  tma_bad_speculation
                                                    #     11.4 %  tma_frontend_bound
                                                    #     73.1 %  tma_retiring             ( +-  2.15% )

  [1]             1.3127 +- 0.0634 seconds time elapsed  ( +-  4.83% )
  [2]             1.2631 +- 0.0253 seconds time elapsed  ( +-  2.00% )

  property-get: Property get per second: 35742719 , 36934401 , 34759576 , 37014537  ;  37208288 , 37143479 , 36359761 , 32870906  ;
  property-set: Property set per second: 32341232 , 38046387 , 35262505 , 36633026  ;  36942399 , 38165548 , 37651733 , 38216846  ;
2024-03-18 13:56:03 +00:00
Thomas Haller
7b9e6d4949 tests/performance: add "refcount-toggle" test
Performance test for emitting toggle reference notifications.
2024-03-18 13:56:03 +00:00