Commit graph

44 commits

Author SHA1 Message Date
Peter Hutterer
5aad9fd777 scanner: add the protocol name so we can compile some #defines
The protocol name on an interface is a fixed string that is part of
the ABI since it's used in a few messages (e.g.
ei_handshake.interface_version). To avoid typos, let's expose that
string in the scanner and #define it in the generated sources.
2023-04-06 13:57:20 +10:00
Peter Hutterer
1bc04bffa8 CI: add new workflow rules
Required for pipelines to run after some infrastructure changes, see
See https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/438
2023-03-15 09:47:14 +10:00
Peter Hutterer
940f2778a9 CI: bump to the latest ci templates
This version includes a fix for ci-fairy to handle the trailing newlines
in a more predictable manner.
2023-03-13 08:51:52 +10:00
Peter Hutterer
4ac13ac7a7 CI: fix the doxygen path
Adding the mkdir means we copy into that directory.
2023-03-07 15:26:36 +10:00
Peter Hutterer
8fad365f37 doc: split protocol and api builds into separate meson options 2023-03-07 15:26:36 +10:00
Peter Hutterer
2cf6df9cd0 meson: hook up the protocol documentation via meson
Since we want the generated documentation to be useful on-disk, drop the
baseURL and switch to relativeURLs = true for hugo.

This is arguably a bit nasty in that it git clones the theme into the
build directory. But oh well...
2023-03-07 14:14:58 +10:00
Peter Hutterer
30aab5179e Merge branch 'main' into wip/drop-protobuf 2023-03-07 12:55:18 +10:00
Peter Hutterer
449d808b42 CI: always run the tests
Embarassingly, only the valgrind test would actually run tests because
it was the only one with a non-null MESON_TEST_ARGS. Let's fix this by
explicitly telling the build script to run the tests.
2023-03-07 11:57:46 +10:00
Peter Hutterer
717900f6fe Generate the protocol documentation in gitlab pages 2023-03-03 15:24:42 +10:00
Peter Hutterer
bbc64b2eff CI: explicitly add ei-proto to the ruff check 2023-03-03 11:27:01 +10:00
Peter Hutterer
312ce6723b CI: run pytest as separate job
Because we currently only run the test suite in valgrind, we skip the
python test suite there (we don't want to valgrind python itself, too
messy).

Fix this by specifically excluding the python test suite and having a
separate job that just runs that suite instead.

And because the protocol test suite needs the directory to the
eis-demo-server and isn't smart enough to split spaces correctly, let's
change the builddir to just that.
2023-03-03 11:27:01 +10:00
Peter Hutterer
3fa396c012 test: add a framework for doing protocol tests directly
This tests the protocol layer which is hard to test using libei/libeis.
Similar to the generated C bindings we compile a eiproto.py file that is
then used in the test to talk protocol directly to the eis-demo-server
that we start up.

By sending the specific messages and checking things happen as we expect
on the socket we can verify that the EIS implementation is correct (and
robust enough).

In theory this could also be used to test some other binary with an EIS
implementation and the scaffolding is there to set LIBEI_TEST_SERVER to
that binary. Wether this works is untested though...
2023-03-03 11:27:01 +10:00
Peter Hutterer
e5948856bf CI: explicitly add the ei-scanner to the Python Black run
Without the file ending in .py, it won't be checked anymore.
2023-03-03 11:27:01 +10:00
Peter Hutterer
6096a20964 CI: fix typo in the package list
Fixes 1153368946
2023-02-15 16:14:59 +10:00
Peter Hutterer
83f3789954 CI: add a python linter job with Ruff
Same-ish as Flake8 but faster, let's see how that goes.
2023-02-15 09:19:03 +10:00
Peter Hutterer
90f450787a CI: use the ci-fairy image and a venv for the black job
The venv is needed now because black now requires a newer 'packaging'
and fails to installed with:
   ERROR: Cannot uninstall 'packaging'. It is a distutils installed
   project and thus we cannot accurately determine which files belong to
   it which would lead to only a partial uninstall.

So let's use a venv and while we're doing this switch to use the
ci-fairy image so we don't need to worry about docker limits.
2023-02-15 09:17:45 +10:00
Peter Hutterer
fe337d9866 CI: the check-commit and check-merge-request should use the ci-fairy image 2023-02-15 09:09:20 +10:00
Peter Hutterer
1153368946 CI: move the package list to the config.yml file
Using templates for our CI is a bit of overkill but while we have it,
let's make use of it.
2023-02-15 08:23:56 +10:00
Peter Hutterer
642e258ecb Format python files with black
And set up a gitlab ci job to check that
2023-02-01 11:48:53 +10:00
Peter Hutterer
857735fe7f gitlab-ci: add one more explanatory comment
Just so the CI is a bit easier to understand
2023-01-06 10:23:51 +10:00
Peter Hutterer
fde1424a42 gitlab CI: move default_artefacts to the default build template
No point having this as a separate template when the default build
template controls how things are built...
2023-01-06 10:04:01 +10:00
Peter Hutterer
19b4320594 gitlab CI: switch the ci-fairy job to the fdo ci-fairy image 2023-01-06 10:04:01 +10:00
Peter Hutterer
c3b250ba2e gitlab CI: compress the file inclusion a bit
Just make it a bunch of files from a single project, rather than one
project each per file.
2023-01-06 09:56:12 +10:00
Peter Hutterer
42dbcf59c9 gitlab CI: drop the container clean stage
We don't have scheduled rebuilds so the containers build need to hang
around since they're almost certainly in use. Container expiry is
handled site-wide now anyway.
2023-01-06 09:56:12 +10:00
Peter Hutterer
528f6d4d4b gitlab CI: drop the reference to the forced container rebuild
Copy/paste from libinput where most of this came from, we've never had
forced container rebuilds in libei.
2023-01-06 09:17:50 +10:00
Peter Hutterer
eeefb3dc00 liboeffis is a wrapper library for the RemoteDesktop communication
libei used to have direct portal support code (see the git history) but:
- that code was a custom proposed portal that never went anywhere
- libei has slowly changed to be more an input event transport layer since
  it is now also used sending events *to* a libei context
- a number of libei users will never need the DBus code, either because they
  don't want it or because they talk Dbus themselves na ddon't need this
  abstraction.

Luckily, it's quite easy to move this into a separate library with a
simple API that does, effectively, the same trick as the old portal backend.
This API is aiming to be as simple as possible because the tools that
require anything more complex should talk to DBus directly.

An example tool that uses the API to retrieve an EIS fd over the
RemoteDesktop portal is included in this patch.

"Öffis" is a German word meaning public transport. It also sounds like the
French Œuf, the word for egg.

Co-authored-by: Olivier Fourdan <ofourdan@redhat.com>
2022-12-08 11:22:50 +10:00
Peter Hutterer
8fc654bfb0 Purge the portal code
The original idea here was that we would have an EmulatedInput portal
that allows the application to connect directly to the EIS
implementation to exchange input events - instead of ping-ponging DBus
events through the xdg-desktop-portal as the RemoteDesktop portal
requires.

This is no longer accurate, there are suggested PRs open to add
RemoteDesktop.ConnectToEIS to achieve the same through the existing
RemoteDesktop interface [1] and to add a new InputCapture portal
to allow for events to be sent to a libei receiver context [2].

The example EmulatedInput portal is thus superfluous and can be removed
from here.

We could switch the ei_setup_backend_portal() code to use RemoteDesktop
or InputCapture, depending on the context type, the utility of this is
questionable. Interaction with portals is complex, one needs to
implement the Session/Request interfaces correctly and in the case of
InputCapture also handle the complex zones/pointer barrier setup.
libportal does some of this (or it will, anyway) so it's more useful for
an application to use libportal and then just pass the received fd to
libei.

If there is a future need for this to be handled as part of libei, we
can (re)implement this, but for now it's best to just purge all of this.

[1] https://github.com/flatpak/xdg-desktop-portal/pull/762
[2] https://github.com/flatpak/xdg-desktop-portal/pull/714
2022-12-08 10:45:47 +10:00
Peter Hutterer
903baf27ba CI: bump to latest ci-templates 2022-12-05 15:11:41 +10:00
Peter Hutterer
7713ad5ac5 CI: purge all references to the master branch 2022-12-05 15:05:01 +10:00
Peter Hutterer
a59474b5ca gitlab CI: fail the CI early if the fork is private
Copied from libinput, this provides a better error message than weirdly
failing jobs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-03-03 00:31:18 +00:00
Peter Hutterer
6926175e30 gitlab CI: drop the requirement for Signed-off-by
I'm starting to question this, there are plenty of large projects
where this isn't a requirement (GNOME, systemd, ...) and libei doesn't
exactly contain sophisticated technology that needs a DCO.

Plus, it's a constant source of confusion for new contributors.
Let's drop the requirement.
2022-03-03 00:24:41 +00:00
Peter Hutterer
46e65370c6 gitlab CI: add a -Werror job (allowed to fail)
Most of the time we don't pay attention to the details in the actual
jobs, them passing is good enough. So let's have at least one job with
-Werror that fails if our CI has warnings we don't have locally.
Allowed to fail because we don't want to be beholden to compiler changes
(though having this fail for a long period makes the job less useful
again).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-03-02 16:26:16 +10:00
Peter Hutterer
06ce6c3a92 gitlab CI: move the pages job configuration to config.yml
Makes it less error-prone to forgetful updates like 191913, I hope.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-03-02 16:26:16 +10:00
Peter Hutterer
191913a9e3 gitlab CI: update the pages job to F35 too
Almost like there was a comment there telling me to do exactly that and
I didn't notice...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-02-16 14:48:41 +10:00
Peter Hutterer
d3149b75c2 gitlab CI: update to build on F35 and latest ci-templates
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-02-16 13:36:59 +10:00
Peter Hutterer
627db8d91e gitlab CI: bump the pages job to F34 too
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-08-16 16:09:26 +10:00
Peter Hutterer
a240e181c0 gitlab CI: bump the Fedora version to 34
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-08-16 15:50:07 +10:00
Peter Hutterer
e06d9bd380 meson.build: disable documentation by default
This is in gitlab pages and designed to be an online documentation,
let's not require everyone to build it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-08-16 14:58:51 +10:00
Peter Hutterer
261f34eda8 meson.build: fix the doxygen generation
Having an output of '.' means the $builddir/doc directory was removed on ninja
clean, only for ninja to then fail because doc/libei.h wasn't there. Let's use
the reference from meson test cases itself.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-29 17:29:40 +10:00
Peter Hutterer
96ba358984 doc: hook up doxygen
Build the doxygen API documentation. This is copied from libinput so it takes
over that style (which is more readable than the default doxygen style).
Some extra documentation is added too and all the immediate errors are fixed
in this commit but doxygen still warns about undocumented parameters.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-28 12:00:08 +10:00
Peter Hutterer
24a74f1b26 gitlab CI: change the repo location to the proper upstream one
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-16 08:15:18 +10:00
Peter Hutterer
6b3d9255cf libei: implement org.freedesktop.portal.EmulatedInput support
The current implementation of that portal has two methods: EmulateInput to
authenticate and Connect to get the fd to the EIS implementation. The portal
implementation is in charge of finding EIS and restricting it if need be.

This uses libsystemd because we can integrate that with epoll and our
libei_dispatch() method. GDBus requires a glib mainloop, so it's not really
suitable here. Given how simple this is anyway, it's easy to just do the DBus
bits in the caller and then hand the fd to ei_setup_backend_fd().

A eis-fake-portal is provided for testing, this "portal" can use the custom
portal bus name and connect the eis-demo-client to the eis-demo-server.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-25 13:35:18 +10:00
Peter Hutterer
4af29d930a tools: add keymap handling to the socket demos
Client sets layout fr, server accepts it and prints azerty for the keys
pressed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-21 18:57:25 +10:00
Peter Hutterer
a835093321 Add gitlab CI
Mostly copied from libinput and simplified so we only test on Fedora for now.
Good enough that it should catch accidental breakages.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-20 16:07:54 +10:00