Commit Graph

21344 Commits

Author SHA1 Message Date
Emmanuele Bassi
9f6b5235e4 Merge branch 'ci-fixups' into 'master'
Minor CI fixups

See merge request GNOME/glib!1258
2019-11-28 12:29:10 +00:00
Philip Withnall
805dc2ae93 ci: Move style-check-diff commands out to a separate sh file
This doesn’t change how they run, but does split the code out a bit and
mean we can interleave it with comments. Should make it a little less
vile.

Suggested by Emmanuele Bassi; see !1252.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-11-28 11:47:48 +00:00
Philip Withnall
95b8c1c697 ci: Use extends rather than YAML anchors for only-default
This makes things slightly more extensible in future, but introduces no
functional differences right now.

See https://docs.gitlab.com/ce/ci/yaml/README.html#extends.

Suggested by Jordan Petridis.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-11-28 11:38:25 +00:00
Philip Withnall
a2fa23ab73 Merge branch 'wip/lantw/kqueue-Do-not-return-early-from-_kqsub_cancel' into 'master'
kqueue: Do not return early from _kqsub_cancel

Closes #1935

See merge request GNOME/glib!1232
2019-11-28 09:28:20 +00:00
Philip Withnall
4546b9abfe ci: Build Docker images rather than OCI images if using podman
The dockerd instance on some (but not all) GitLab CI runners doesn’t
like the OCI output from the version of podman on Fedora 31, which is
causing a lot of spurious CI failures.

If whoever’s running `run-docker.sh` is using podman to emulate docker,
it needs to be told to output in Docker format, not OCI format.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-11-27 15:06:11 +00:00
Ting-Wei Lan
6d734b895a kqueue: Do not return early from _kqsub_cancel
_kqsub_free assumes the caller has called _kqsub_cancel before calling
it. It checks if both 'deps' and 'fd' have been freed and aborts when
the condition is not met. Since the only caller of _kqsub_free is
g_kqueue_file_monitor_finalize, which does call _kqsub_cancel before
calling _kqsub_free, it seems to be correct for _kqsub_free to assert
values of these two members there.

However, it is possible for _kqsub_cancel to return early without
freeing any resource _kqsub_free expects to be freed. When the kevent
call fails, _kqsub_cancel does not free anything and _kqsub_free aborts
with assertion failure. This is an unexpected behavior, and it can be
fixed by always freeing resources in _kqsub_cancel.

Fixes: https://gitlab.gnome.org/GNOME/glib/issues/1935
2019-11-27 22:49:56 +08:00
Philip Withnall
8c68e30eb8 Merge branch 'wip/hadess/add-sudo-fedora-docker' into 'master'
Add sudo to Fedora docker image

See merge request GNOME/glib!1235
2019-11-27 14:19:19 +00:00
Philip Withnall
cd11067a03 ci: Use new Fedora v5 Docker image for all CI jobs
v5 was built using the fedora.Dockerfile updates from the previous few
commits.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-11-27 13:23:45 +00:00
Bastien Nocera
c625c37dde ci: Remove python3{,-pip} from list of packages
Package python3-3.7.5-1.fc30.x86_64 is already installed.
Package python3-pip-19.0.3-3.fc30.noarch is already installed.
2019-11-27 13:23:12 +00:00
Bastien Nocera
fd4d68615f ci: Add sudo support for default Fedora docker user 2019-11-27 13:23:12 +00:00
Bastien Nocera
aa8908f469 ci: Update the Fedora docker to a supported version
Fedora 29 is only supported up until 2019-11-29, bump version to 30.
2019-11-27 13:23:12 +00:00
Bastien Nocera
d38d6bf8ea ci: Add gnome-desktop-testing to the Fedora docker image
With plans to run the installed-tests on Fedora soon.
2019-11-27 13:23:12 +00:00
Philip Withnall
dc3f46380c Merge branch 'ci-fix' into 'master'
ci: Fix running all jobs on merge requests

See merge request GNOME/glib!1252
2019-11-27 13:04:49 +00:00
Philip Withnall
a937e99ca5 Merge branch 'wip/oholy/gio-mount-uuid' into 'master'
gio-tool-mount: Allow mounting by the given UUID

See merge request GNOME/glib!1249
2019-11-27 12:50:58 +00:00
Ondrej Holy
dd49962eaf gio-tool-mount: Do not print anything if "gio mount -d" suceeded
"gio mount" doesn't print anything in case of success, however "gio mount -d"
prints "Mounted [id] at [mount_path]", which is inconsistent. It might probably
make sense for fstab volumes, but "gio mount -d" now support UUIDs which are
heavily used for daemon mounts and I think that it is not wise to print
"/run/user/$UID/gvfs" mount paths. The mount path can be still found over
"gio mount -l". Let's remove this message to make it more consistent.
2019-11-27 13:37:51 +01:00
Ondrej Holy
8c24b7cd6e gio-tool-mount: Allow mounting by the given UUID
"gio mount" only allows mounting volumes using device files, but not using
UUIDs. Volume monitors for various GVfs locations usually supports just UUIDs.
It would be handy to support them also for testing purposes (because
"g_file_mount_enclosing_volume()" does something else than "g_volume_mount()"
in case of shares provided by GOA volume monitor for example). Let's update
"-d" option to support also UUIDs.

https://gitlab.gnome.org/GNOME/gvfs/issues/251
2019-11-27 13:20:57 +01:00
Philip Withnall
2daebc7674 ci: Fix running all jobs on merge requests
Since we added `only: [merge_requests]` for the `style-check-diff` job,
that started running detached pipelines only for merge requests and only
containing that job, and not running the other jobs for merge requests
(only for branches).

That wasn’t the intention.

Follow the guide on
https://docs.gitlab.com/ee/ci/merge_request_pipelines/index.html#excluding-certain-jobs
to ensure that all jobs (including `style-check-diff`) are run for merge
requests.

This means we can no longer unconditionally use
`${CI_MERGE_REQUEST_TARGET_BRANCH_{NAME,SHA}}`, since they are only
defined for jobs which are running against a merge request rather than a
branch. Instead, use some `git rev-list` magic from
https://stackoverflow.com/a/4991675/2931197 to find the newest common
ancestor commit between the detached head that CI is running on, and the
known or likely target branch. Do the style check against the diff
between the newest common ancestor commit and the detached head.

(Note that `${CI_MERGE_REQUEST_TARGET_BRANCH_SHA}` was never actually
defined for any of our pipelines, since it’s only available for CI
pipelines running on merged branches, which is a GitLab Premium
feature. Oops, my bad.)

In order to find the newest common ancestor commit, we need to pull the
upstream remote, since the CI pipeline might be running on a fork of the
main repository where various branches (particularly `master`) are out
of date.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-11-27 12:00:54 +00:00
Philip Withnall
3156ea5be7 ci: Factor out only/except properties from jobs
We can use a template to factor these out and make things a bit more
maintainable. This should introduce no functional changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-11-27 12:00:53 +00:00
Philip Withnall
efa7fa0375 ci: Run the style-check pipeline stage first
Don’t waste CI resources on compiling things which don’t comply with the
style rules.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-11-27 12:00:20 +00:00
Emmanuele Bassi
cc3716a943 Merge branch 'thread-safe-getpwnam' into 'master'
glocalvfs: Use thread-safe getpwnam_r() rather than getpwnam()

Closes #1687

See merge request GNOME/glib!681
2019-11-27 11:58:51 +00:00
Emmanuele Bassi
9b14cdc258 Merge branch 'ci-versioning' into 'master'
ci: Update all Debian CI runners to use v5 of the Dockerfile

See merge request GNOME/glib!1248
2019-11-27 11:56:39 +00:00
Philip Withnall
34cb297a86 Merge branch 'wip/nielsdg/g-list-store-find' into 'master'
gliststore: Add item lookup functions

Closes #1011

See merge request GNOME/glib!1096
2019-11-27 11:22:56 +00:00
Nirbheek Chauhan
5f0d0efeb6 giomodule: gio modules are no longer installed in bindir on MSVC
Ever since the port to Meson, gio modules (f.ex., by glib-networking)
are installed inside libdir both for MinGW and MSVC.
2019-11-27 16:10:51 +05:30
Nirbheek Chauhan
902fc6d261 Merge branch 'suppressions' into 'master'
Add additional valgrind suppressions

See merge request GNOME/glib!1223
2019-11-27 10:26:03 +00:00
Philip Withnall
7a4740c7b1 Merge branch 'zero-null' into 'master'
gthread: Fix "zero as null pointer" warning

See merge request GNOME/glib!1253
2019-11-27 09:04:48 +00:00
Jason Crain
be15a60bda gthread: Fix "zero as null pointer" warning
When compiling a program using glib with -Wzero-as-null-pointer-constant
warnings enabled, the compiler warns about this type check in the
g_once_init_enter macro. Fix by replacing "0" with "NULL".
2019-11-26 22:33:41 -07:00
Philip Withnall
bdf2583fbd glocalvfs: Use thread-safe getpwnam_r() rather than getpwnam()
It’s possible that one VFS operation will happen from a worker thread at
the same time as another is happening from the main thread, in which
case the static buffer which getpwnam() uses will be overwritten.
There’s a chance this will corrupt the results that one of the threads
receives.

Fix that by using the thread-safe getpwnam_r() version, via the new
g_unix_get_passwd_entry() function.

Fix the indentation of the surrounding block while we’re there.

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

Fixes: #1687
2019-11-26 12:17:04 +00:00
Philip Withnall
94a800fb9d glib-unix: Add g_unix_get_passwd_entry() function
This is a convenience wrapper around getpwnam_r() which handles all the
memory allocation faff.

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

Helps: #1687
2019-11-26 12:17:04 +00:00
Philip Withnall
d8c5bcbb7d Merge branch 'wip/hadess/socket-test-not-parallel' into 'master'
tests: Run "timeout tests" sequentially

See merge request GNOME/glib!1239
2019-11-26 10:51:20 +00:00
Philip Withnall
6c41e91f03 Merge branch 'wip/ernestask/g_clear_list' into 'master'
Add g_clear_list()

Closes #1943

See merge request GNOME/glib!1244
2019-11-26 10:36:52 +00:00
Benjamin Otte
276e927fd4 Revert last 4 commits
This reverts commits:
  5899c61ed2
  e994d45352
  eb20dec144
  ebec0dd359
which wer accidentally pushed to master instead of a branch
2019-11-26 00:54:15 +01:00
Benjamin Otte
5899c61ed2 value: Allow automatic transforms to/from interfaces
Use the new g_type_interface_instantiable_prerequisite() to check
compatibility for transform functions.

In particular, this allows interfaces (in my case GDK_TYPE_PAINTABLE) to
be transformed to/from any GObject type (in my case G_TYPE_OBJECT) using
the transform function registered to tranform between any 2 objects
(g_value_object_transform_value() does a type check and uses NULL if the
types don't match).

And this in turn allows be to g_object_bind_property() a gobject-typed
generic property (GtkListItem::item) to a GtkImage::paintable.
2019-11-25 20:06:49 +01:00
Benjamin Otte
e994d45352 closure: Support generic marshals for interface returns
Use the newly added g_type_interface_instantiable_prerequisite() to
allow closure return values being interfaces by looking up the
instantiable type for the interface and usings its GValue accessors.
2019-11-25 20:06:39 +01:00
Benjamin Otte
eb20dec144 gtype: Add g_type_interface_instantiable_prerequisite()
There is (at most) a single GType that is instantiable and a
prerequisite for an interface. This function returns that type.

This type is necessary in particular when dealing with GValues because a
GValue contains an instance of a type.
2019-11-25 20:06:39 +01:00
Benjamin Otte
ebec0dd359 gtype: Fix typo in API comment 2019-11-25 20:06:39 +01:00
Emmanuele Bassi
eb439076a6 Merge branch '1947-uuid-docs' into 'master'
guuid: Document that g_uuid_string_random() is not secure

Closes #1947

See merge request GNOME/glib!1246
2019-11-25 18:50:12 +00:00
Ernestas Kulik
58ba7d78fb list, slist: Add g_clear_{s,}list()
Although not quite as often-occurring, this should help with constructs
like this:

  if (list)
    {
      g_list_free_full (list, foo);
      list = NULL;
    }

Closes https://gitlab.gnome.org/GNOME/glib/issues/1943
2019-11-25 13:09:25 +01:00
Bastien Nocera
3894335dc6 tests: Don't "timeout tests" by default
Those tests seem to regularly fail because a timeout (which we're
measuring outside the function that times out) is too long, which can
happen when the system is busy.

Don't run those tests unless "thorough" tests are requested. This
disables those tests by default.

Bail out! GLib-GIO:ERROR:../gio/tests/socket.c:1167:test_timed_wait: assertion failed (poll_duration < 112000): (114254 < 112000)
Bail out! GLib-GIO:ERROR:../gio/tests/cancellable.c:167:on_mock_operation_ready: assertion failed (error == (g-io-error-quark, 19)): error is NULL
2019-11-25 12:55:18 +01:00
Philip Withnall
ae49ff0903 2.63.2
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-11-25 11:11:33 +00:00
Philip Withnall
b7fe4b84ee ci: Update all Debian CI runners to use v5 of the Dockerfile
This shouldn’t affect them (since it just adds the `clang-format-7`
package), but it’s good to keep everything on the same version.

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

See: #1552
2019-11-25 10:51:14 +00:00
Philip Withnall
8555aeec8d Merge branch 'wip/ci-style-check' into 'master'
CI: Code check formating in CI

Closes #1552

See merge request GNOME/glib!1237
2019-11-25 10:23:50 +00:00
Philip Withnall
812253a95f guuid: Document that g_uuid_string_random() is not secure
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1947
2019-11-25 10:10:36 +00:00
Pavlo Solntsev
e95f47c395
CI: Code check formating in CI 2019-11-21 14:03:01 -06:00
Philip Withnall
7b77439841 Merge branch 'wip/hadess/occurred' into 'master'
docs: Fix "occurred" typos in API documentation

See merge request GNOME/glib!1243
2019-11-21 12:45:45 +00:00
Philip Withnall
7c77cdf9ba Merge branch 'objcpy-version' into 'master'
Enable test about objcopy if it supports the --add-symbol parameter

Closes #1895

See merge request GNOME/glib!1236
2019-11-21 12:34:15 +00:00
Philip Withnall
6f3de72ad4 Merge branch 'th/gstrv-use-gsize' into 'master'
gstrfuncs: use gsize type internally for strv functions

See merge request GNOME/glib!1238
2019-11-21 12:33:34 +00:00
Iain Lane
50c215b14e Merge branch 'unix-mode-docs' into 'master'
gfileinfo: Clarify the documentation for G_FILE_ATTRIBUTE_UNIX_MODE

See merge request GNOME/glib!1242
2019-11-21 12:24:32 +00:00
Bastien Nocera
6fd2ea1dc6 docs: Fix "occurred" typos in API documentation 2019-11-21 13:07:08 +01:00
Philip Withnall
94e8f027bd Merge branch '1004-lldb' into 'master'
Make gbacktrace use lldb on macOS

Closes #1004

See merge request GNOME/glib!167
2019-11-21 11:54:46 +00:00
Philip Withnall
0a469dafe4 Merge branch 'wip/iainl/fix-1934' into 'master'
Revert "glocalfileinfo: Only return file mode, not type, as UNIX_MODE attribute"

Closes #1934

See merge request GNOME/glib!1241
2019-11-21 11:27:20 +00:00