Compare commits

...

15 commits
1.0 ... master

Author SHA1 Message Date
Alan Coopersmith
d5435b07a8 Update submodule URL from anongit to gitlab
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/lib/libxcb-errors/-/merge_requests/7>
2024-09-07 11:35:30 -07:00
Alan Coopersmith
de938c69f3 gitlab CI: Use Xvfb to allow all tests to run
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-12-13 00:47:31 +00:00
Uli Schlachter
fad9c433f5 Fix tests
The tests also use some non-existing events to check that these are
handled correctly. Then came XI 2.4 and introduced several new events,
which broke the test.

Fix this by updating the test accordingly.

This means tests will now fail when using an older version of xcb-proto.
If you are affected by this, either do not run tests, or build against a
newer version of xcb-proto.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2023-12-08 17:43:53 +01:00
Alan Coopersmith
f85a73865a Add README.md
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-10-18 18:23:00 -07:00
Alan Coopersmith
517dd82c07
xcb-util-errors 1.0.1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-10-18 18:10:25 -07:00
Mihail Konev
8a2812f603 autogen: add default patch prefix
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-24 14:07:36 -07:00
Emil Velikov
f968311042 autogen.sh: use quoted string variables
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
fall-outs, when they contain space.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-24 14:06:29 -07:00
Peter Hutterer
0fb1c07367 autogen.sh: use exec instead of waiting for configure to finish
Syncs the invocation of configure with the one from the server.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-24 14:06:29 -07:00
Alan Coopersmith
50574404bd autogen.sh: Honor NOCONFIGURE=1
See http://people.gnome.org/~walters/docs/build-api.txt

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-24 14:06:29 -07:00
Alan Coopersmith
3de8874f5d configure: Drop AM_MAINTAINER_MODE
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-24 14:06:29 -07:00
Alan Coopersmith
b33178bb4a gitlab CI: add a basic build test
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-20 15:24:15 -07:00
Alan Coopersmith
e2bfc8115d Update m4 to xorg/util/xcb-util-m4@c617eee22ae5c285e79e81
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-20 14:58:19 -07:00
Alan Coopersmith
4440550baf Use AC_CONFIG_FILES to replace the deprecated AC_OUTPUT with parameters
configure.ac:33: warning: AC_OUTPUT should be used without arguments.
configure.ac:33: You should run autoupdate.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-06-18 10:20:08 -07:00
Alan Coopersmith
a40b2df701 Build xz tarballs instead of bzip2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-06-18 10:19:06 -07:00
Uli Schlachter
5d660ebe87 Do not distribute extensions.c and fix out-of-tree builds
It all started with src/extensions.c being distributed. Thanks to this, tarballs
shipped with this generated file and actually building this file was skipped.
Fix this by using the nodist_ variant of the SOURCES variable.

Due to this oversight (sorry!), the out-of-tree build wasn't actually tested.
The rule that generates src/extensions.c was missing $(srcdir) in front of the
path to extensions.py. This rule is now fixed and, as suggested by Daphne
Pfister, also changed to explicitly call the python interpreter. Configure is
changed to look for it.

Finally, extensions.c couldn't include errors.h. This worked before, because the
C compiler automatically looks for headers in the same directory as the source
file. However, for out-of-tree builds, the source directory and build directory
are different. Paper over this problem by explicitly making it look in the right
directory.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=90328
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-05-06 08:16:54 +02:00
8 changed files with 151 additions and 15 deletions

103
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,103 @@
# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0 filetype=yaml:
#
# This CI uses the freedesktop.org ci-templates.
# Please see the ci-templates documentation for details:
# https://freedesktop.pages.freedesktop.org/ci-templates/
.templates_sha: &template_sha 34f4ade99434043f88e164933f570301fd18b125 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
include:
# Arch container builder template
- project: 'freedesktop/ci-templates'
ref: *template_sha
file: '/templates/arch.yml'
- project: 'freedesktop/ci-templates'
ref: *template_sha
file: '/templates/ci-fairy.yml'
- template: Security/SAST.gitlab-ci.yml
stages:
- prep # prep work like rebuilding the container images if there is a change
- build # for actually building and testing things in a container
- test
- deploy
variables:
FDO_UPSTREAM_REPO: 'xorg/lib/libxcb-errors'
# The tag should be updated each time the list of packages is updated.
# Changing a tag forces the associated image to be rebuilt.
# Note: the tag has no meaning, we use a date format purely for readability
FDO_DISTRIBUTION_TAG: '2023-12-11.0'
FDO_DISTRIBUTION_PACKAGES: 'git gcc pkgconf autoconf automake libtool make xorg-util-macros doxygen graphviz python xorgproto libxcb xcb-proto xorg-server-xvfb'
GIT_SUBMODULE_STRATEGY: normal
#
# Verify that commit messages are as expected
#
check-commits:
extends:
- .fdo.ci-fairy
stage: prep
script:
- ci-fairy check-commits --junit-xml=results.xml
except:
- master@xorg/lib/libxcb-errors
variables:
GIT_DEPTH: 100
artifacts:
reports:
junit: results.xml
#
# Verify that the merge request has the allow-collaboration checkbox ticked
#
check-merge-request:
extends:
- .fdo.ci-fairy
stage: deploy
script:
- ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
artifacts:
when: on_failure
reports:
junit: results.xml
allow_failure: true
#
# Build a container with the given tag and the packages pre-installed.
# This only happens if/when the tag changes, otherwise the existing image is
# re-used.
#
container-prep:
extends:
- .fdo.container-build@arch
stage: prep
variables:
GIT_STRATEGY: none
#
# The default build, runs on the image built above.
#
build:
stage: build
extends:
- .fdo.distribution-image@arch
script:
- autoreconf -ivf
- mkdir _builddir
- pushd _builddir > /dev/null
- ../configure --disable-silent-rules
- make
- xvfb-run --server-args='-noreset' make check
- make distcheck
- popd > /dev/null
artifacts:
when: on_failure
paths:
- _builddir/config.log
- _builddir/test-suite.log

2
.gitmodules vendored
View file

@ -1,3 +1,3 @@
[submodule "m4"]
path = m4
url = git://anongit.freedesktop.org/xcb/util-common-m4.git
url = https://gitlab.freedesktop.org/xorg/util/xcb-util-m4.git

View file

@ -12,7 +12,7 @@ ChangeLog:
dist-hook: ChangeLog INSTALL
EXTRA_DIST = autogen.sh xcb-errors.pc.in src/errors.h src/extensions.py
EXTRA_DIST = autogen.sh xcb-errors.pc.in src/errors.h src/extensions.py README.md
lib_LTLIBRARIES = libxcb-errors.la
@ -20,8 +20,9 @@ xcbinclude_HEADERS = src/xcb_errors.h
AM_CFLAGS = $(CWARNFLAGS)
libxcb_errors_la_SOURCES = src/xcb_errors.c src/extensions.c
libxcb_errors_la_CPPFLAGS = $(XCB_CFLAGS) $(XPROTO_CFLAGS)
libxcb_errors_la_SOURCES = src/xcb_errors.c
nodist_libxcb_errors_la_SOURCES = src/extensions.c
libxcb_errors_la_CPPFLAGS = $(XCB_CFLAGS) $(XPROTO_CFLAGS) -I$(srcdir)/src
libxcb_errors_la_LIBADD = $(XCB_LIBS) $(XPROTO_LIBS)
libxcb_errors_la_LDFLAGS = -version-info 0:0:0 -no-undefined -export-symbols-regex '^xcb_errors_'
@ -36,5 +37,5 @@ tests_test_LDADD = libxcb-errors.la $(XCB_LIBS)
CLEANFILES = src/extensions.c
src/extensions.c: src/extensions.py
$(AM_V_GEN)src/extensions.py $@.tmp ${XCBPROTO_XCBINCLUDEDIR}/*.xml && \
$(AM_V_GEN)$(PYTHON) $(srcdir)/src/extensions.py $@.tmp ${XCBPROTO_XCBINCLUDEDIR}/*.xml && \
mv $@.tmp $@

23
README.md Normal file
View file

@ -0,0 +1,23 @@
xcb-util-errors is a utility library that gives human readable names to error
codes and event codes and also to major and minor numbers.
The necessary information is drawn from xcb-proto's protocol descriptions.
This library is especially useful when working with extensions and is mostly
useful for debugging.
All questions regarding this software should be directed at the
XCB mailing list:
https://lists.x.org/mailman/listinfo/xcb
The primary development code repository can be found at:
https://gitlab.freedesktop.org/xorg/lib/libxcb-errors
Please submit bug reports and requests to merge patches there.
For patch submission instructions, see:
https://www.x.org/wiki/Development/Documentation/SubmittingPatches

View file

@ -1,10 +1,10 @@
#! /bin/sh
srcdir=`dirname $0`
srcdir=`dirname "$0"`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd $srcdir
cd "$srcdir"
# If this is a git checkout, verify that the submodules are initialized,
# otherwise autotools will just fail with an unhelpful error message.
@ -22,6 +22,11 @@ then
fi
autoreconf -v --install || exit 1
cd $ORIGDIR || exit $?
cd "$ORIGDIR" || exit $?
$srcdir/configure --enable-maintainer-mode "$@"
git config --local --get format.subjectPrefix >/dev/null 2>&1 ||
git config --local format.subjectPrefix "PATCH libxcb-errors"
if test -z "$NOCONFIGURE"; then
exec "$srcdir"/configure "$@"
fi

View file

@ -1,6 +1,7 @@
dnl XCB_UTIL_M4_WITH_INCLUDE_PATH requires Autoconf >= 2.62
AC_PREREQ(2.62)
AC_INIT([xcb-util-errors],1.0,[xcb@lists.freedesktop.org])
AC_INIT([xcb-util-errors], [1.0.1],
[https://gitlab.freedesktop.org/xorg/lib/libxcb-errors/-/issues])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_MACRO_DIR([m4])
@ -9,14 +10,15 @@ AC_CONFIG_MACRO_DIR([m4])
# to avoid autoconf errors.
AC_USE_SYSTEM_EXTENSIONS
AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects])
AM_MAINTAINER_MODE
AM_INIT_AUTOMAKE([foreign dist-xz subdir-objects])
AC_TYPE_SSIZE_T
XCB_UTIL_M4_WITH_INCLUDE_PATH
XCB_UTIL_COMMON([1.4], [1.6])
AM_PATH_PYTHON
# Checks for xcb-proto's XML files, inspired from libxcb's configure.ac
PKG_CHECK_MODULES(XCBPROTO, xcb-proto)
AC_MSG_CHECKING(XCBPROTO_XCBINCLUDEDIR)
@ -28,6 +30,7 @@ AC_SUBST(XCBPROTO_XCBINCLUDEDIR)
XCBPROTO_VERSION=`$PKG_CONFIG --modversion xcb-proto`
AC_SUBST(XCBPROTO_VERSION)
AC_OUTPUT([Makefile
AC_CONFIG_FILES([Makefile
xcb-errors.pc
])
AC_OUTPUT

2
m4

@ -1 +1 @@
Subproject commit f662e3a93ebdec3d1c9374382dcc070093a42fed
Subproject commit c617eee22ae5c285e79e81ec39ce96862fd3262f

View file

@ -303,7 +303,8 @@ static int test_xinput(xcb_connection_t *c, xcb_errors_context_t *ctx)
err |= check_xge_event(ctx, reply->major_opcode, 0, "Unknown (0)", "Input");
err |= check_xge_event(ctx, reply->major_opcode, 1, "DeviceChanged", "Input");
err |= check_xge_event(ctx, reply->major_opcode, 26, "BarrierLeave", "Input");
err |= check_xge_event(ctx, reply->major_opcode, 27, NULL, "Input");
err |= check_xge_event(ctx, reply->major_opcode, 32, "GestureSwipeEnd", "Input");
err |= check_xge_event(ctx, reply->major_opcode, 33, NULL, "Input");
err |= check_xge_event(ctx, reply->major_opcode, 1337, NULL, "Input");
err |= check_xge_event(ctx, reply->major_opcode, 0xffff, NULL, "Input");
err |= check_minor(ctx, reply->major_opcode, 0, "Unknown (0)");