Skip to content

Commit

Permalink
Bump the soname to get rid of the deprecated symbols
Browse files Browse the repository at this point in the history
This is an ABI break but doesn't have any effect on any caller, just rebuild
the caller and done. None of these symbols were ever used by anyone (see
d918631), keeping them was nice for ABI
stability but it also causes some issues, notably with compilers not
supporting symbol versioning.

The new exported symbol set is already named libwacom 2.0. Still the same API
but it makes for less surprises of those using the API.

Fixes #192
Fixes #170
Fixes #267

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
  • Loading branch information
whot committed Oct 11, 2021
1 parent 90d7a78 commit b4f3c3f
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 122 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ AM_MAINTAINER_MODE([enable])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

# Do not modify this, use symbol versioning instead.
LIBWACOM_LT_VERSION=8:1:6
LIBWACOM_LT_VERSION=9:0:0
AC_SUBST(LIBWACOM_LT_VERSION)

# Initialize libtool
Expand Down
2 changes: 1 addition & 1 deletion libwacom/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ libwacom_la_SOURCES = \
libwacom.c \
libwacom-error.c \
libwacom-database.c \
libwacom-deprecated.c
$(NULL)

libwacom_la_LIBADD = $(GLIB_LIBS)
libwacom_la_CFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS)
Expand Down
84 changes: 0 additions & 84 deletions libwacom/libwacom-deprecated.c

This file was deleted.

15 changes: 3 additions & 12 deletions libwacom/libwacom.sym
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* in alphabetical order! */

LIBWACOM_0.33 {
LIBWACOM_2.0 {
global:
libwacom_compare;
libwacom_database_destroy;
Expand All @@ -11,7 +11,6 @@ global:
libwacom_error_get_code;
libwacom_error_get_message;
libwacom_error_new;
libwacom_error_set;
libwacom_get_bustype;
libwacom_get_button_evdev_code;
libwacom_get_button_flag;
Expand Down Expand Up @@ -43,37 +42,29 @@ global:
libwacom_is_builtin;
libwacom_is_reversible;
libwacom_list_devices_from_database;
libwacom_match_destroy;
libwacom_match_get_bustype;
libwacom_match_get_match_string;
libwacom_match_get_name;
libwacom_match_get_product_id;
libwacom_match_get_vendor_id;
libwacom_match_new;
libwacom_new_from_name;
libwacom_new_from_path;
libwacom_new_from_usbid;
libwacom_print_device_description;
libwacom_print_stylus_description;
libwacom_stylus_destroy;
libwacom_stylus_get_axes;
libwacom_stylus_get_eraser_type;
libwacom_stylus_get_for_id;
libwacom_stylus_get_id;
libwacom_stylus_get_name;
libwacom_stylus_get_num_buttons;
libwacom_stylus_get_paired_ids;
libwacom_stylus_get_type;
libwacom_stylus_has_eraser;
libwacom_stylus_has_lens;
libwacom_stylus_has_wheel;
libwacom_stylus_is_eraser;
libwacom_update_match;

local:
*;
};

LIBWACOM_1.4 {
global:
libwacom_stylus_get_eraser_type;
libwacom_stylus_get_paired_ids;
} LIBWACOM_0.33;
23 changes: 3 additions & 20 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ pymod = import('python')
python = pymod.find_installation('python3', required: true)

# Do not modify this, use symbol versioning instead.
libwacom_lt_c=8
libwacom_lt_r=1
libwacom_lt_a=6
libwacom_lt_c=9
libwacom_lt_r=0
libwacom_lt_a=0
# convert ltversion to soname
libwacom_so_version = '@0@.@1@.@2@'.format((libwacom_lt_c - libwacom_lt_a),
libwacom_lt_a, libwacom_lt_r)
Expand Down Expand Up @@ -71,7 +71,6 @@ src_libwacom = [
'libwacom/libwacom.c',
'libwacom/libwacom-error.c',
'libwacom/libwacom-database.c',
'libwacom/libwacom-deprecated.c',
]

deps_libwacom = [
Expand Down Expand Up @@ -286,22 +285,6 @@ if get_option('tests').enabled()
message('valgrind not found, disabling valgrind test suite')
endif

# because of the tricks we use in calling the function and exposing
# it to begin with, LTO gets confused and this fails to link.
# Let's just disable it here.
if not get_option('b_lto')
test_deprecated = executable('test-deprecated',
'test/test-deprecated.c',
dependencies: [dep_libwacom, dep_dl],
include_directories: [includes_src],
c_args: tests_cflags,
install: false)
test('test-deprecated',
test_deprecated,
env:['LD_LIBRARY_PATH=@0@'.format(meson.build_root())],
suite: ['all'])
endif

pymod.find_installation(modules: ['libevdev', 'pyudev', 'pytest'])
pytest = find_program('pytest-3', 'pytest')
test('pytest',
Expand Down
1 change: 0 additions & 1 deletion test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ noinst_PROGRAMS= \
test-tablet-validity \
test-stylus-validity \
test-ltversion \
test-deprecated \
$(NULL)

TESTS=$(noinst_PROGRAMS)
Expand Down
6 changes: 3 additions & 3 deletions test/test-ltversion.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ int main(void) {
/* we don't change the soname anymore, we use symbol maps instead.
So these can stay fixed until we properly break the ABI and bump
the soname. */
assert(C == 8);
assert(R == 1);
assert(A == 6);
assert(C == 9);
assert(R == 0);
assert(A == 0);

return 0;
}

0 comments on commit b4f3c3f

Please sign in to comment.