18150 Commits

Author SHA1 Message Date
Philip Withnall
4a27a88d29 ci: Use v3 of the Docker image for CI builds
Don’t update to the full CI setup from master, since its success depends
on other fixes which are only present in master. However, using v1 of
the Docker image is no longer possible since it’s been removed from the
registry. Using v3 should enable CI builds for glib-2-56 to succeed.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-06-13 14:07:18 +01:00
Philip Withnall
826676e826 Merge branch '101-dbus-is-supported-glib-2-56' into 'glib-2-56'
Backport "g_dbus_is_supported_address(): set error if returning FALSE" to glib-2-56

See merge request GNOME/glib!103
2018-06-13 12:38:05 +00:00
Will Thompson
aaa00b5c98 g_dbus_is_supported_address(): set error if returning FALSE
Previously, calling:

    g_dbus_is_supported_address ("some-imaginary-transport:", NULL)

correctly returned FALSE; but calling:

    g_dbus_is_supported_address ("some-imaginary-transport:", &error)

crashed with:

    GLib-GIO:ERROR:../gio/gdbusaddress.c:434:g_dbus_is_supported_address:
    assertion failed: (ret || (!ret && (error == NULL || *error != NULL)))

This was because, if the address component did not start with a known
transport, no error was set. Fix this, reusing an error string used by
the corresponding else branch in g_dbus_address_connect(), and adjust
the test to pass both NULL and non-NULL GError **s to this function in
every test case. This case:

    g_assert (!g_dbus_is_supported_address ("some-imaginary-transport:foo=bar;unix:path=/this/is/valid", NULL));

would have caught this bug with a non-NULL GError **.
2018-06-13 13:35:35 +01:00
Xavier Claessens
c0e6cc3a40 Merge branch 'cherry-pick-95ebaa26' into 'glib-2-56'
Merge branch '1401-g_clear_handle_id-clear_func-not-nullable' into 'master'

See merge request GNOME/glib!56
2018-06-05 14:43:36 +00:00
Philip Withnall
cfa28e152b Merge branch '1401-g_clear_handle_id-clear_func-not-nullable' into 'master'
g_clear_handle_id: don't accept NULL clear_func

Closes #1401

See merge request GNOME/glib!55

(cherry picked from commit 95ebaa26aa5b2a5f6e5ee554a6d185d296f6dc08)

0f7c196c g_clear_handle_id: don't accept NULL clear_func
2018-06-04 13:43:21 +00:00
Philip Withnall
69dec2db49 Merge branch 'lrn/issue-1240_glib-2-56' into 'glib-2-56'
W32: Make _g_win32_get_system_data_dirs() inline available in C++ (glib-2-56 backport)

See merge request GNOME/glib!29
2018-05-28 08:58:46 +00:00
Руслан Ижбулатов
d5f1da8c39 W32: Make _g_win32_get_system_data_dirs() inline available in C++
This way g_get_system_data_dirs() works the same way in C and C++.

https://bugzilla.gnome.org/show_bug.cgi?id=777501

Closes #1240
2018-05-28 08:48:06 +00:00
Руслан Ижбулатов
0bc1e98af6 W32: check filename for being NULL in g_stat()
Previous version of this function started with a call to g_utf8_to_utf16(),
which also served as a NULL check, since g_utf8_to_utf16() just returns NULL
on NULL strings. Current version of this function does some filename string
checks first and converts it to utf16 only after these checks are done, and
these checks do not take into account the possibility of filename being NULL.

Fix this by explicitly checking for NULL.
2018-05-22 16:47:34 +00:00
Nirbheek Chauhan
4c364635ed meson: Update glib version 2018-05-05 03:19:54 +05:30
Philip Withnall
0489f609ca gobject: Reimplement g_param_values_cmp() for GParamSpecVariant
The existing implementation was completely incorrect (despite the fix in
commit 566e64a66) — it always compared GVariants by pointer, rather than
by value.

Reimplement it to compare them by value where possible, depending on
their type. The core of this implementation is g_variant_compare(). See
the documentation and tests for further details of the new sort order.

This adds documentation and tests.

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

https://bugzilla.gnome.org/show_bug.cgi?id=795735
2018-05-04 18:20:22 +01:00
Philip Withnall
69924c45b9 Revert "Fix the cmp implementation for variant values"
This reverts commit 623f92ed2df41265c11c3ca1e03176033045d4de.

This fix went from one broken state to another. The real fix is to use
g_variant_compare(), which is pending review. See bug #795735.

https://bugzilla.gnome.org/show_bug.cgi?id=795735
2018-05-04 17:24:31 +01:00
Iñigo Martínez
cd1f82d8fc gdbus-codegen: Fix header include in the body file
When body file is generated, the header name to be included is
built by using the path passed by `--output` directory. However,
this might not be correct because, if the path includes a
subdirectory, the whole path will be used instead of only the
base name.

Please see:
  https://github.com/mesonbuild/meson/issues/3488
  https://github.com/gnome-mpv/gnome-mpv/issues/305#issuecomment-385056156

https://bugzilla.gnome.org/show_bug.cgi?id=795802
2018-05-04 17:17:38 +01:00
Matthias Clasen
623f92ed2d Fix the cmp implementation for variant values
This was causing g_param_value_defaults to return 1
for GVariant values even when the value is clearly
different from the default.

This was showing up as gtk-builder-tool stripping
non-default values for GtkActionable::action-target
from ui files.
2018-05-02 08:29:31 -04:00
Christoph Reiter
7132abe1e6 ci: update meson
Rebuild the fedora docker image to get the newest meson release.

(Backport 2.56: Tweaked by Philip Withnall <withnall@endlessm.com> to
drop MSYS2 changes.)

https://bugzilla.gnome.org/show_bug.cgi?id=795711
2018-05-02 11:11:45 +01:00
Philip Withnall
c96e45496c gutils: Fix deadlock if g_get_home_dir() fails when called twice
If g_get_home_dir() calculated a NULL home directory (due to $HOME being
unset and /etc/passwd being inaccessible, for example due to an
overly-zealous LSM), it would call g_once_init_leave (&home_dir, NULL),
which would emit a critical and fail to leave the GOnce critical
section. That meant that the following call to g_get_home_dir() would
deadlock in g_once_init_enter().

Fix that by setting the home directory to a made-up value in such cases
(which the documentation handily already explicitly allows).

Thanks to Simon McVittie for the analysis leading to an easy patch.

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

https://bugzilla.gnome.org/show_bug.cgi?id=773435
2018-04-26 15:24:26 +01:00
Philip Withnall
fea050d9d5 tests: Drop a slightly suspect GResolver test
This test will only work on machines which have IPv6 enabled and have a
local IPv6 interface with ID 1. On machines which don’t (such as AWS
servers, which we run CI tests on), the GResolver tests will fail with
G_RESOLVER_ERROR_INVALID. We can’t differentiate this kind of failure
(where we’d want to skip the test) from an actual failure (where we’d
want to fail the test), so the only other option is to drop this
particular test vector. I don’t think it’s a significant loss.

This is the last fix needed to get our CI tests working reliably on
jenkins.gnome.org.

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

https://bugzilla.gnome.org/show_bug.cgi?id=795234
2018-04-26 09:55:14 +01:00
Philip Withnall
89463e0c53 tests: Skip GSocket tests if setting up a server fails
There are various reasons why setting up a server might fail; it
reliably fails on AWS with IPv6 addresses (are we binding to the right
address?). Since we’re trying to test GSocket as a client, skip tests
where that happens.

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

https://bugzilla.gnome.org/show_bug.cgi?id=795234
2018-04-26 09:55:06 +01:00
Xavier Claessens
51792786e6 Fix build when pthread_getname_np is not available
On Android _setname_ is always available but _getname_ is available only
with API level >= 26.

https://bugzilla.gnome.org/show_bug.cgi?id=795406
2018-04-25 13:58:23 -04:00
Xavier Claessens
297e9debe3 Meson: Add missing link on libintl in tests
This fix undefined symbol link error when building for non-glibc
platform. Applications must link on libintl, it is not a public
dependency of libglib.

On glibc platforms libintl is a not found dependency and is just ignored
by meson, so it doesn't hurt to always have it.

https://bugzilla.gnome.org/show_bug.cgi?id=795406
2018-04-25 13:58:23 -04:00
Xavier Claessens
7ca9a04e82 struct ip_mreq_source definition is broken on Android NDK <= r16
This fix the build on Android r16 and older, see:
https://issuetracker.google.com/issues/36987220

https://bugzilla.gnome.org/show_bug.cgi?id=740791
2018-04-24 15:49:29 -04:00
Xavier Claessens
b757036b3f Tests: gsubprocess: Do not use stdin/stdout variables
https://bugzilla.gnome.org/show_bug.cgi?id=795406
2018-04-24 15:48:40 -04:00
Kentaro Hayashi
926a5c5e53 gobject: Fix redundant warning message in glib-genmarshal
glib-genmarshal shows redundant "time" warning message against combination with --header and --body option.

Before:

  WARNING: Using --header and --body at the same time time is deprecated; use --body --prototypes instead

After:

  WARNING: Using --header and --body at the same time is deprecated; use --body --prototypes instead

https://bugzilla.gnome.org/show_bug.cgi?id=795429
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
2018-04-23 16:26:00 +01:00
Stas Solovey
3975d54bca Update Russian translation 2018-04-20 20:48:36 +00:00
Fabrice Fontaine
8de72c56a0 gobject: fix compilation with gcc <= 4.7
On gcc 4.7, we got the following error:

i686-nptl-linux-gnu-gcc --version
> i686-nptl-linux-gnu-gcc (crosstool-NG 1.20.0) 4.7.4
> $ echo '#include <glib-object.h>' | i686-nptl-linux-gnu-gcc -x c -I
staging/usr/include/glib-2.0 -I staging/usr/lib/glib-2.0/include -Wall
-Werror -c - -o /tmp/foo.o
> In file included from
staging/usr/include/glib-2.0/gobject/gbinding.h:29:0,
>                  from staging/usr/include/glib-2.0/glib-object.h:23,
>                  from <stdin>:1:
> staging/usr/include/glib-2.0/gobject/gobject.h: In function
'g_set_object':
> staging/usr/include/glib-2.0/gobject/gobject.h:725:5: error: value
computed is not used [-Werror=unused-value]
> cc1: all warnings being treated as errors

This error has been added by commit 3fae39a5d742afe73741f5fd7aa24e3ae8182f06
So enable the new g_set_object definition only if gcc >= 4.8

Fixes:
 - http://autobuild.buildroot.net/results/b29a2f868438a2210873ea72f491db63175848be

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=795138
2018-04-20 11:32:37 +01:00
Philip Withnall
d060ab922e tests: Fix a minor memory leak in the GFileMonitor tests
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=755721
2018-04-18 15:37:33 +01:00
Philip Withnall
21d761b4e2 tests: Add a GFileMonitor test for G_FILE_MONITOR_WATCH_HARD_LINKS
Add a test for monitoring an existing local file, with the
WATCH_HARD_LINKS flag specified. This would previously cause a crash;
now it doesn’t.

This test contains a FIXME where I suspect we should be getting some
additional file change notifications from changes made through the hard
link; this requires further follow up and probably further fixes to our
inotify backend.

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

https://bugzilla.gnome.org/show_bug.cgi?id=755721
2018-04-18 15:37:33 +01:00
Philip Withnall
b326c23d63 inotify: Further fixes for hard link monitoring support
This gets the G_FILE_MONITOR_WATCH_HARD_LINKS flag to the state where it
doesn’t cause crashes, and essentially acts as a no-op. It will not yet
actually monitor for changes made via hard links.

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

https://bugzilla.gnome.org/show_bug.cgi?id=755721
2018-04-18 15:37:33 +01:00
Ryan Lortie
3f66ab2ede inotify: fix segfault on watching hard links
The call to _start() fills in the dirname, basename, and filename
arguments according to the following rules:

  dir watches: dirname filled

  file watches: dirname and basename filled

  hardlink: filename filled

This doesn't map to how the current inotify backend works very nicely,
so we need to adjust things a bit when creating our "sub" objects.

https://bugzilla.gnome.org/show_bug.cgi?id=755721
2018-04-18 15:37:33 +01:00
Stas Solovey
78aa070a24 Update Russian translation 2018-04-12 11:45:34 +00:00
Stas Solovey
f403e16797 Update Russian translation 2018-04-12 11:41:26 +00:00
Fabrice Fontaine
1d2e685d90 gio: fix compilation without F_{S,G}ETPIPE_SZ
Commit a5778ef7c51044147fe470ea1707dd297f44f880 broke compilation on
architectures without F_SETPIPE_SZ and F_GETPIPE_SZ such as or1k.
If those variables are undefined, put back previous behavior, buffer
size set to 1024 * 64

Fixes:
 - http://autobuild.buildroot.net/results/398490e07343a931b25ca6ab5c90a75d7a073e9f

(Modified by Philip Withnall <withnall@endlessm.com> to add an
explanatory comment.)

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=795133
2018-04-11 15:40:35 +01:00
Руслан Ижбулатов
96904149e2 W32 gstdio: Don't try to get reparse tag unconditionally
We do not need to use FindFirstFileW() to get a reparse tag if the
file that is being examined is not a reparse point.

This is a quick and relatively painless fix for the fact that
FindFirstFileW() fails on root directories. Since root directories
are unlikely to be reparse points (is it even possible?), not using
this function on non-reparse-points just sidesteps the issue.

https://bugzilla.gnome.org/show_bug.cgi?id=795153
2018-04-11 12:56:11 +00:00
Руслан Ижбулатов
9200ba1ea7 W32 gstdio: don't close fd handle
If a handle was obtained from a fd that we got from up the stack,
we shouldn't call CloseHandle() on it in case of an error.

This is a bug. Luckily, it happens only on the error codepath, so,
hopefully, no one had hit it yet.
2018-04-11 12:56:09 +00:00
Matej Urbančič
262a0a833d Updated Slovenian translation 2018-04-10 17:54:11 +02:00
Ryan Schmidt
6106d18ae6 gio: Fix build on OS X < 10.9
Commit 170466db accidentally partially reverted commit d1a03bc7.
Reinstate the missing check for OS X 10.9.

The Meson build does not have this problem.

https://bugzilla.gnome.org/show_bug.cgi?id=794380
2018-04-10 12:25:52 +01:00
Iain Lane
e4227408b2 tests/network-monitor: Always use the dummy proxy resolver
If glib-networking is installed and built with libproxy support, this
test will use it. If a proxy is set in the environment, we might get
correctly told to go through it for certain accesses. However, this isn't
going to work, because the testsuite monkeys with the network monitor to
tell it that all addresses - including the proxy - aren't reachable.

We're trying to check if adding networks to a GNetworkMonitor works in
general. Proxies just get in the way here, so let's use the built in
dummy proxy resolver which just tells us that all URLs are directly
accessible.

https://bugzilla.gnome.org/show_bug.cgi?id=794801
2018-04-10 10:36:42 +01:00
Matthias Clasen
d0364b4438 2.56.1 2.56.1 2018-04-06 22:35:38 -04:00
Matej Urbančič
ecabc6e21c Updated Slovenian translation 2018-03-27 22:32:28 +02:00
Piotr Drąg
ad11be086a Spell Portuguese month and weekday names in lowercase
https://bugzilla.gnome.org/show_bug.cgi?id=794686
2018-03-27 20:50:06 +02:00
Ting-Wei Lan
5ef27d0e26 gpollfilemonitor: Fix use-after-free caused by leaking GSource
https://bugzilla.gnome.org/show_bug.cgi?id=794528
2018-03-26 10:58:37 +01:00
Sebastian
fe939d2b70 gthreadedresolver: Fix compilation with res_nclose() but no res_nquery()
Some very odd systems have the functions to initialise and destroy a
struct __res_state, but apparently not to do a DNS query using it. Fix
the compilation on those systems.

https://bugzilla.gnome.org/show_bug.cgi?id=794606
2018-03-26 10:51:13 +01:00
Sam Spilsbury
3c5e8a65fd glib-mkenums: Don't go into an infinite loop trying to find a matching {
If we reach EOF before this happens, error out as opposed to
looping around forever.

https://bugzilla.gnome.org/show_bug.cgi?id=794506
2018-03-21 15:12:47 +00:00
Sam Spilsbury
145e45f55d glib-mkenums: Don't treat typedef enum _SomeIdentifier {} as syntax error
Previously we were only detecting typedef\*senum\s*\{, which does not
handle the case where there is an entifier for the enum itself but
not the typedef. glib-mkenums would then attempt to read the next line
looking for a matching {, but in vain.

https://bugzilla.gnome.org/show_bug.cgi?id=794506
2018-03-21 15:12:47 +00:00
Frank Dana
09f3918952 Remove duplicated option in gio.xml
The gio(1) man page entry for the tree subcommand lists '-h' twice under its Options, because that flag was duplicated in the source xml.

https://bugzilla.gnome.org/show_bug.cgi?id=794473
2018-03-21 14:39:51 +00:00
Dušan Kazik
39a01037dd Update Slovak translation 2018-03-17 11:34:51 +00:00
Chun-wei Fan
c20c1b548b Fix Visual Studio projects
We are transitioning to Meson for Visual Studio builds, but since the
Visual Studio projects are still around, we ought to keep them
up-to-date (and these projects are needed to build for Visual Studio
2008, at least for x64 builds).

Adapt to the source additions and merges for building
gio-querymodules.exe and gspawn-win[32|64]-helper-console.exe.
2018-03-16 17:29:35 +08:00
Philip Withnall
66948ae231 gapplication: Tighten up application ID validation
Tighten up the validation of application IDs so they are always exactly
D-Bus well-known names. This is a slight change to the accepted format,
but since anyone using the API with an application ID which was
previously valid, but which was not a valid D-Bus well-known name, would
have received an error from D-Bus when their application tried to
register on the bus, I think this break is acceptable.

It will affect any applications which have application IDs which are not
valid D-Bus well-known names, and which use the G_APPLICATION_NON_UNIQUE
flag. From a quick search in Debian Codesearch, no C applications use
that flag.

Update the documentation to use the rules from the D-Bus specification,
including the latest advice discouraging use of hyphens:

https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-bus

Update the tests:
 • Add the examples from the documentation to validate them.
 • Especially the venerable 7-zip.org example.
 • Move a couple of tests from expected-failure to expected-success:
   they are valid D-Bus well-known names even if they’re a bit weird.

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

https://bugzilla.gnome.org/show_bug.cgi?id=793400
2018-03-13 12:51:38 +00:00
Philip Withnall
d754e017ea tests: Use modern test assertions in GApplication test
This will make the assertion failure messages a little more useful, and
prevent the assertions being compiled out with G_DISABLE_ASSERT.
Introduces no functional changes.

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

https://bugzilla.gnome.org/show_bug.cgi?id=793400
2018-03-13 12:51:38 +00:00
Michael Olbrich
abe329343f gobject_gdb.py: 'address' is a property of gdb.Value not a function
'address' started out as a function, but it was changed to a property
before the gdb Python support was release with gdb 7.0.

https://bugzilla.gnome.org/show_bug.cgi?id=794194
2018-03-13 11:28:06 +00:00
Rafal Luzynski
987bf5bbeb gdatetime: Add missing #define WEEKDAY_FULL_IS_LOCALE
One more #define WEEKDAY_FULL_IS_LOCALE was missing from the commit
12f11090dc1b6062f4a493d79b382714ebbdc413.

https://bugzilla.gnome.org/show_bug.cgi?id=793578
2018-03-13 10:52:08 +00:00