Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libei for openSUSE:Factory checked in at 2023-05-29 22:47:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libei (Old) and /work/SRC/openSUSE:Factory/.libei.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libei" Mon May 29 22:47:59 2023 rev:8 rq:1089572 version:0.99.2 Changes: -------- --- /work/SRC/openSUSE:Factory/libei/libei.changes 2023-05-18 18:22:37.690420493 +0200 +++ /work/SRC/openSUSE:Factory/.libei.new.1533/libei.changes 2023-05-29 22:48:14.798456588 +0200 @@ -1,0 +2,7 @@ +Mon May 29 12:50:07 UTC 2023 - Jan Engelhardt <jeng...@inai.de> + +- Update to release 0.99.2 + * Export the event names through helper functions + * scanner: add the Interface.plainname property + +------------------------------------------------------------------- Old: ---- libei-0.99.1.tar.gz New: ---- libei-0.99.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libei.spec ++++++ --- /var/tmp/diff_new_pack.SlbmIv/_old 2023-05-29 22:48:15.266459388 +0200 +++ /var/tmp/diff_new_pack.SlbmIv/_new 2023-05-29 22:48:15.270459412 +0200 @@ -18,7 +18,7 @@ Name: libei %define lname libei1 -Version: 0.99.1 +Version: 0.99.2 Release: 0 Summary: Library for emulated input in Wayland License: MIT ++++++ libei-0.99.1.tar.gz -> libei-0.99.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/.gitlab-ci/ci.template new/libei-0.99.2/.gitlab-ci/ci.template --- old/libei-0.99.1/.gitlab-ci/ci.template 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/.gitlab-ci/ci.template 2023-05-23 06:50:33.000000000 +0200 @@ -45,6 +45,7 @@ ############################################################################### {% for distro in distributions %} {{distro.name.upper()}}_PACKAGES: '{% for p in distro.packages %}{{p}} {% endfor %}' + {{distro.name.upper()}}_PIP_PACKAGES: '{% for p in distro.pips %}{{p}} {% endfor %}' {% endfor %} ############################ end of package lists ############################# @@ -183,7 +184,7 @@ FDO_DISTRIBUTION_VERSION: '{{version}}' FDO_DISTRIBUTION_PACKAGES: ${{distro.name.upper()}}_PACKAGES FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG - FDO_DISTRIBUTION_EXEC: 'pip install structlog strenum' + FDO_DISTRIBUTION_EXEC: 'pip install ${{distro.name.upper()}}_PIP_PACKAGES' {% endfor %} {% endfor %} @@ -271,6 +272,27 @@ MESON_ARGS: '-Dwerror=true' allow_failure: true +abicheck@{{distro.name}}:{{version}}: + extends: + - .{{distro.name}}-build@template + variables: + GIT_STRATEGY: none # We need the upstream repo instead + MESON_ARGS: '-Dwerror=true' + script: + - git clone --depth=1 https://gitlab.freedesktop.org/hadess/check-abi + - | + pushd check-abi + meson _build + meson compile -C _build + meson install -C _build + popd + - git clone --depth=1 https://gitlab.freedesktop.org/$FDO_UPSTREAM_REPO + - cd libei + - git fetch --tags + - check-abi {{last_abi_break}} HEAD + only: + - merge_requests + {% endfor %} ################################################################# diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/.gitlab-ci/config.yml new/libei-0.99.2/.gitlab-ci/config.yml --- old/libei-0.99.1/.gitlab-ci/config.yml 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/.gitlab-ci/config.yml 2023-05-23 06:50:33.000000000 +0200 @@ -3,13 +3,15 @@ # # We're happy to rebuild all containers when one changes. -.default_tag: &default_tag '2023-04-06.0' +.default_tag: &default_tag '2023-05-18.3' + +last_abi_break: 0.99.1 distributions: - name: fedora tag: *default_tag versions: - - '37' # update the pages job when bumping the version + - '38' # update the pages job when bumping the version use_for_custom_build_tests: true packages: - git @@ -17,7 +19,6 @@ - gcc - gcc-c++ - pkgconf-pkg-config - - meson - systemd-devel - libxkbcommon-devel - libxml2 @@ -28,6 +29,12 @@ - python3-jinja2 - python3-pip - hugo # for documentation only + - libabigail # for abidiff only + pips: + - meson + - ninja + - structlog + - strenum - name: debian tag: *default_tag versions: @@ -37,7 +44,6 @@ - gcc - g++ - pkg-config - - meson - libsystemd-dev - libxkbcommon-dev - libxml2 @@ -47,7 +53,12 @@ - python3-dbusmock - python3-jinja2 - python3-pip + pips: + - meson + - ninja + - structlog + - strenum pages: distro: fedora - version: 37 + version: 38 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/.gitlab-ci.yml new/libei-0.99.2/.gitlab-ci.yml --- old/libei-0.99.1/.gitlab-ci.yml 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/.gitlab-ci.yml 2023-05-23 06:50:33.000000000 +0200 @@ -38,16 +38,18 @@ # See the documentation here: # # https://wayland.freedesktop.org/libinput/doc/latest/building_libinput.html # ############################################################################### - FEDORA_PACKAGES: 'git diffutils gcc gcc-c++ pkgconf-pkg-config meson systemd-devel libxkbcommon-devel libxml2 doxygen python3-attrs python3-pytest python3-dbusmock python3-jinja2 python3-pip hugo ' - DEBIAN_PACKAGES: 'git gcc g++ pkg-config meson libsystemd-dev libxkbcommon-dev libxml2 doxygen python3-attr python3-pytest python3-dbusmock python3-jinja2 python3-pip ' + FEDORA_PACKAGES: 'git diffutils gcc gcc-c++ pkgconf-pkg-config systemd-devel libxkbcommon-devel libxml2 doxygen python3-attrs python3-pytest python3-dbusmock python3-jinja2 python3-pip hugo libabigail ' + FEDORA_PIP_PACKAGES: 'meson ninja structlog strenum ' + DEBIAN_PACKAGES: 'git gcc g++ pkg-config libsystemd-dev libxkbcommon-dev libxml2 doxygen python3-attr python3-pytest python3-dbusmock python3-jinja2 python3-pip ' + DEBIAN_PIP_PACKAGES: 'meson ninja structlog strenum ' ############################ end of package lists ############################# # these tags should be updated each time the list of packages is updated # changing these will force rebuilding the associated image # Note: these tags have no meaning and are not tied to a particular # libinput version - FEDORA_TAG: '2023-04-06.0' - DEBIAN_TAG: '2023-04-06.0' + FEDORA_TAG: '2023-05-18.3' + DEBIAN_TAG: '2023-05-18.3' FDO_UPSTREAM_REPO: libinput/libei @@ -164,17 +166,17 @@ # Build distribution-specific images used by the jobs in the build stage # -fedora:37@container-prep: +fedora:38@container-prep: extends: - .fdo.container-build@fedora - .policy stage: prep variables: GIT_STRATEGY: none - FDO_DISTRIBUTION_VERSION: '37' + FDO_DISTRIBUTION_VERSION: '38' FDO_DISTRIBUTION_PACKAGES: $FEDORA_PACKAGES FDO_DISTRIBUTION_TAG: $FEDORA_TAG - FDO_DISTRIBUTION_EXEC: 'pip install structlog strenum' + FDO_DISTRIBUTION_EXEC: 'pip install $FEDORA_PIP_PACKAGES' debian:bullseye@container-prep: extends: @@ -186,7 +188,7 @@ FDO_DISTRIBUTION_VERSION: 'bullseye' FDO_DISTRIBUTION_PACKAGES: $DEBIAN_PACKAGES FDO_DISTRIBUTION_TAG: $DEBIAN_TAG - FDO_DISTRIBUTION_EXEC: 'pip install structlog strenum' + FDO_DISTRIBUTION_EXEC: 'pip install $DEBIAN_PIP_PACKAGES' @@ -222,12 +224,12 @@ - .build@template variables: MESON_TEST_ARGS: '--no-suite=python' - FDO_DISTRIBUTION_VERSION: '37' + FDO_DISTRIBUTION_VERSION: '38' FDO_DISTRIBUTION_TAG: $FEDORA_TAG needs: - - "fedora:37@container-prep" + - "fedora:38@container-prep" -default-build-release@fedora:37: +default-build-release@fedora:38: stage: distro extends: - .fedora-build@template @@ -235,13 +237,13 @@ MESON_ARGS: "-Dbuildtype=release" CFLAGS: "-Werror -Wno-error=vla-parameter" # munit triggers -Wvla-parameter -build-no-libxkcommon-nodeps@fedora:37: +build-no-libxkcommon-nodeps@fedora:38: extends: - .fedora-build@template before_script: - dnf remove -y libxkcommon-devel -build-no-doxygen@fedora:37: +build-no-doxygen@fedora:38: extends: - .fedora-build@template variables: @@ -249,7 +251,7 @@ before_script: - dnf remove -y doxygen hugo -valgrind@fedora:37: +valgrind@fedora:38: extends: - .fedora-build@template variables: @@ -257,19 +259,40 @@ before_script: - dnf install -y valgrind -pytest@fedora:37: +pytest@fedora:38: extends: - .fedora-build@template variables: MESON_TEST_ARGS: '--suite=python' -werror@fedora:37: +werror@fedora:38: extends: - .fedora-build@template variables: MESON_ARGS: '-Dwerror=true' allow_failure: true +abicheck@fedora:38: + extends: + - .fedora-build@template + variables: + GIT_STRATEGY: none # We need the upstream repo instead + MESON_ARGS: '-Dwerror=true' + script: + - git clone --depth=1 https://gitlab.freedesktop.org/hadess/check-abi + - | + pushd check-abi + meson _build + meson compile -C _build + meson install -C _build + popd + - git clone --depth=1 https://gitlab.freedesktop.org/$FDO_UPSTREAM_REPO + - cd libei + - git fetch --tags + - check-abi 0.99.1 HEAD + only: + - merge_requests + ################################################################# # # @@ -277,16 +300,16 @@ # # ################################################################# -fedora:37@default-build: +fedora:38@default-build: stage: distro extends: - .build@template - .fdo.distribution-image@fedora variables: - FDO_DISTRIBUTION_VERSION: '37' + FDO_DISTRIBUTION_VERSION: '38' FDO_DISTRIBUTION_TAG: $FEDORA_TAG needs: - - "fedora:37@container-prep" + - "fedora:38@container-prep" debian:bullseye@default-build: stage: distro @@ -306,7 +329,7 @@ - .build@template - .fdo.distribution-image@fedora variables: - FDO_DISTRIBUTION_VERSION: '37' + FDO_DISTRIBUTION_VERSION: '38' FDO_DISTRIBUTION_TAG: $FEDORA_TAG MESON_ARGS: "-Ddocumentation=protocol,api" script: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/.pre-commit-config.yaml new/libei-0.99.2/.pre-commit-config.yaml --- old/libei-0.99.1/.pre-commit-config.yaml 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/.pre-commit-config.yaml 2023-05-23 06:50:33.000000000 +0200 @@ -16,3 +16,9 @@ hooks: - id: ruff args: ['--ignore=E741,E501', '.', 'proto/ei-scanner'] +- repo: local + hooks: + - id: ci-fairy-generate-template + name: ci-fairy-generate-template + entry: bash -c 'command -v ci-fairy && ci-fairy generate-template || true' + language: system diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/meson.build new/libei-0.99.2/meson.build --- old/libei-0.99.1/meson.build 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/meson.build 2023-05-23 06:50:33.000000000 +0200 @@ -1,8 +1,8 @@ project('libei', 'c', - version: '0.99.1', + version: '0.99.2', license: 'MIT', default_options: [ 'c_std=gnu99', 'warning_level=2' ], - meson_version: '>= 0.56.0') + meson_version: '>= 0.60.0') libei_version = meson.project_version().split('.') libei_version_major = libei_version[0].to_int() @@ -77,11 +77,37 @@ config_h.set10('HAVE_MEMFD_CREATE', true) endif +dep_math = cc.find_library('m', required: false) +dep_epoll = dependency('epoll-shim', required: false) dep_libxkbcommon = dependency('xkbcommon', required: false) config_h.set10('HAVE_LIBXKBCOMMON', dep_libxkbcommon.found()) dep_libevdev = dependency('libevdev', required: false) config_h.set10('HAVE_LIBEVDEV', dep_libevdev.found()) -dep_systemd = dependency('libsystemd', required: get_option('liboeffis')) + +if not get_option('liboeffis').disabled() + sd_bus_provider = get_option('sd-bus-provider') + if sd_bus_provider == 'auto' + message('Trying to find an sd-bus provider...') + providers = ['libsystemd', 'libelogind', 'basu'] + foreach provider: providers + if dependency(provider, required: false).found() + message('Using sd-bus provider "@0@"'.format(provider)) + sd_bus_provider = provider + break + endif + endforeach + if sd_bus_provider == 'auto' + error('Failed to find an sd-bus provider, tried @0@'.format(', '.join(providers))) + endif + summary({'sd-bus-provider': sd_bus_provider}, section: 'Conditional Features') + endif + dep_sdbus = dependency(sd_bus_provider, required: get_option('liboeffis')) +else + dep_sdbus = dependency('', required: false) +endif +config_h.set10('HAVE_LIBSYSTEMD', dep_sdbus.found() and dep_sdbus.name() == 'libsystemd') +config_h.set10('HAVE_LIBELOGIND', dep_sdbus.found() and dep_sdbus.name() == 'libelogind') +config_h.set10('HAVE_BASU', dep_sdbus.found() and dep_sdbus.name() == 'basu') configure_file(output: 'config.h', configuration: config_h) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/meson_options.txt new/libei-0.99.2/meson_options.txt --- old/libei-0.99.1/meson_options.txt 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/meson_options.txt 2023-05-23 06:50:33.000000000 +0200 @@ -1,3 +1,4 @@ option('documentation', type: 'array', value: [], choices: ['api', 'protocol'], description: 'Enable documentation builds') +option('sd-bus-provider', type: 'combo', choices: ['auto', 'libsystemd', 'libelogind', 'basu'], value: 'auto', description: 'Provider of the sd-bus library') option('tests', type: 'feature', value: 'auto', description: 'Enable/disable tests') option('liboeffis', type: 'feature', value: 'auto', description: 'Build liboeffis.so') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/proto/ei-scanner new/libei-0.99.2/proto/ei-scanner --- old/libei-0.99.1/proto/ei-scanner 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/proto/ei-scanner 2023-05-23 06:50:33.000000000 +0200 @@ -317,6 +317,16 @@ """ return Interface.mangle_name(self.protocol_name, self.mode) + @property + def plainname(self) -> str: + """ + Returns the plain name of the interface, i.e. this returns + "pointer", "handshake", etc. without the "ei_" or "eis_" prefix. + """ + if self.protocol_name.startswith("ei_"): + return f"{self.protocol_name[3:]}" + return self.protocol_name + @staticmethod def mangle_name(name: str, component: str) -> str: """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/proto/meson.build new/libei-0.99.2/proto/meson.build --- old/libei-0.99.1/proto/meson.build 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/proto/meson.build 2023-05-23 06:50:33.000000000 +0200 @@ -1,6 +1,9 @@ -scanner = find_program('ei-scanner') -protocol_xml = files('protocol.xml') -protocol_dtd = files('protocol.dtd') +scanner_source = files('ei-scanner') +scanner = find_program(scanner_source) +protocol_xml_path = meson.current_source_dir() / 'protocol.xml' +protocol_dtd_path = meson.current_source_dir() / 'protocol.dtd' +protocol_xml = files(protocol_xml_path) +protocol_dtd = files(protocol_dtd_path) xmllint = find_program('xmllint', required: false) if xmllint.found() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/proto/protocol.xml new/libei-0.99.2/proto/protocol.xml --- old/libei-0.99.1/proto/protocol.xml 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/proto/protocol.xml 2023-05-23 06:50:33.000000000 +0200 @@ -1258,7 +1258,7 @@ <request name="key" since="1" context-type="sender"> <description summary="Key state change request"> Generate a key event on this keyboard. If the device has an - ei_device.keymap, the key code corresponds to that keymap. + ei_keyboard.keymap, the key code corresponds to that keymap. The key codes must match the defines in linux/input-event-codes.h. @@ -1346,7 +1346,7 @@ This event does not reqire an ei_device.frame and should be processed immediately by the client. - This event is only sent for devices with an ei_device.keymap. + This event is only sent for devices with an ei_keyboard.keymap. </description> <arg name="serial" type="uint32" summary="this event's serial number"/> <arg name="depressed" type="uint32" summary="depressed modifiers"/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/src/brei-proto.h.tmpl new/libei-0.99.2/src/brei-proto.h.tmpl --- old/libei-0.99.1/src/brei-proto.h.tmpl 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/src/brei-proto.h.tmpl 2023-05-23 06:50:33.000000000 +0200 @@ -30,6 +30,11 @@ extern "C" { #endif +#include <stdint.h> + +typedef uint64_t object_id_t; +typedef object_id_t new_id_t; + {% for interface in interfaces %} {% for enum in interface.enums %} enum {{enum.fqdn}} { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/src/brei-shared.c new/libei-0.99.2/src/brei-shared.c --- old/libei-0.99.1/src/brei-shared.c 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/src/brei-shared.c 2023-05-23 06:50:33.000000000 +0200 @@ -225,12 +225,13 @@ case 's': { struct brei_string *s = (struct brei_string *)p; + uint32_t remaining = end - p; uint32_t protolen = brei_string_proto_length(s->len); /* in bytes */ uint32_t len32 = protolen/4; /* p and end are uint32_t* */ - if (end - p < len32) { + if (remaining < len32) { return brei_result_new(BREI_CONNECTION_DISCONNECT_REASON_PROTOCOL, - "Invalid string length %u, only %li bytes remaining", s->len, (end - p) * 4); + "Invalid string length %u, only %u bytes remaining", s->len, remaining * 4); } if (s->len == 0) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/src/brei-shared.h new/libei-0.99.2/src/brei-shared.h --- old/libei-0.99.1/src/brei-shared.h 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/src/brei-shared.h 2023-05-23 06:50:33.000000000 +0200 @@ -30,12 +30,11 @@ #include <stdint.h> #include <stdarg.h> +#include "brei-proto.h" #include "util-macros.h" #include "util-list.h" #include "util-object.h" -typedef uint64_t object_id_t; - struct brei_interface; struct brei_message; struct brei_object; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/src/ei-proto.h.tmpl new/libei-0.99.2/src/ei-proto.h.tmpl --- old/libei-0.99.1/src/ei-proto.h.tmpl 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/src/ei-proto.h.tmpl 2023-05-23 06:50:33.000000000 +0200 @@ -31,15 +31,12 @@ #endif #include <stdint.h> - +#include <brei-proto.h> /** * Forward declarations. This file is intended to be compile-able without including * any of the actual sources files. */ -typedef uint64_t object_id_t; -typedef object_id_t new_id_t; - struct {{target.name}}; /* Interface declarations */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/src/libei-event.c new/libei-0.99.2/src/libei-event.c --- old/libei-0.99.1/src/libei-event.c 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/src/libei-event.c 2023-05-23 06:50:33.000000000 +0200 @@ -36,7 +36,7 @@ _public_ OBJECT_IMPLEMENT_GETTER(ei_event, seat, struct ei_seat*); -const char * +_public_ const char * ei_event_type_to_string(enum ei_event_type type) { switch(type) { @@ -65,7 +65,7 @@ CASE_RETURN_STRING(EI_EVENT_TOUCH_MOTION); } - assert(!"Unhandled event type"); + return NULL; } static void diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/src/libei-event.h new/libei-0.99.2/src/libei-event.h --- old/libei-0.99.1/src/libei-event.h 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/src/libei-event.h 2023-05-23 06:50:33.000000000 +0200 @@ -82,6 +82,3 @@ struct ei_event * ei_event_ref(struct ei_event *event); - -const char * -ei_event_type_to_string(enum ei_event_type type); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/src/libei.c new/libei-0.99.2/src/libei.c --- old/libei-0.99.1/src/libei.c 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/src/libei.c 2023-05-23 06:50:33.000000000 +0200 @@ -83,8 +83,6 @@ OBJECT_IMPLEMENT_GETTER(ei, serial, uint32_t); DEFINE_UNREF_CLEANUP_FUNC(brei_result); -DEFINE_UNREF_CLEANUP_FUNC(ei_device); -DEFINE_UNREF_CLEANUP_FUNC(ei_region); DEFINE_UNREF_CLEANUP_FUNC(ei_pingpong); struct ei * @@ -728,6 +726,7 @@ _unref_(brei_result) *result = brei_dispatch(ei->brei, source_get_fd(source), lookup_object, ei); if (result) { + log_warn(ei, "Connection error: %s", brei_result_get_explanation(result)); brei_drain_fd(source_get_fd(source)); ei_disconnect(ei); } @@ -740,8 +739,6 @@ "DISCONNECTED", "DISCONNECTING", }; - if (result) - log_warn(ei, "Connection error: %s", brei_result_get_explanation(result)); if (old_state != ei->state) log_debug(ei, "Connection dispatch: %s -> %s", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/src/libei.h new/libei-0.99.2/src/libei.h --- old/libei-0.99.1/src/libei.h 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/src/libei.h 2023-05-23 06:50:33.000000000 +0200 @@ -521,6 +521,14 @@ }; /** + * This is a debugging helper to return a string of the name of the event type, + * or NULL if the event type is invalid. For example, for @ref EI_EVENT_TOUCH_UP this + * function returns the string "EI_EVENT_TOUCH_UP". + */ +const char* +ei_event_type_to_string(enum ei_event_type); + +/** * This is an alias for @ref ei_new_sender. */ struct ei * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/src/libeis-client.c new/libei-0.99.2/src/libeis-client.c --- old/libei-0.99.1/src/libeis-client.c 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/src/libeis-client.c 2023-05-23 06:50:33.000000000 +0200 @@ -393,6 +393,11 @@ _unref_(brei_result) *result = brei_dispatch(client->brei, source_get_fd(source), lookup_object, client); if (result) { + if (old_state != EIS_CLIENT_STATE_REQUESTED_DISCONNECT || + brei_result_get_reason(result) != BREI_CONNECTION_DISCONNECT_REASON_TRANSPORT) + log_warn(eis_client_get_context(client), "Client error: %s", + brei_result_get_explanation(result)); + brei_drain_fd(source_get_fd(source)); eis_client_disconnect_with_reason(client, brei_result_get_reason(result), @@ -406,9 +411,6 @@ "REQUESTED_DISCONNECT", "DISCONNECTED", }; - if (result) - log_warn(eis_client_get_context(client), "Client error: %s", - brei_result_get_explanation(result)); if (old_state != client->state) { assert(old_state < ARRAY_LENGTH(client_states)); assert(client->state < ARRAY_LENGTH(client_states)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/src/libeis.c new/libei-0.99.2/src/libeis.c --- old/libei-0.99.1/src/libeis.c 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/src/libeis.c 2023-05-23 06:50:33.000000000 +0200 @@ -110,7 +110,7 @@ sink_dispatch(eis->sink); } -static const char * +_public_ const char * eis_event_type_to_string(enum eis_event_type type) { switch(type) { @@ -134,7 +134,7 @@ CASE_RETURN_STRING(EIS_EVENT_FRAME); } - assert(!"Unhandled event type"); + return NULL; } static void diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/src/libeis.h new/libei-0.99.2/src/libeis.h --- old/libei-0.99.1/src/libeis.h 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/src/libeis.h 2023-05-23 06:50:33.000000000 +0200 @@ -349,6 +349,14 @@ }; /** + * This is a debugging helper to return a string of the name of the event type, + * or NULL if the event type is invalid. For example, for @ref EIS_EVENT_TOUCH_UP this + * function returns the string "EIS_EVENT_TOUCH_UP". + */ +const char* +eis_event_type_to_string(enum eis_event_type); + +/** * Create a new libeis context with a refcount of 1. */ struct eis * @@ -625,13 +633,6 @@ eis_client_disconnect(struct eis_client *client); /** - * Returns true if the client is allowed this capability. - */ -bool -eis_client_has_capability(struct eis_client *client, - enum eis_device_capability cap); - -/** * Create a new logical seat with a given name. Devices available to a * client belong to a bound seat, or in other words: a client cannot receive * events from a device until it binds to a seat and receives all devices from diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/src/liboeffis.c new/libei-0.99.2/src/liboeffis.c --- old/libei-0.99.1/src/liboeffis.c 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/src/liboeffis.c 2023-05-23 06:50:33.000000000 +0200 @@ -24,7 +24,13 @@ #include "config.h" +#if HAVE_LIBSYSTEMD #include <systemd/sd-bus.h> +#elif HAVE_LIBELOGIND +#include <elogind/sd-bus.h> +#elif HAVE_BASU +#include <basu/sd-bus.h> +#endif #include "util-io.h" #include "util-macros.h" @@ -107,7 +113,8 @@ free(oeffis->sender_name); free(oeffis->session_path); free(oeffis->busname); - sd_bus_close_unref(oeffis->bus); + sd_bus_close(oeffis->bus); + sd_bus_unref(oeffis->bus); sd_bus_slot_unref(oeffis->slot_request_response); sd_bus_slot_unref(oeffis->slot_session_closed); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/src/meson.build new/libei-0.99.2/src/meson.build --- old/libei-0.99.1/src/meson.build 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/src/meson.build 2023-05-23 06:50:33.000000000 +0200 @@ -11,6 +11,7 @@ lib_util = static_library('util', src_libutil, include_directories: [inc_builddir], + dependencies: [dep_math, dep_epoll], ) dep_libutil = declare_dependency(link_with: lib_util) @@ -141,11 +142,11 @@ libraries: lib_libeis, ) -build_oeffis = dep_systemd.found() +build_oeffis = dep_sdbus.found() summary({'liboeffis': build_oeffis}, section: 'Conditional Features') if build_oeffis src_liboeffis = files('liboeffis.c') - deps_liboeffis = [dep_libutil, dep_systemd] + deps_liboeffis = [dep_libutil, dep_sdbus] lib_liboeffis = library('oeffis', src_liboeffis, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/src/util-memfile.c new/libei-0.99.2/src/util-memfile.c --- old/libei-0.99.1/src/util-memfile.c 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/src/util-memfile.c 2023-05-23 06:50:33.000000000 +0200 @@ -24,13 +24,12 @@ #include "config.h" +#if HAVE_MEMFD_CREATE #include <stddef.h> #include <unistd.h> #include <fcntl.h> -#if HAVE_MEMFD_CREATE #include <sys/mman.h> -#endif #include "util-memfile.h" #include "util-mem.h" @@ -58,7 +57,6 @@ OBJECT_IMPLEMENT_GETTER(memfile, fd, int); OBJECT_IMPLEMENT_GETTER(memfile, size, size_t); -#if HAVE_MEMFD_CREATE struct memfile * memfile_new(const char *data, size_t sz) { _unref_(memfile) *memfile = memfile_create(NULL); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/src/util-strings.h new/libei-0.99.2/src/util-strings.h --- old/libei-0.99.1/src/util-strings.h 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/src/util-strings.h 2023-05-23 06:50:33.000000000 +0200 @@ -45,6 +45,12 @@ #include <xlocale.h> #endif +#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#include <sys/types.h> +#include <sys/sysctl.h> +#include <unistd.h> +#endif + #include "util-macros.h" #include "util-mem.h" @@ -397,6 +403,29 @@ static inline char * cmdline_as_str(void) { +#ifdef KERN_PROC_ARGS + int mib[] = { + CTL_KERN, +#if defined(__NetBSD__) || defined(__OpenBSD__) + KERN_PROC_ARGS, + getpid(), + KERN_PROC_ARGV, +#else + KERN_PROC, + KERN_PROC_ARGS, + getpid(), +#endif + }; + size_t len; + if (sysctl(mib, ARRAY_LENGTH(mib), NULL, &len, NULL, 0)) + return NULL; + + char *const procargs = malloc(len); + if (sysctl(mib, ARRAY_LENGTH(mib), procargs, &len, NULL, 0)) + return NULL; + + return procargs; +#else int fd = open("/proc/self/cmdline", O_RDONLY); if (fd > 0) { char buffer[1024] = {0}; @@ -404,5 +433,6 @@ close(fd); return len > 0 ? xstrdup(buffer) : NULL; } +#endif return NULL; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/test/meson.build new/libei-0.99.2/test/meson.build --- old/libei-0.99.1/test/meson.build 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/test/meson.build 2023-05-23 06:50:33.000000000 +0200 @@ -24,7 +24,7 @@ src_libutil, include_directories: [inc_src, inc_builddir], c_args: ['-D_enable_tests_'], - dependencies: [dep_unittest])) + dependencies: [dep_unittest, dep_math, dep_epoll])) test('unit-tests-ei', executable('unit-tests-ei', @@ -149,7 +149,7 @@ configuration: protocol_test_config) test('protocol-test', pytest, - args: pytest_args, + args: pytest_args + ['-k', 'TestEiProtocol'], suite: 'python', workdir: meson.project_build_root(), ) @@ -157,7 +157,7 @@ env = environment() env.set('LIBEI_USE_VALGRIND', '1') test('protocol-test-valgrind', pytest, - args: pytest_args, + args: pytest_args + ['-k', 'TestEiProtocol'], suite: 'python', workdir: meson.project_build_root(), env: env @@ -174,6 +174,21 @@ env: env, ) endif + + test_scanner_config = configuration_data() + test_scanner_config.set('PROTOFILE', protocol_xml_path) + + # ei-scanner can't be imported as-is in python, so we copy + rename it + configure_file(input: scanner_source, + output: 'eiscanner.py', + copy: true) + configure_file(input: 'test_scanner.py', + output: '@PLAINNAME@', + configuration: test_scanner_config) + test('scanner-pytest', pytest, + args: pytest_args + ['-k', 'TestScanner'], + suite: 'python', + workdir: meson.current_build_dir()) endif summary({'valgrind available': valgrind.found(), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/test/test-ei-device.c new/libei-0.99.2/test/test-ei-device.c --- old/libei-0.99.1/test/test-ei-device.c 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/test/test-ei-device.c 2023-05-23 06:50:33.000000000 +0200 @@ -34,8 +34,10 @@ #include "eierpecken.h" +#if HAVE_MEMFD_CREATE DEFINE_TRIVIAL_CLEANUP_FUNC(struct memfile *, memfile_unref); #define _cleanup_memfile_ _cleanup_(memfile_unrefp) +#endif MUNIT_TEST(test_ei_device_basics) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/test/test_scanner.py new/libei-0.99.2/test/test_scanner.py --- old/libei-0.99.1/test/test_scanner.py 1970-01-01 01:00:00.000000000 +0100 +++ new/libei-0.99.2/test/test_scanner.py 2023-05-23 06:50:33.000000000 +0200 @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 + +# We can't import ei-scanner, so let's go via this route. The proper +# handling would be to have ei-scanner be the entry point for a ei_scanner +# module but.. well, one day we'll do that maybe. +import pytest + +try: + from eiscanner import parse, Protocol +except ImportError: + print("Run tests from within the build directory") + pytest.skip(allow_module_level=True) + +from pathlib import Path + +# set to the protocol file by meson +protofile = "@PROTOFILE@" + + +@pytest.fixture +def protocol_xml() -> Path: + return Path(protofile) + + +@pytest.fixture +def protocol(protocol_xml: Path, component: str) -> Protocol: + print(f"protocol for component {component}") + return parse(protocol_xml, component) + + +@pytest.mark.skipif( + protofile.startswith("@"), + reason="Protocol XML file path invalid, run tests in the build dir", +) +class TestScanner: + @pytest.mark.parametrize("component", ("eis", "ei", "brei")) + def test_ei_names(self, component: str, protocol: Protocol): + for interface in protocol.interfaces: + assert interface.name.startswith(component) + assert not interface.plainname.startswith(component) + assert not interface.plainname.startswith("ei_") + + # just some manual checks + assert "handshake" in [i.plainname for i in protocol.interfaces] + assert "connection" in [i.plainname for i in protocol.interfaces] + assert "button" in [i.plainname for i in protocol.interfaces] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/tools/ei-debug-events.c new/libei-0.99.2/tools/ei-debug-events.c --- old/libei-0.99.1/tools/ei-debug-events.c 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/tools/ei-debug-events.c 2023-05-23 06:50:33.000000000 +0200 @@ -57,7 +57,6 @@ #include "src/util-io.h" DEFINE_UNREF_CLEANUP_FUNC(ei); -DEFINE_UNREF_CLEANUP_FUNC(ei_device); DEFINE_UNREF_CLEANUP_FUNC(ei_event); #define truefalse(v_) (v_) ? "true" : "false" @@ -71,7 +70,7 @@ "Start an EI client and print communication from the EIS implementation in YAML format.\n" "The client will bind to all available capabilities on all seats.\n" "\n" - "By default, this client connects to $LIBEI_SOCKET if set or XDG_RUNTIME/eis-0\n" + "By default, this client connects to $LIBEI_SOCKET if set or $XDG_RUNTIME_DIR/eis-0\n" "\n" "Options:\n" " --socketfd Use the given fd as socket to the EIS implementation\n" @@ -82,38 +81,6 @@ argv0); } -static const char * -event_type(enum ei_event_type type) -{ - switch(type) { - CASE_RETURN_STRING(EI_EVENT_CONNECT); - CASE_RETURN_STRING(EI_EVENT_DISCONNECT); - CASE_RETURN_STRING(EI_EVENT_SEAT_ADDED); - CASE_RETURN_STRING(EI_EVENT_SEAT_REMOVED); - CASE_RETURN_STRING(EI_EVENT_DEVICE_ADDED); - CASE_RETURN_STRING(EI_EVENT_DEVICE_REMOVED); - CASE_RETURN_STRING(EI_EVENT_DEVICE_PAUSED); - CASE_RETURN_STRING(EI_EVENT_DEVICE_RESUMED); - CASE_RETURN_STRING(EI_EVENT_KEYBOARD_MODIFIERS); - CASE_RETURN_STRING(EI_EVENT_FRAME); - CASE_RETURN_STRING(EI_EVENT_DEVICE_START_EMULATING); - CASE_RETURN_STRING(EI_EVENT_DEVICE_STOP_EMULATING); - CASE_RETURN_STRING(EI_EVENT_POINTER_MOTION); - CASE_RETURN_STRING(EI_EVENT_POINTER_MOTION_ABSOLUTE); - CASE_RETURN_STRING(EI_EVENT_BUTTON_BUTTON); - CASE_RETURN_STRING(EI_EVENT_SCROLL_DELTA); - CASE_RETURN_STRING(EI_EVENT_SCROLL_STOP); - CASE_RETURN_STRING(EI_EVENT_SCROLL_CANCEL); - CASE_RETURN_STRING(EI_EVENT_SCROLL_DISCRETE); - CASE_RETURN_STRING(EI_EVENT_KEYBOARD_KEY); - CASE_RETURN_STRING(EI_EVENT_TOUCH_DOWN); - CASE_RETURN_STRING(EI_EVENT_TOUCH_UP); - CASE_RETURN_STRING(EI_EVENT_TOUCH_MOTION); - } - - assert(!"Unhandled event type"); -} - static void print_header(void) { @@ -127,8 +94,7 @@ run_only_once { printf("events:\n"); } - const char *type = event_type(ei_event_get_type(event)); - printf("- type: %s\n", type); + printf("- type: %s\n", ei_event_type_to_string(ei_event_get_type(event))); } static void diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/tools/ei-demo-client.c new/libei-0.99.2/tools/ei-demo-client.c --- old/libei-0.99.1/tools/ei-demo-client.c 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/tools/ei-demo-client.c 2023-05-23 06:50:33.000000000 +0200 @@ -174,7 +174,7 @@ "\n" "Options:\n" " --socket Use the socket backend. The socket path is $LIBEI_SOCKET if set, \n" - " otherwise XDG_RUNTIME/eis-0\n" + " otherwise $XDG_RUNTIME_DIR/eis-0\n" " --portal Use the portal backend.\n" " --busname Use the given busname (default: org.freedesktop.portal.Desktop)\n" " --verbose Enable debugging output\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libei-0.99.1/tools/eis-demo-server.c new/libei-0.99.2/tools/eis-demo-server.c --- old/libei-0.99.1/tools/eis-demo-server.c 2023-05-17 04:28:12.000000000 +0200 +++ new/libei-0.99.2/tools/eis-demo-server.c 2023-05-23 06:50:33.000000000 +0200 @@ -554,7 +554,7 @@ "and devices and prints any events from the client to stdout.\n" "\n" "Options:\n" - " --socketpath Use the given socket path. Default: $XDG_RUNTIME/eis-0\n" + " --socketpath Use the given socket path. Default: $XDG_RUNTIME_DIR/eis-0\n" " --layout Use the given XKB layout (requires libxkbcommon). Default: none\n" " --uinput Set up each device as uinput device (this requires root)\n" " --verbose Enable debugging output\n"