Commit Graph

19761 Commits

Author SHA1 Message Date
Philip Withnall
2327cc4f65 docs: Convert CONTRIBUTING.md to actually be Markdown
This doesn’t change its contents, just its formatting.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-22 13:36:29 +00:00
Piotr Drąg
a3157cc59a Update POTFILES.in 2019-01-21 20:51:41 +01:00
Philip Withnall
5506de3b92 Merge branch '1523-network-monitor-debugging' into 'master'
giomodule: Print the type of each default GIO module

See merge request GNOME/glib!319
2019-01-21 17:48:11 +00:00
Philip Withnall
92b3f22ad5 giomodule: Print the type of each default GIO module
This is useful for debugging in many situations. It’ll be printed with
G_MESSAGES_DEBUG=GLib-GIO or G_MESSAGES_DEBUG=all.

Mostly I need it for debugging the default GNetworkMonitor, but it will
work for all GIO module implementations.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-21 16:27:58 +00:00
Philip Withnall
be10f19752 Merge branch 'settings-portal' into 'master'
Settings portal

See merge request GNOME/glib!450
2019-01-21 12:02:43 +00:00
Matthias Clasen
2854522379 settings: Prefer the keyfile backend when sandboxed
When we are in a sandboxed situation, bump the priority
of the keyfile settings backend above the dconf one,
so we use a keyfile inside the sandbox instead of requiring
holes in the sandbox for dconf.
2019-01-20 21:03:35 -05:00
Matthias Clasen
c63e3a4ada settings: Add support for defaults to keyfile backend
Stacked databases and locks are dconf features that allow
management software like Fleet Commander to set system-wide
defaults and overrides centrally for applications.

This patch adds minimal support for the same to the keyfile
backend. We look for a keyfile named 'defaults' and a
lock-list named 'locks'.

Suitable files can be produced from a dconf database with
dconf dump and dconf list-locks, respectively.

The default location for these files is /etc/glib-2.0/settings/.
For test purposes, this can be overwritten with the
GSETTINGS_DEFAULTS_DIR environment variable.

Writes always go to the per-user keyfile.
2019-01-20 21:03:35 -05:00
Matthias Clasen
5357a23321 settings: Register the keyfile backend as extension
This was not done previously because the backend
could not be instantiated without parameters.
2019-01-20 21:03:35 -05:00
Matthias Clasen
26c8b29ee1 settings: Make the keyfile backend parameterless
Make it possible to instantiate a keyfile settings backend
without specifying parameters, by turning the arguments to
the new() function into construct-only properties. If no
filename is specified, default to
$XDG_CONFIG_HOME/glib-2.0/settings/keyfile
2019-01-20 21:03:35 -05:00
Philip Withnall
e3e4a09716 gvariant-parser: Add explicit unsigned-to-signed casts
Rather than prefixing unsigned numbers with unary minus operators and
expecting the implicit cast to carry the correct value through, add an
explicit cast to a signed type before the unary minus is applied.

In all four cases, an overflow check has already been done.

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

https://gitlab.gnome.org/GNOME/glib/issues/1655
2019-01-19 01:07:57 +00:00
Emmanuele Bassi
3fe6f2a44f Merge branch 'wip/nacho/gdtlsconnection-warning' into 'master'
gdtlsconnection: do not return on a void method

See merge request GNOME/glib!599
2019-01-18 17:59:21 +00:00
Ignacio Casal Quinteiro
e9506d7719 gdtlsconnection: do not return on a void method
Fixes:
warning C4098: 'g_dtls_connection_set_advertised_protocols': 'void' function returning a value
2019-01-18 17:27:44 +01:00
Emmanuele Bassi
da2bf2a280 Merge branch '1500-list-store-state' into 'master'
gliststore: Store validity of last_position explicitly

Closes #1500

See merge request GNOME/glib!596
2019-01-18 16:03:56 +00:00
Philip Withnall
8ce0c49f9c Merge branch '1653-gsocketclient-slow-flaky' into 'master'
tests: Tag gsocketclient-slow test as ‘flaky’

See merge request GNOME/glib!597
2019-01-18 15:57:38 +00:00
Philip Withnall
5612c90fdf tests: Tag gsocketclient-slow test as ‘flaky’
It needs investigating and fixing properly, but let’s not let it disrupt
the CI in the meantime.

Follow-up in https://gitlab.gnome.org/GNOME/glib/issues/1653.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-18 15:27:45 +00:00
Iain Lane
63038d1e4c
gio/tests/gdbus-proxy: test_proxy: check the server is properly killed
We kill the test service at the end of this test. Let's also ensure that
the name on the bus goes away and that we are notified about this
happening.
2019-01-18 15:26:27 +00:00
Iain Lane
7aa83536af
gio/tests/gdbus-proxy: Make proxy_ready test start the server after the proxy
There's a race here, as revealed by Debian's buildds.

We call g_dbus_proxy_new() to create a proxy for the test server, with
callback proxy_ready() Then we call g_spawn_command_line_async() to
start the test server, and then start the main loop.

proxy_ready() assumes that the test server hasn't been started when it
is called. But there is no guarantee that these asynchronous operations
involving spawning a process won't happen in a different order that mean
the bus name *does* have an owner.

What we can do is move starting the server inside of proxy_ready(), so
we know that the test server isn't started until after the proxy is
created. We also add an assertion to check that it is indeed not running
before we execute it.
2019-01-18 15:26:11 +00:00
Philip Withnall
c9aba16af3 gliststore: Store validity of last_position explicitly
Rather than storing it as an invalid value in last_position, store it as
a separate boolean.

This introduces no functional changes, but should fix some warnings from
MSVC.

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

https://gitlab.gnome.org/GNOME/glib/issues/1500
2019-01-18 15:22:19 +00:00
Philip Withnall
1a73410a96 Merge branch '501-test-subprocess-fds' into 'master'
gtestutils: pass open file descriptors to subprocess

See merge request GNOME/glib!595
2019-01-18 15:11:42 +00:00
Paolo Bonzini
69a48333c2 gtestutils: pass open file descriptors to subprocess
The subprocess needs to access the test_log_fd.  If the file descriptors
are not left open, functions such as g_test_message may stomp on file
descriptors open by the subprocess and cause bad behavior of the test.

(Tweaked by Philip Withnall <bugzilla@tecnocode.co.uk> to fix review
comments.)
2019-01-18 14:56:22 +00:00
Simon McVittie
13282768c7
trash test: Don't rely on being able to determine mount points
If we can't find the mount point for target or tmp (as currently
happens on Launchpad autobuilders, and perhaps relatedly, on a
development system that uses btrfs), that's probably not great but is
not really the point of this test.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-17 16:31:10 +00:00
Simon McVittie
56a5cd1337
trash test: Don't assume that ~/.local exists
In a minimal autobuilder environment, this test could conceivably be
the first thing to refer to ~/.local.

Modified by Iain Lane <laney@debian.org>: Don't try to create ~/.local
from tests, but skip if it doesn't exist.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-17 16:31:10 +00:00
Philip Withnall
b3ef8c4e34 Merge branch 'remove-build-dir' into 'master'
Remove leftover build/ directory

See merge request GNOME/glib!592
2019-01-17 14:43:24 +00:00
Xavier Claessens
e3f58236b7 Merge branch 'remove-pc-in' into 'master'
Remove unused .pc.in files

See merge request GNOME/glib!587
2019-01-17 14:24:14 +00:00
Xavier Claessens
f99da40cbc Remove leftover build/ directory
Forgot to remove the directory after moving dirent/ into glib/
2019-01-17 09:23:56 -05:00
Xavier Claessens
011daafb66 Remove unused .pc.in files
They were used by autotools but Meson doesn't need them.
2019-01-17 09:12:48 -05:00
Emmanuele Bassi
1ddcdbb8ec Merge branch 'g_file_info_set_attribute_stringv' into 'master'
gfileinfo: Fix annotation for g_file_info_set_attribute_stringv

See merge request GNOME/glib!591
2019-01-17 12:01:27 +00:00
Tomasz Miąsko
6994be01f4 gfileinfo: Fix annotation for g_file_info_set_attribute_stringv
Annotate `attr_value` parameter of `g_file_info_set_attribute_stringv`
as zero-terminated array, since it isn't currently recognized as such.
2019-01-17 12:43:07 +01:00
Philip Withnall
c9f883b221 Merge branch 'resource-overlay-info' into 'master'
gresource: Complete the overlay support

Closes #1445

See merge request GNOME/glib!497
2019-01-17 10:13:52 +00:00
Philip Withnall
58f7a4d1b1 Merge branch 'msvc-dirent' into 'master'
MSVC: Move dirent implementation to glib/dirent/

See merge request GNOME/glib!588
2019-01-17 09:36:57 +00:00
Xavier Claessens
ec93d9e125 MSVC: Move dirent implementation to glib/dirent/ 2019-01-16 10:24:11 -05:00
Michael Catanzaro
193cc66919 Merge branch 'mcatanzaro/g_assert_cpp' into 'master'
Add separate definitions of g_assert_[non]null() for C++

See merge request GNOME/glib!568
2019-01-15 22:11:39 +00:00
Michael Catanzaro
4a0ce6b458 Add separate definitions of g_assert_[non]null() for C++
In C++ we can use nullptr to ensure g_assert_[non]null() is only called
with pointers. This will introduce build failures in tests that would
have previously compiled, but only in C++, and only for code that
misused these macros. Code using the macros properly will be fine.

This change caught a couple bugs in WebKit's API tests, where I had
accidentally used these functions improperly. E.g. this is now a build
failure in C++:

g_assert_null(webkit_context_menu_get_n_items(menu)); /* Oops! */

Either I wanted to use cmpuint there, or I wanted to use
webkit_context_menu_get_items() to receive a GList* instead.

Another example that will no longer build in C++:

g_assert_null(0); /* Contrived, but 0 is not a pointer! */
2019-01-15 15:57:44 -06:00
Philip Withnall
6a372bf703 Merge branch 'disable-tests' into 'master'
Temporarily disable flaky tests

See merge request GNOME/glib!579
2019-01-15 16:45:15 +00:00
Philip Withnall
419e1485a5 Merge branch 'so-long-autotools' into 'master'
Drop autotools support

See merge request GNOME/glib!580
2019-01-15 15:26:26 +00:00
Philip Withnall
d2062f0a65 docs: Drop pointless leading whitespace
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-15 15:11:43 +00:00
Philip Withnall
b3efef5b6f build: Drop autotools support
So long, and thanks for everything. We’re a Meson-only shop now.

glib-2-58 will remain the last stable GLib release series which is
buildable using autotools.

We continue to install autoconf macros for autotools-using projects
which depend on GLib; they are stable API.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-15 15:11:43 +00:00
Philip Withnall
ac396b4dc1 docs: Drop outdated timestamp and sign-off line
See the git history for that instead.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-15 15:11:43 +00:00
Philip Withnall
855aea45c6 docs: Update debugging docs to mention Meson build options
The behaviour of the Meson build has changed a little vs what we did in
autotools. In autotools, --enable-debug was a tristate (yes, no,
undefined), with all three options resulting in different macro
definitions.

In Meson, we have a bistate of --buildtype={debug,debugoptimized} vs
--buildtype=(anything else). There is no way to automatically define
G_DISABLE_ASSERT or G_DISABLE_CHECKS while building GLib — you need to
define them in your CPPFLAGS in your environment instead.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-15 15:11:43 +00:00
Philip Withnall
7cff1b2265 glib: Update various code comments to mention Meson
Rather than referring to the old autotools build system.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-15 15:11:43 +00:00
Philip Withnall
d08e4661de docs: Update DocBook ‘build’ documentation to mention Meson
Drop mentions of autotools. In particular, update the list of configure
options to reflect what’s available in the Meson build.

Further work is needed as a follow-up to improve our handling of (what
was formerly) the --enable-debug option.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-15 15:11:43 +00:00
Philip Withnall
64bd539d15 docs: Drop outdated cross-building documentation from README.win32
It is very very outdated and irrelevant now.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-15 15:11:43 +00:00
Philip Withnall
aaac7a166f docs: Update HACKING and README to mention Meson rather than autotools
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-15 15:11:43 +00:00
Philip Withnall
c8797d7a42 ci: Drop autotools CI build
We’re about to drop autotools support entirely in master.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-15 15:11:43 +00:00
Philip Withnall
e58e68f932 glib: Link to glib-tap.mk and friends from glib-2-58 branch
We’re about to drop autotools support. Rather than keep the .mk files
around in master indefinitely, link to the versions in the glib-2-58
branch (the last stable release of GLib which supports building with
autotools) in readiness for dropping the .mk files from master.

Any future fixes to these files can happen on the glib-2-58 branch. The
links should work forever (as long as we use GitLab).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-01-15 15:11:43 +00:00
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