Commit Graph

289 Commits

Author SHA1 Message Date
Evan Welsh
93271385f9 ci: Set gobject-introspection version and build gobject-introspection in tests
The minimum version is now 1.80.0
2024-08-26 12:07:25 +01:00
Luca Bacci
1265b456d1 CI/msys2-mingw32: Set G_DEBUGGER environment variable
This enables us to catch access violation errors in CI and
get meaningful stacktraces with gdb.

Helps #3042

See https://docs.gtk.org/glib/running.html#environment-variables
2024-08-23 15:41:34 +02:00
Marco Trevisan (Treviño)
2f938054e9 ci: Also compile C++ files with coverage collection 2024-08-02 13:57:29 +02:00
Marco Trevisan (Treviño)
64f7445232 ci: Actually use a fedora 39 image
Also start using a more reliable versioning scheme for the fedora images
so that the tag is always vFEDORA_VERSION.IMAGE_VERSION to make it
easier to understand on future updates

Fixes: #3381
2024-08-02 03:39:48 +02:00
Marco Trevisan (Treviño)
2665a34b3f ci: Update coverage files atomically
Since we run tests in parallel we may end up rewriting the coverage info
while running files acting on the same source files.

The compiler can be smart though, so let's use the proper flag.

Despite this, sometimes we may still end up into negative reports, so
let's ignore them in CI since it's not worth breaking the build because
of these coverage-parsing failures.
2024-08-02 03:39:48 +02:00
Marco Trevisan (Treviño)
2c94349e79 ci: Ignore lcov errors on source missing
When using dtrace some temporary files may be leaked as source files and
this may lead to build issues such as

  geninfo: ERROR: unable to open
    /builds/GNOME/glib/_build/.dtrace-temp.ed1c5ba9.c:
    No such file or directory

AFAIK there's no way to keep these temporary files around, so the only
thing we can do is making lcov less strict about missing files.

We can drop the special option from genhtml since it's using the same
lcovrc file
2024-08-02 03:39:47 +02:00
Simon McVittie
16819a4024 CI: Mark msys2-mingw32 as allowing failures
Workaround for GNOME/glib#3420

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-07-26 16:31:36 +01:00
Ernesto de Gracia Herranz
38faeca62e replace package.version.Version by internal code
This drops the dependency on the Python `packaging` module.

Signed-off-by: Ernesto de Gracia Herranz <ernestodgh@jfrog.com>
2024-07-04 11:04:38 +00:00
Philip Withnall
c2744488a1
ci: Disable dtrace/systemtap on FreeBSD CI
It seems to have been accidentally enabled by the switch to making
dtrace a Meson feature. This has only just been caught because the
FreeBSD CI runner has been offline for several weeks (see
https://gitlab.gnome.org/Infrastructure/Infrastructure/-/issues/1503).

With dtrace enabled, the FreeBSD CI build fails with:
```
[8/1601] Generating 'gobject/libgobject-2.0.so.0.8100.0.p/gobject_probes.o'
FAILED: gobject/libgobject-2.0.so.0.8100.0.p/gobject_probes.o
/usr/sbin/dtrace -G -s ../gobject/gobject_probes.d -o gobject/libgobject-2.0.so.0.8100.0.p/gobject_probes.o
dtrace: failed to link script ../gobject/gobject_probes.d: No probe sites found for declared provider
[9/1601] Generating 'glib/libglib-2.0.so.0.8100.0.p/glib_probes.h' (wrapped by meson because command contains newlines)
[10/1601] Generating 'glib/libglib-2.0.so.0.8100.0.p/glib_probes.o'
FAILED: glib/libglib-2.0.so.0.8100.0.p/glib_probes.o
/usr/sbin/dtrace -G -s ../glib/glib_probes.d -o glib/libglib-2.0.so.0.8100.0.p/glib_probes.o
dtrace: failed to link script ../glib/glib_probes.d: No probe sites found for declared provider
```
(see https://gitlab.gnome.org/GNOME/glib/-/jobs/3961782)

I have no idea how to fix that, and it’s presumably not been working for
a long time.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-06-13 20:43:28 +01:00
Philip Withnall
ea58dcb538
Revert "ci: Disable dtrace/systemtap on FreeBSD CI"
This reverts commit b7a93a7ddb.

Accidentally pushed to `origin/main` without review because I typoed the
switch branch command and didn’t notice.
2024-06-10 11:03:34 +01:00
Philip Withnall
b7a93a7ddb
ci: Disable dtrace/systemtap on FreeBSD CI
It seems to have been accidentally enabled by the switch to making
dtrace a Meson feature. This has only just been caught because the
FreeBSD CI runner has been offline for several weeks (see
https://gitlab.gnome.org/Infrastructure/Infrastructure/-/issues/1503).

With dtrace enabled, the FreeBSD CI build fails with:
```
[8/1601] Generating 'gobject/libgobject-2.0.so.0.8100.0.p/gobject_probes.o'
FAILED: gobject/libgobject-2.0.so.0.8100.0.p/gobject_probes.o
/usr/sbin/dtrace -G -s ../gobject/gobject_probes.d -o gobject/libgobject-2.0.so.0.8100.0.p/gobject_probes.o
dtrace: failed to link script ../gobject/gobject_probes.d: No probe sites found for declared provider
[9/1601] Generating 'glib/libglib-2.0.so.0.8100.0.p/glib_probes.h' (wrapped by meson because command contains newlines)
[10/1601] Generating 'glib/libglib-2.0.so.0.8100.0.p/glib_probes.o'
FAILED: glib/libglib-2.0.so.0.8100.0.p/glib_probes.o
/usr/sbin/dtrace -G -s ../glib/glib_probes.d -o glib/libglib-2.0.so.0.8100.0.p/glib_probes.o
dtrace: failed to link script ../glib/glib_probes.d: No probe sites found for declared provider
```
(see https://gitlab.gnome.org/GNOME/glib/-/jobs/3961782)

I have no idea how to fix that, and it’s presumably not been working for
a long time.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-06-10 11:00:31 +01:00
Philip Withnall
9e8b0f6730
ci: Disable systemtap on musl CI build
It’s not needed, and is now failing with:
```
meson.build:2578:36: ERROR: Feature systemtap cannot be enabled: Cannot enable systemtap because dtrace feature is disabled
A full log can be found at /builds/GNOME/glib/_build/meson-logs/meson-log.txt
```

See https://gitlab.gnome.org/GNOME/glib/-/jobs/3901860

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-05-21 10:44:50 +01:00
Michael Catanzaro
153cda6669 Convert systemtap from bool to feature option type
Now systemtap can be enabled by default in distros that use
-Dauto_features=enabled or for developers who already have systemtap
installed, while it's still disabled for developers who do not have
systemtap installed. See #3354
2024-05-17 15:22:41 -05:00
Michael Catanzaro
ed020a688a Convert dtrace from bool to feature option type
Now dtrace can be enabled by default in distros that use
-Dauto_features=enabled or for developers who already have dtrace
installed, while it's still disabled for developers who do not have
dtrace installed. See #3354
2024-05-17 15:22:41 -05:00
Philip Withnall
e87b659905
ci: Temporarily run the FreeBSD on a schedule rather than every commit
The runner is currently offline and we can’t have that blocking
development.

See: https://gitlab.gnome.org/Infrastructure/Infrastructure/-/issues/1503

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-05-16 12:51:04 +01:00
Philip Withnall
21fa4ea91b
ci: Update Fedora CI image to Fedora 39
Fedora 37 is out of support so, as per our policy, update the CI image
to the oldest still-supported release, which is 39.

Update the mingw CI image too, as it’s built on top of the Fedora one.

Update the supported platforms documentation (and fix the Debian version
listed there to match what’s currently in CI, which is up to date).

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-05-15 13:27:47 +01:00
Philip Withnall
021d58b251
ci: Add a policy for how to deal with CI failures due to changes in msys2
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-05-15 11:31:20 +01:00
Philip Withnall
b1b8166a8a
ci: Make scan-build errors fatal in CI
\o/

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

Fixes: #1767
2024-04-25 23:58:34 +01:00
Philip Withnall
c844abc759
ci: Force-enable -Dglib_debug for scan-build jobs
Several of the assertions in GLib (particularly on hot paths in
`gobject.c`) are protected behind `#if G_ENABLE_DEBUG`. In order for
scan-build to see them, the scan-build CI job needs to make sure that
a debug build is definitely enabled — not just rely on it being
implicitly enabled via the combination of other build options.

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

Helps: #1767
2024-04-12 19:35:05 +01:00
Philip Withnall
0f869f3d73
ci: Disable scan-build for copylibs
Eventually, we do want to include them in static analysis (their code is
run in the same process as GLib, after all). But for now, that’s too
much work to get started.

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

Helps: #1767
2024-04-12 18:44:50 +01:00
Philip Withnall
165ae8c8a7
ci: Disable scan-build’s dead code checker
It’s not highlighting severe bugs for us, and currently generates 132
out of 172 of the scan-build reports, so let’s disable it for now.

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

Helps: #1767
2024-04-12 18:44:43 +01:00
Philip Withnall
2dfd9518e1
ci: Exclude tests from scan-build analysis runs
They cause too much noise at the moment. I want to make scan-build
messages fatal, and with 66 of 238 reports coming from the tests,
that’s not currently feasible.

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

Helps: #1767
2024-04-12 18:44:35 +01:00
Philip Withnall
548ec9f186 docs: Reduce nesting of documentation directories
The `gi-docgen` tool is not designed to be used like that. In
particular, when nesting documentation directories, the generated
`*.devhelp2` files (needed by Devhelp to show the documentation) are
nested one directory level too deep for Devhelp to find them, and hence
are useless, and the documentation doesn’t show up in this common
documentation viewer.

So, change the installed documentation directory hierarchy:
 * `${PREFIX}/share/doc/glib-2.0/gio` → `${PREFIX}/share/doc/gio-2.0`
 * `${PREFIX}/share/doc/glib-2.0/glib-unix` →
   `${PREFIX}/share/doc/glib-unix-2.0`
 * `${PREFIX}/share/doc/glib-2.0/gobject` →
   `${PREFIX}/share/doc/gobject-2.0`
 * etc.
 * `${PREFIX}/share/doc/glib-2.0/glib` → `${PREFIX}/share/doc/glib-2.0`

This is going to seem like pointless churn (the contents of the
documentation have not changed), and packagers may mourn the split of
content in `/usr/share/doc` from `/usr/share/doc/${package_name}` to
`/usr/share/doc/${pkg_config_id}` instead, but that seems to be the best
approach to fix this issue in GLib. gi-docgen’s behaviour does feel
fairly consistent and correct with the rest of how it works (single
output directory).

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

Fixes: #3287
2024-03-13 18:51:21 +00:00
René de Hesselle
3e80909ba5 ci: Run macOS job only for origin
This partially reverts 11616b0145.
The macOS runner is not available to forks on purpose.
2024-02-19 19:29:35 +01:00
Philip Withnall
7420f9eccd ci: Fix printing the execution environment
Deriving from two templates means the `before_script` from the second
one overrides, rather than adding to, the one from the first.

Avoid that when using `.build-linux` and `.with-git` by explicitly
joining both scripts.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-13 15:22:04 +00:00
Philip Withnall
c428d6e673 ci: Build and tar the platform specific documentation
Enable the msys2-mingw32 CI job for merges, just like the fedora-x86_64
job is. The pair of them can then build the platform specific GIR and
documentation files.

The `download-reference.sh` script in the `docs-gtk-org` branch of GTK
can then download the docs as an artifact from the latest GLib build of
`main`, and publish them on docs.gtk.org, as is currently done for the
platform agnostic documentation.

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

Helps: #3037
2024-02-12 17:54:35 +00:00
Philip Withnall
d426f33cf3 ci: Build and tar libgirepository documentation
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-12 17:01:15 +00:00
Simon McVittie
e87db7dbf2 CI: Run all style/lint checks before failing
Even if we get warnings from the first lint check, we probably want to
see the warnings from later lint checks too, to reduce the number of
round-trips.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-08 00:18:23 +00:00
Simon McVittie
a7702505e0 CI: Extend submodule workaround to most jobs that run the test suite
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-08 00:18:23 +00:00
Simon McVittie
d7601f7eed Incorporate some lint checks into meson test
This will make it easier and more obvious for developers to run them
locally: I'm sure I'm not the only developer who had assumed that
`.gitlab-ci/` is private to the CI environment and inappropriate (or
perhaps even destructive) to run on a developer/user system.

The lint checks are automatically skipped (with TAP SKIP syntax) if we
are not in a git checkout, or if git or the lint tool is missing. They
can also be disabled explicitly with `meson test --no-suite=lint`,
which downstream distributions will probably want to do.

By default, most lint checks are reported as an "expected failure"
(with TAP TODO syntax) rather than a hard failure, because they do not
indicate a functional problem with GLib and there is a tendency for
lint tools to introduce additional checks or become more strict over
time. Developers can override this by configuring with `-Dwerror=true`
(which also makes compiler warnings into fatal errors), or by running
the test suite like `LINT_WARNINGS_ARE_ERRORS=1 meson test --suite=lint`.

One exception to this is tests/check-missing-install-tag.py, which is
checking a functionally significant feature of our build system, and
seems like it is unlikely to have false positives: if that one fails,
it is reported as a hard failure.

run-style-check-diff.sh and run-check-todos.sh are not currently given
this treatment, because they require search-common-ancestor.sh, which
uses Gitlab-CI-specific information to find out which commits are in-scope
for checking.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-02-08 00:18:23 +00:00
Philip Withnall
3f4e6ddcd8 Merge branch 'thorough-tests-in-ci' into 'main'
build: Add thorough test setup

See merge request GNOME/glib!3838
2024-02-02 14:33:22 +00:00
Philip Withnall
ecc5275be9 ci: Temporarily disable --fatal-meson-warnings on Hurd CI
For the same reasons as in commit 71061fdcb3, but in this
case we can’t downgrade the version of Meson on the CI runner, so just
tell it to shut up instead.

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

Fixes: #3238
2024-01-30 14:30:42 +00:00
Philip Withnall
c89b282623 ci: Fix post-merge CI pipelines
Don’t allow the `pages` job to be run (even manually) on post-merge
pipelines. It’s not particularly useful, and GitLab doesn’t like having
a manual job with unsatisfied dependencies in a pipeline:
```
'pages' job needs 'coverage' job, but 'coverage' is not in any previous stage
'pages' job needs 'style-check-advisory' job, but 'style-check-advisory' is not in any previous stage
```

See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3847#note_1986044

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-01-25 20:31:34 +00:00
Philip Withnall
e04886aeb2 Merge branch 'optional-ci-runs' into 'main'
ci: Add ability to run manually some specific jobs

See merge request GNOME/glib!3847
2024-01-25 20:24:53 +00:00
Marco Trevisan (Treviño)
99c8f7fafc ci: Run docs and coverity builds only on schedules in default branch
Also allow running them manually if required, but this still needs to be
done from a GNOME/glib:main pipeline.
2024-01-25 17:56:36 +01:00
Marco Trevisan (Treviño)
11616b0145 ci: Allow to run jobs that only run in origin repos manually 2024-01-25 17:56:36 +01:00
Marco Trevisan (Treviño)
2a532e19cd ci: Add ability to run manually some specific jobs
In some merge requests there are bits (such as memory leaks) that we may want
to test before merging and that the schedules will run them.

As per this add a rule to make them manual, and apply it to some jobs.
2024-01-25 17:46:59 +01:00
Emmanuele Bassi
74a584e25a Merge branch 'fix-dist-docs' into 'main'
ci: Fix tarballing the docs on dist

See merge request GNOME/glib!3803
2024-01-22 10:45:15 +00:00
Philip Withnall
16b93f92fa ci: Run the thorough test setup on a weekly schedule
Merge it with the `G_DISABLE_ASSERT` test run, to avoid tying up another
test runner for no particular benefit.

By running the thorough tests regularly, we’ll hopefully avoid them
atrophying again (see the previous few commits full of fixes to them).

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-01-18 17:45:00 +00:00
Philip Withnall
f52a973a6e ci: Fix tarballing the docs on dist
The generated docs are discarded by `meson dist` after building the dist
tarball, so we need to compile them again. And they get generated in the
`_build` directory, not the source directory.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-01-04 17:41:30 +00:00
Philip Withnall
eda5bb386b ci: Temporarily disable --fatal-meson-warnings on FreeBSD CI
For the same reasons as in commit 71061fdcb3, but in this
case we can’t downgrade the version of Meson on the CI runner, so just
tell it to shut up instead.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-01-03 12:54:02 +00:00
Philip Withnall
bf133ec683 ci: Drop FreeBSD 12 CI runner as it’s EOL
It’s still going to be used on the `glib-2-78` branch because the
dependencies there are frozen, but since it’s EOL it can’t have
additional dependencies (like the Python `packaging` package) installed
for `main`, so let’s drop it. We have the FreeBSD 13 runner on `main`.

See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3740#note_1957840

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-01-03 12:43:48 +00:00
Philip Withnall
4bcf53a351 Revert "ci: Temporarily only run the FreeBSD 13 CI on a schedule"
This reverts commit 35ec6b6387.

The FreeBSD 13 CI runner now has the Python `packaging` package
installed, so should work again.

The FreeBSD 12 runner is EOL so can’t have that package installed, so
will be dropped from GLib `main` in the next commit.

See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3740#note_1957840
2024-01-03 12:43:44 +00:00
Philip Withnall
020ebe42f9 build: Change default for -Dman-pages from disabled to auto
Previously, `-Dman=false` was the default, because the generated man
pages were shipped in the distribution tarball already, so the option
actually mostly controlled whether to *re*build them.

The generated pages are no longer shipped in the tarball (and probably
haven’t been since the port to Meson, though I haven’t checked), so it
makes sense to change the default to encourage building the man pages if
the right tooling (`rst2man`) is available.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-12-21 16:13:03 +00:00
Philip Withnall
031e65808d docs: Port the man pages from DocBook to reStructuredText
So they are consistent with the way we’re building man pages in other
projects, and because some people are allergic to XML.

This changes the build-time dependencies from `xsltproc` to `rst2man`,
and also takes the opportunity to change the `-Dman` Meson option from a
boolean to a feature (so you should use `-Dman-pages={enabled,disabled}`
now, rather than `-Dman={true,false}`).

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

Helps: #3037
2023-12-21 13:34:48 +00:00
Philip Withnall
6826d21743 ci: Ensure man pages are built alongside docs
Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2023-12-18 14:52:39 +00:00
Philip Withnall
5cf7af694a ci: Update docs build for the release job
Not that this job is particularly maintained at the moment, but at least
try to keep it up to date.

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

Helps: #3037
2023-12-18 14:43:36 +00:00
Philip Withnall
2a1be27431 ci: Run the fedora CI job on merges as well as branches
Since it now has to build the docs (and code coverage) for `main`, that
needs to happen after branches are merged.

Other jobs remain not-run on merges.

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

Helps: #3037
2023-12-18 14:43:36 +00:00
Philip Withnall
5400094ab0 ci: Build docs artifacts for deployment to docs.gtk.org
The actual deployment will be done by
https://gitlab.gnome.org/GNOME/gtk/-/blob/docs-gtk-org/; it pulls the
most recent artifact zip from glib.git.

This ensures that only one project/job/branch has push access to the
website.

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

Helps: #3037
2023-12-18 14:43:36 +00:00
Philip Withnall
35ec6b6387 ci: Temporarily only run the FreeBSD 13 CI on a schedule
Rather than on every commit, because the CI runner is currently broken:
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3740#note_1935427.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-12-12 16:58:27 +00:00