diff --git a/Makefile-libostree.am b/Makefile-libostree.am index 7f2e2a4a..3c2b6237 100644 --- a/Makefile-libostree.am +++ b/Makefile-libostree.am @@ -155,24 +155,24 @@ libostree_1_la_SOURCES += \ $(NULL) endif +symbol_files = $(top_srcdir)/src/libostree/libostree-released.sym \ + $(top_srcdir)/src/libostree/libostree-devel.sym +if ENABLE_EXPERIMENTAL_API +symbol_files += $(top_srcdir)/src/libostree/libostree-experimental.sym +endif +# http://blog.jgc.org/2007/06/escaping-comma-and-space-in-gnu-make.html +wl_versionscript_arg = -Wl,--version-script= +EXTRA_DIST += $(symbol_files) + + libostree_1_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/bsdiff -I$(srcdir)/libglnx -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(builddir)/src/libostree \ $(OT_INTERNAL_GIO_UNIX_CFLAGS) $(OT_INTERNAL_GPGME_CFLAGS) $(OT_DEP_LZMA_CFLAGS) $(OT_DEP_ZLIB_CFLAGS) $(OT_DEP_OPENSSL_CFLAGS) \ -fvisibility=hidden '-D_OSTREE_PUBLIC=__attribute__((visibility("default"))) extern' -libostree_1_la_LDFLAGS = -version-number 1:0:0 -Bsymbolic-functions -Wl,--version-script=$(top_srcdir)/src/libostree/libostree.sym +libostree_1_la_LDFLAGS = -version-number 1:0:0 -Bsymbolic-functions $(addprefix $(wl_versionscript_arg),$(symbol_files)) libostree_1_la_LIBADD = libotutil.la libglnx.la libbsdiff.la libostree-kernel-args.la $(OT_INTERNAL_GIO_UNIX_LIBS) $(OT_INTERNAL_GPGME_LIBS) \ $(OT_DEP_LZMA_LIBS) $(OT_DEP_ZLIB_LIBS) $(OT_DEP_OPENSSL_LIBS) libostree_1_la_LIBADD += $(bupsplitpath) -EXTRA_libostree_1_la_DEPENDENCIES = $(top_srcdir)/src/libostree/libostree.sym - -EXTRA_DIST += \ - src/libostree/libostree.sym \ - src/libostree/libostree-experimental.sym \ - $(NULL) - -if ENABLE_EXPERIMENTAL_API -libostree_1_la_LDFLAGS += -Wl,--version-script=$(top_srcdir)/src/libostree/libostree-experimental.sym -EXTRA_libostree_1_la_DEPENDENCIES += $(top_srcdir)/src/libostree/libostree-experimental.sym -endif +EXTRA_libostree_1_la_DEPENDENCIES = $(symbol_files) if USE_LIBARCHIVE libostree_1_la_CFLAGS += $(OT_DEP_LIBARCHIVE_CFLAGS) diff --git a/configure.ac b/configure.ac index 0efe6530..cf8a01b8 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,7 @@ AC_PREREQ([2.63]) -dnl If incrementing the version here, remember to update libostree.sym too +dnl If doing a final release, remember to follow the instructions to +dnl update libostree-released.sym from libostree-devel.sym, and update the checksum +dnl in test-symbols.sh m4_define([year_version], [2017]) m4_define([release_version], [7]) m4_define([package_version], [year_version.release_version]) diff --git a/src/libostree/libostree-devel.sym b/src/libostree/libostree-devel.sym new file mode 100644 index 00000000..6616432b --- /dev/null +++ b/src/libostree/libostree-devel.sym @@ -0,0 +1,35 @@ +/* DEVEL symbol file - add new symbols here + Copyright (C) 2016 Colin Walters + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +***/ + +/* Add new symbols here. Release commits should copy this section into -released.sym. */ +LIBOSTREE_2017.7 { +global: + ostree_sysroot_repo; + ostree_sysroot_query_deployments_for; +} LIBOSTREE_2017.6; + +/* Stub section for the stable release *after* this development one; don't + * edit this other than to update the last number. This is just a copy/paste + * source. Replace $LASTSTABLE with the last stable version, and $NEWVERSION + * with whatever the next version with new symbols will be. +LIBOSTREE_2017.$NEWVERSION { +global: + someostree_symbol_deleteme; +} LIBOSTREE_2017.$LASTSTABLE; +*/ diff --git a/src/libostree/libostree.sym b/src/libostree/libostree-released.sym similarity index 95% rename from src/libostree/libostree.sym rename to src/libostree/libostree-released.sym index b307548d..b201dcab 100644 --- a/src/libostree/libostree.sym +++ b/src/libostree/libostree-released.sym @@ -1,4 +1,6 @@ -/*** +/* Released symbol file: DO NOT EDIT except in release commits! + Edit libostree-devel.sym instead. + Copyright (C) 2016 Colin Walters This library is free software; you can redistribute it and/or @@ -17,6 +19,9 @@ Boston, MA 02111-1307, USA. ***/ +/* DO NOT EDIT this file - use libostree-devel.sym instead. Release + * commits will move symbols from libostree-devel.sym to libostree-released.sym. + */ /* Retroactively make all of these symbols 2016.3, which is @@ -396,24 +401,3 @@ global: ostree_async_progress_get_variant; ostree_async_progress_set_variant; } LIBOSTREE_2017.4; - -/* NOTE NOTE NOTE - * Versions above here are released. Only add symbols below this line. - * NOTE NOTE NOTE - */ - -LIBOSTREE_2017.7 { -global: - ostree_sysroot_repo; - ostree_sysroot_query_deployments_for; -} LIBOSTREE_2017.6; - -/* Stub section for the stable release *after* this development one; don't - * edit this other than to update the last number. This is just a copy/paste - * source. Replace $LASTSTABLE with the last stable version, and $NEWVERSION - * with whatever the next version with new symbols will be. -LIBOSTREE_2017.$NEWVERSION { -global: - someostree_symbol_deleteme; -} LIBOSTREE_2017.$LASTSTABLE; -*/ diff --git a/tests/test-symbols.sh b/tests/test-symbols.sh index 54f469fb..9018e6f3 100755 --- a/tests/test-symbols.sh +++ b/tests/test-symbols.sh @@ -17,10 +17,12 @@ # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. -set -euo pipefail +set -xeuo pipefail -echo '1..2' +echo '1..3' +released_syms=${G_TEST_SRCDIR}/src/libostree/libostree-released.sym +devel_syms=${G_TEST_SRCDIR}/src/libostree/libostree-devel.sym if echo "$OSTREE_FEATURES" | grep --quiet --no-messages "experimental"; then experimental_sym="${G_TEST_SRCDIR}/src/libostree/libostree-experimental.sym" experimental_sections="${G_TEST_SRCDIR}/apidoc/ostree-experimental-sections.txt" @@ -30,7 +32,7 @@ else fi echo "Verifying all expected symbols are actually exported..." -grep --no-filename ' ostree_[A-Za-z0-9_]*;' ${G_TEST_SRCDIR}/src/libostree/libostree.sym $experimental_sym | sed -e 's,^ *\([A-Za-z0-9_]*\);,\1,' | sort -u > expected-symbols.txt +grep --no-filename ' ostree_[A-Za-z0-9_]*;' ${released_syms} ${devel_syms} ${experimental_sym} | sed -e 's,^ *\([A-Za-z0-9_]*\);,\1,' | sort -u > expected-symbols.txt eu-readelf -a ${G_TEST_BUILDDIR}/.libs/libostree-1.so | grep 'FUNC.*GLOBAL.*DEFAULT.*@@LIBOSTREE_' | sed -e 's,^.* \(ostree_[A-Za-z0-9_]*\)@@LIBOSTREE_[0-9A-Z_.]*,\1,' |sort -u > found-symbols.txt diff -u expected-symbols.txt found-symbols.txt echo "ok exports" @@ -43,3 +45,11 @@ grep --no-filename '^ostree_' ${G_TEST_SRCDIR}/apidoc/ostree-sections.txt $exper diff -u expected-documented.txt found-documented.txt echo 'ok documented symbols' + +# ONLY update this checksum in release commits! +cat > released-sha256.txt <