Commit Graph

19666 Commits

Author SHA1 Message Date
Philip Withnall
41a8f74ff8 docs: Update INSTALL.in to mention Meson rather than autotools
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-15 15:11:43 +00:00
Philip Withnall
9ea050b131 glib: Port glib-mirroring-tab subdirectory to Meson
We don’t actually build this; the Makefile was just there to allow
ad-hoc regeneration of the glib-mirroring-tab output files.

Port it to Meson just so there are no remnants of GNU make left in GLib.
Don’t hook it up to the rest of the build.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-15 15:11:43 +00:00
Philip Withnall
74099b4045 Merge branch 'document-why-no-msvc-noreturn' into 'master'
gmacros: MSVC supports the noreturn function attribute

See merge request GNOME/glib!583
2019-01-15 14:46:29 +00:00
James Henstridge
9dc0d6bfa5 gio: don't pass O_PATH descriptors to the document portal
Like for the OpenURI portal, O_PATH file descriptors do not prove access
to the underlying file data.  I've used O_RDWR file descriptors here to
mirror the requested read/write permissions.
2019-01-15 16:21:35 +08:00
James Henstridge
e244a78fbc gio: don't use O_PATH file descriptors with OpenURI portal
This change relates to https://github.com/flatpak/xdg-desktop-portal/issues/167

The OpenURI portal requires the caller to pass a file descriptor as
proof of access for local files.  Old versions required this file
descriptor to use the O_PATH mode.  However, this does not prove access
since you can create O_PATH descriptors for files that you can't read.

Since xdg-desktop-portal 1.0.1, regular file descriptors are also
accepted with O_PATH descriptors restricted to flatpaks for the
transition.
2019-01-15 15:59:46 +08:00
Nirbheek Chauhan
2a76dba03e gmacros: MSVC supports the noreturn function attribute
But it can't be used as a drop-in implementation of G_GNUC_NORETURN
because it can only be placed at the start of the function prototype.

Document this in a comment so that the next person doesn't spend
20 min figuring it out.
2019-01-15 01:56:29 +05:30
Daniel Mustieles
5751189fb8 Updated Spanish translation 2019-01-14 15:25:16 +01:00
Anders Jonsson
ff3e781bce Update Swedish translation 2019-01-14 13:17:09 +00:00
Matthias Clasen
37eb1e6645 Add a test for resource overlays
Add a test that checks that g_resources_get_info()
respects the G_RESOURCE_OVERLAYS environment variable.
2019-01-10 13:50:26 -05:00
Matthias Clasen
68bcb8f048 gresource: Complete the overlay support
Unlike the other g_resources_ functions, g_resources_get_info
was not respecting G_RESOURCE_OVERLAYS. Add this missing
support.

Closes: #1445
2019-01-10 12:31:09 -05:00
Matthias Clasen
3aa8b4eba7 Merge branch '1625-nbsp-docs-followup-to-548' into 'master'
gutils: Mention NBSP in g_format_size() documentation

Closes #1625

See merge request GNOME/glib!581
2019-01-10 15:01:34 +00:00
Philip Withnall
76af5dabb4 Merge branch '1625-unbreakable-space-needed-when-showing-size-of-folder-file' into 'master'
Resolve "Unbreakable space needed when showing size of folder/file"

Closes #1625

See merge request GNOME/glib!548
2019-01-10 11:27:04 +00:00
Philip Withnall
f1729119b4 gutils: Mention NBSP in g_format_size() documentation
This is a follow-up to
https://gitlab.gnome.org/GNOME/glib/merge_requests/548.

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

Closes #1625
2019-01-10 11:25:36 +00:00
Philip Withnall
956a54d6d6 tests: Tag several rogue GIO tests as ‘flaky’
These have been flaky for a while now, and nobody has found the time to
fix them properly. They’ve been disrupting development for altogether
far too long.

They need investigating in the following issues, fixing properly, and
the ‘flaky’ tag removing from each one:
 • https://gitlab.gnome.org/GNOME/glib/issues/1644https://gitlab.gnome.org/GNOME/glib/issues/1634https://gitlab.gnome.org/GNOME/glib/issues/1614https://gitlab.gnome.org/GNOME/glib/issues/1515

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-09 10:48:42 +00:00
Philip Withnall
7058efb390 ci: Don’t run tests tagged as ‘flaky’ on the CI machines
This effectively renders those tests useless (since realistically nobody
runs tests locally), but it’s better than every other CI run failing for
unrelated reasons. The idea is that the ‘flaky’ tag can be temporarily
applied to a test while a problem is being investigated or fixed, and
then removed later.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-09 10:47:24 +00:00
Michael Catanzaro
8109eaae5d Merge branch 'wip/mjog/accept-certificate-docs' into 'master'
gio: Update bad cert error in accept-certificate and GTlsError docs

See merge request GNOME/glib!575
2019-01-08 18:29:20 +00:00
Philip Withnall
0d3fe5c350 Merge branch 'queue-clear' into 'master'
Add g_queue_clear_full API

Closes #1464

See merge request GNOME/glib!537
2019-01-08 16:01:09 +00:00
Daniel Mustieles
615f8b60cf Updated Spanish translation 2019-01-08 16:02:40 +01:00
Michael Gratton
d7aedeff29 gio: Update bad cert error in accept-certificate and GTlsError docs
This makes the documented error returned when the cert is rejected
consistent with both self and reality.
2019-01-08 22:40:54 +11:00
Philip Withnall
b8c6ff424a Merge branch 'private-set-alloc0' into 'master'
gthread: Add g_private_set_alloc0() convenience API

See merge request GNOME/glib!516
2019-01-07 19:35:23 +00:00
Philip Withnall
140c2a225a glib.supp: Add a suppression for GMainContext default stacks
Since this uses a private GQueue, we can’t suppress this by using
g_private_set_alloc0().

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-07 18:54:17 +00:00
Philip Withnall
f6caeb6d1a gthread: Add g_private_set_alloc0() internal convenience API
This is a wrapper around g_private_set() which allocates the desired
amount of memory for the caller and calls g_private_set() on it.

This is intended to make it easier to suppress Valgrind warnings about
leaked memory, since g_private_set() is typically used to make one-time
per-thread allocations. We can now just add a blanket suppression rule
for any allocations inside g_private_set_alloc0().

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-07 18:54:17 +00:00
Philip Withnall
990da71e85 Merge branch 'gboolean-docs' into 'master'
docs: Add note on how to check a gboolean condition

See merge request GNOME/glib!571
2019-01-07 16:23:49 +00:00
Alistair Thomas
94d855fc6d docs: Add note on how to check a gboolean condition 2019-01-07 15:19:41 +00:00
Emmanuele Bassi
4f5f34689f Merge branch 'interface-docs' into 'master'
gtype: Clarify type of GInterfaceInitFunc

See merge request GNOME/glib!512
2019-01-07 14:40:44 +00:00
Philip Withnall
74e4b8396f Merge branch 'bad-liststore' into 'master'
Fix overflow in GListStore

Closes #1639

See merge request GNOME/glib!572
2019-01-07 14:09:59 +00:00
Matthias Clasen
d8a0dcb11e list store: Fix overflow issues
Check for over- and underflow when manipulating positions.

This makes the sequence
  g_list_model_get_item (store, 0);
  g_list_model_get_item (store, -1u);
return NULL for the second call, as it should.

Closes: #1639
2019-01-07 08:53:16 -05:00
Matthias Clasen
471153fb20 liststore: Add a test demonstrating overflow issues
Calling
  g_list_model_get_item (store, 0);
  g_list_model_get_item (store, -1u);
does not return NULL for the second call, as it should.

This was showing up in GTK+ list model tests.
2019-01-07 08:52:47 -05:00
Philip Withnall
eeb657bb0f Merge branch '1637-win32-uninitialised-variable' into 'master'
gwin32appinfo: Fix a potential free of an uninitialised variable

Closes #1637

See merge request GNOME/glib!573
2019-01-07 11:04:22 +00:00
Philip Withnall
29e8f5795d gwin32appinfo: Fix a potential free of an uninitialised variable
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1637
2019-01-07 10:25:46 +00:00
Rico Tzschichholz
245279e834 Merge branch '1636-gtask-getters' into 'master'
gtask: Ensure to return 1 or 0 from getters rather than truthy ints

Closes #1636

See merge request GNOME/glib!570
2019-01-05 09:08:22 +00:00
Philip Withnall
8dced725c2 Merge branch 'annotation-fix' into 'master'
goption: Fix an annotation on g_option_context_parse_strv()

See merge request GNOME/glib!545
2019-01-05 07:57:17 +00:00
Philip Withnall
ae381d795e gtask: Ensure to return 1 or 0 from getters rather than truthy ints
Since commit 290bb0dd, where various members of GTask were converted to
a bitfield, some of the getters:
 • g_task_get_check_cancellable()
 • g_task_get_return_on_cancel()
 • g_task_get_completed()
have been returning truthy ints (zero or an arbitrary non-zero integer)
as boolean values, rather than the canonical boolean ints of 1 and 0.

This broke the `yield` statement in Vala, whose generated C code
compares `g_task_get_completed (…) != TRUE`. i.e. Whether the
`completed` field has a value not equal to 1.

Fix this by explicitly converting truthy ints to canonical boolean ints
in all getters.

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

https://gitlab.gnome.org/GNOME/glib/issues/1636
2019-01-05 07:51:14 +00:00
Philip Withnall
33158c86c1 Merge branch 'wip/nacho/gpoll' into 'master'
win32 gpoll: overcome the 64 handles limit

See merge request GNOME/glib!535
2019-01-04 11:20:11 +00:00
Simon McVittie
f63b1da918 Merge branch 'iface-init-docs' into 'master'
gtype: Document type for iface_default_init() function

See merge request GNOME/glib!564
2019-01-03 20:07:14 +00:00
Simon McVittie
986b0a5965 Merge branch '1055-will-the-alignment-never-end' into 'master'
gmacros: Don’t use __alignof__ in G_ALIGNOF implementation

Closes #1055

See merge request GNOME/glib!559
2019-01-03 09:42:52 +00:00
Anders Jonsson
cfd2e83709 Update Swedish translation 2018-12-29 22:45:17 +00:00
Ignacio Casal Quinteiro
7f1023b0b8 Use lowercase to include winsock2 2018-12-28 15:30:28 +01:00
Ignacio Casal Quinteiro
97f4ce5a77 meson: build gpoll test on windows 2018-12-28 14:41:53 +01:00
Ignacio Casal Quinteiro
a9ea169b64 win32: increase the fds and pollees on the gpoll test
Also change the repeat define to do a single pass so we do
not timeout
2018-12-28 13:28:43 +01:00
Ignacio Casal Quinteiro
24714b50df win32 gpoll: overcome the 64 handles limit
This is a new polling method allowing to poll more than 64 handles
based on the glib one.
When we reach the limit of 64 we create a thread and we poll
on that thread for a batch of handles this way we overcome the limit.

https://gitlab.gnome.org/GNOME/glib/issues/1071
2018-12-28 13:28:43 +01:00
Ignacio Casal Quinteiro
0d2f7074ea gpoll: rename timeout to timeout_ms for clarity 2018-12-28 13:28:43 +01:00
Philip Withnall
154b24c055 gtype: Document type for iface_default_init() function
And mention why it’s not a GInterfaceInitFunc as people who have read
the GObject docs cover-to-cover might expect.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-12-27 23:46:42 +00:00
Philip Withnall
db0bce02cb Merge branch 'win32-spawn-escaping' into 'master'
gspawn, win32: qouted args - escape end backslash

See merge request GNOME/glib!419
2018-12-27 12:52:04 +00:00
Vasily Galkin
22e875f710 gspawn, win32: quoted args - escape end backslash
According to msdn documentation last backslash(es) of quoted argument
in a win32 cmdline need to be escaped, since they are
directly preceding quote in the resulting string:
https://docs.microsoft.com/en-us/cpp/c-language/parsing-c-command-line-arguments

Glib <=2.58.0 passed children arguments like C:\Program Files\
without escaping last backslash(es).
So it had been passed as "C:\Program Files\"
windows command line parsing treated this as escaped quote,
and later text was treated as argument continuation instead of separate
arguments.

Existing implementation wasn't easily adoptable to fix this problem,
so escaping logic was rewritten.
Since the resulting length need to be increased due to extra escaping
it was rewritten too. Now the calculated length assumes that all
escapable chars would be escaped in a resulting string,
so the length may be a bit bigger than actually needed,
since backslashes not preceding quotes are not escaped.

This fixes the glib/tests/spawn-singlethread.c test
(which introduced testing for special chars to make this problem
testable).
The problem itself was found during investigations about fixing
related https://gitlab.gnome.org/GNOME/glib/issues/1566

The logic is duplicated in protect_argv_string() and protect_wargv() funcs.
However there is no single obvious way to get rid of duplication -
https://gitlab.gnome.org/GNOME/glib/merge_requests/419#note_371483

So by now adding a note referencing protect_wargv from protect_argv_string,
the other direction is already referenced.
2018-12-27 00:06:58 +03:00
Vasily Galkin
f7f597c841 gspawn, win32: fix child stderr when coverage enabled
This fixes test that were added in previous commit:
checking for empty stderr failed with coverage enabled, since
coverage warnings printed from gspawn-win32-helper process were treated
as child output. This is fixed by removing redirection after child
finishes execution.

The dup_noninherited renamed to reopen_noninherited,
since it actually always closes passed file descriptor.
2018-12-27 00:00:50 +03:00
Vasily Galkin
cafb61a179 gspawn, win32: fix redirecting only stderr
Problem was just a typo - wrong variable was checked before enabling
stderr redirection.
This fixes error-only redirection spawn-test added in previous commit.

Behavior while redirecting only stdout should be unaffected,
since old code tried to redirect stderr to -1 in such case,
which silently failed I think.
2018-12-26 23:55:28 +03:00
Vasily Galkin
50cb4f221c gspawn, tests: extend spawn_test, run it on win32
The spawn_test is enabled on win32 meson build, both msys and msvc.

Some modifications to make it useful for auto-testing on win32:
- use own argv0 to find helper win32-specific subprogram
- helper subprogram and conditions changed, so testing is fully
automated instead of manually checking contents of some MessageBoxes

Redirection test checks "sort" output for locale-independent string
instead of relying on "netstat" locale-dependent string.
Also with "sort" it become usable on unix, so enabled there too.
Currently this fails on win32 with coverage since
some coverage-realted error output from gpawn-win32-helper
is unexpectedly treated as executed subprocess output.


Added test checking "sort" with error-only redirection. This also fails
on win32 by now, due to a typo in gspawn-win32.c (checks for stdout
redirection instead of stderr)
2018-12-26 23:45:47 +03:00
Vasily Galkin
387739b018 gspawn, tests: check passing special chars in args
The existing singlethread g_spawn_sync test is modified and now tests
that special characters in arguments are correctly passed to child.
The test is added before spawn escaping fixing on win32
and covers the case currently broken on win32:
'trailing \ in argument containing space'.
2018-12-26 23:30:57 +03:00
Philip Withnall
940537bec7 Merge branch '1623-gio-open-docs' into 'master'
docs: Mention handling of filenames containing colons in gio docs

Closes #1623

See merge request GNOME/glib!550
2018-12-23 22:09:22 +00:00