Browse Source

change to libapt-pkg abi 5.0 with versioned symbols

We changed an aweful lot of stuff, so 5.0 is properly better than 4.X as
a semantic version and as we are at it lets add some trivial symbol
versioning as well: We just mark all exported symbols with the same
version for now. This isn't really the proper thing to do as if we add
symbols in later versions (with the same abi) they will get the same
symbols version, but our .symbols file will protect us from the problems
arising from this as it will ensure that a package acutally depends on a
version of the abi high enough to include the symbol.
David Kalnischkies 8 years ago
parent
commit
ae97af1fdf

+ 2 - 2
apt-pkg/contrib/macros.h

@@ -159,8 +159,8 @@
 // reverse-dependencies of libapt-pkg against the new SONAME.
 // Non-ABI-Breaks should only increase RELEASE number.
 // See also buildlib/libversion.mak
-#define APT_PKG_MAJOR 4
-#define APT_PKG_MINOR 15
+#define APT_PKG_MAJOR 5
+#define APT_PKG_MINOR 0
 #define APT_PKG_RELEASE 0
 #define APT_PKG_ABI ((APT_PKG_MAJOR * 100) + APT_PKG_MINOR)
 

+ 7 - 3
buildlib/library.mak

@@ -21,6 +21,7 @@ $(LOCAL)-OBJS := $(addprefix $(OBJ)/,$(addsuffix .opic,$(notdir $(basename $(SOU
 $(LOCAL)-DEP := $(addprefix $(DEP)/,$(addsuffix .opic.d,$(notdir $(basename $(SOURCE)))))
 $(LOCAL)-HEADERS := $(addprefix $(INCLUDE)/,$(HEADERS))
 $(LOCAL)-SONAME := lib$(LIBRARY).so.$(MAJOR)
+$(LOCAL)-VERSIONSCRIPT := $(LIB)/lib$(LIBRARY)-$(MAJOR)-$(MINOR).symver
 $(LOCAL)-SLIBS := $(SLIBS)
 $(LOCAL)-LIBRARY := $(LIBRARY)
 
@@ -39,7 +40,7 @@ MKDIRS += $(OBJ) $(DEP) $(LIB) $(dir $($(LOCAL)-HEADERS))
 # The clean rules
 .PHONY: clean/$(LOCAL) veryclean/$(LOCAL)
 clean/$(LOCAL):
-	-rm -f $($(@F)-OBJS) $($(@F)-DEP)
+	-rm -f $($(@F)-OBJS) $($(@F)-DEP) $($(@F)-VERSIONSCRIPT)
 veryclean/$(LOCAL): clean/$(LOCAL)
 	-rm -f $($(@F)-HEADERS) $(LIB)/lib$($(@F)-LIBRARY)*.so*
 
@@ -50,11 +51,14 @@ $(LIB)/lib$(LIBRARY).so.$(MAJOR): $(LIB)/lib$(LIBRARY).so.$(MAJOR).$(MINOR)
 $(LIB)/lib$(LIBRARY).so: $(LIB)/lib$(LIBRARY).so.$(MAJOR).$(MINOR)
 	ln -sf $(<F) $@
 
+$($(LOCAL)-VERSIONSCRIPT):
+	echo '$(shell echo '$(LIBRARY)' | tr -d '-' | tr 'a-z' 'A-Z')_$(MAJOR) { global: *; };' > $@
+
 # The binary build rule
-$(LIB)/lib$(LIBRARY).so.$(MAJOR).$(MINOR): $($(LOCAL)-HEADERS) $($(LOCAL)-OBJS) $(LIBRARYDEPENDS)
+$(LIB)/lib$(LIBRARY).so.$(MAJOR).$(MINOR): $($(LOCAL)-HEADERS) $($(LOCAL)-OBJS) $(LIBRARYDEPENDS) $($(LOCAL)-VERSIONSCRIPT)
 	-rm -f $(LIB)/lib$($(@F)-LIBRARY)*.so* 2> /dev/null
 	echo Building shared library $@
-	$(CXX) $(CXXFLAGS) $(LDFLAGS) $(PICFLAGS) $(LFLAGS) $(LFLAGS_SO)\
+	$(CXX) $(CXXFLAGS) $(LDFLAGS) -Wl,--version-script=$($(@F)-VERSIONSCRIPT) $(PICFLAGS) $(LFLAGS) $(LFLAGS_SO)\
 	   -o $@ $(SONAME_MAGIC)$($(@F)-SONAME) -shared \
 	   $(filter %.opic,$^) \
 	   $($(@F)-SLIBS) 

+ 68 - 66
debian/libapt-inst1.6.symbols

@@ -1,70 +1,72 @@
 libapt-inst.so.1.6 libapt-inst1.6 #MINVER#
 * Build-Depends-Package: libapt-pkg-dev
- (c++)"ExtractTar::Done(bool)@Base" 0.8.0
- (c++)"ExtractTar::Go(pkgDirStream&)@Base" 0.8.0
- (c++)"ExtractTar::StartGzip()@Base" 0.8.0
- (c++)"ExtractTar::ExtractTar(FileFd&, unsigned long long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)@Base" 1.0.5
- (c++)"ExtractTar::~ExtractTar()@Base" 0.8.0
- (c++)"debDebFile::GotoMember(char const*)@Base" 0.8.0
- (c++)"debDebFile::CheckMember(char const*)@Base" 0.8.0
- (c++)"debDebFile::ControlExtract::DoItem(pkgDirStream::Item&, int&)@Base" 0.8.0
- (c++)"debDebFile::ControlExtract::~ControlExtract()@Base" 0.8.0
- (c++)"debDebFile::ExtractTarMember(pkgDirStream&, char const*)@Base" 0.9.15.4
- (c++)"debDebFile::ExtractArchive(pkgDirStream&)@Base" 0.8.0
- (c++)"debDebFile::MemControlExtract::TakeControl(void const*, unsigned long long)@Base" 1.0.5
- (c++)"debDebFile::MemControlExtract::Read(debDebFile&)@Base" 0.8.0
- (c++)"debDebFile::MemControlExtract::DoItem(pkgDirStream::Item&, int&)@Base" 0.8.0
- (c++)"debDebFile::MemControlExtract::Process(pkgDirStream::Item&, unsigned char const*, unsigned long long, unsigned long long)@Base" 1.0.5
- (c++)"debDebFile::MemControlExtract::~MemControlExtract()@Base" 0.8.0
- (c++)"debDebFile::debDebFile(FileFd&)@Base" 0.8.0
- (c++)"pkgExtract::FinishedFile(pkgDirStream::Item&, int)@Base" 0.8.0
- (c++)"pkgExtract::CheckDirReplace(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int)@Base" 0.8.0
- (c++)"pkgExtract::HandleOverwrites(pkgFLCache::NodeIterator, bool)@Base" 0.8.0
- (c++)"pkgExtract::Fail(pkgDirStream::Item&, int)@Base" 0.8.0
- (c++)"pkgExtract::DoItem(pkgDirStream::Item&, int&)@Base" 0.8.0
- (c++)"pkgExtract::Aborted()@Base" 0.8.0
- (c++)"pkgExtract::Finished()@Base" 0.8.0
- (c++)"pkgExtract::pkgExtract(pkgFLCache&, pkgCache::VerIterator)@Base" 0.8.0
- (c++)"pkgExtract::~pkgExtract()@Base" 0.8.0
- (c++)"pkgFLCache::TreeLookup(unsigned int*, char const*, char const*, unsigned long, unsigned int*, bool)@Base" 0.8.0
- (c++)"pkgFLCache::AddConfFile(char const*, char const*, pkgFLCache::PkgIterator const&, unsigned char const*)@Base" 0.8.0
- (c++)"pkgFLCache::AddDiversion(pkgFLCache::PkgIterator const&, char const*, char const*)@Base" 0.8.0
- (c++)"pkgFLCache::BeginDiverLoad()@Base" 0.8.0
- (c++)"pkgFLCache::FinishDiverLoad()@Base" 0.8.0
- (c++)"pkgFLCache::GetPkg(char const*, char const*, bool)@Base" 0.8.0
- (c++)"pkgFLCache::Header::Header()@Base" 0.8.0
- (c++)"pkgFLCache::GetNode(char const*, char const*, unsigned int, bool, bool)@Base" 0.8.0
- (c++)"pkgFLCache::DropNode(unsigned int)@Base" 0.8.0
- (c++)"pkgFLCache::HashNode(pkgFLCache::NodeIterator const&)@Base" 0.8.0
- (c++)"pkgFLCache::PrintTree(unsigned int, unsigned long)@Base" 0.8.0
- (c++)"pkgFLCache::pkgFLCache(DynamicMMap&)@Base" 0.8.0
- (c++)"pkgDirStream::FinishedFile(pkgDirStream::Item&, int)@Base" 0.8.0
- (c++)"pkgDirStream::Fail(pkgDirStream::Item&, int)@Base" 0.8.0
- (c++)"pkgDirStream::DoItem(pkgDirStream::Item&, int&)@Base" 0.8.0
- (c++)"pkgDirStream::Process(pkgDirStream::Item&, unsigned char const*, unsigned long long, unsigned long long)@Base" 1.0.5
- (c++)"pkgDirStream::~pkgDirStream()@Base" 0.8.0
- (c++)"ARArchive::LoadHeaders()@Base" 0.8.0
- (c++)"ARArchive::ARArchive(FileFd&)@Base" 0.8.0
- (c++)"ARArchive::~ARArchive()@Base" 0.8.0
- (c++)"pkgFLCache::NodeIterator::RealPackage() const@Base" 0.8.0
- (c++)"pkgFLCache::Header::CheckSizes(pkgFLCache::Header&) const@Base" 0.8.0
- (c++)"ARArchive::FindMember(char const*) const@Base" 0.8.0
- (c++)"typeinfo for ExtractTar@Base" 0.8.0
- (c++)"typeinfo for pkgExtract@Base" 0.8.0
- (c++)"typeinfo for pkgDirStream@Base" 0.8.0
- (c++)"typeinfo for debDebFile::ControlExtract@Base" 0.8.0
- (c++)"typeinfo for debDebFile::MemControlExtract@Base" 0.8.0
- (c++)"typeinfo name for ExtractTar@Base" 0.8.0
- (c++)"typeinfo name for pkgExtract@Base" 0.8.0
- (c++)"typeinfo name for pkgDirStream@Base" 0.8.0
- (c++)"typeinfo name for debDebFile::ControlExtract@Base" 0.8.0
- (c++)"typeinfo name for debDebFile::MemControlExtract@Base" 0.8.0
- (c++)"vtable for ExtractTar@Base" 0.8.0
- (c++)"vtable for pkgExtract@Base" 0.8.0
- (c++)"vtable for pkgDirStream@Base" 0.8.0
- (c++)"vtable for debDebFile::ControlExtract@Base" 0.8.0
- (c++)"vtable for debDebFile::MemControlExtract@Base" 0.8.0
+ (c++)"ExtractTar::Done(bool)@APTINST_1.6" 0.8.0
+ (c++)"ExtractTar::Go(pkgDirStream&)@APTINST_1.6" 0.8.0
+ (c++)"ExtractTar::StartGzip()@APTINST_1.6" 0.8.0
+ (c++)"ExtractTar::ExtractTar(FileFd&, unsigned long long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)@APTINST_1.6" 1.0.5
+ (c++)"ExtractTar::~ExtractTar()@APTINST_1.6" 0.8.0
+ (c++)"debDebFile::GotoMember(char const*)@APTINST_1.6" 0.8.0
+ (c++)"debDebFile::CheckMember(char const*)@APTINST_1.6" 0.8.0
+ (c++)"debDebFile::ControlExtract::DoItem(pkgDirStream::Item&, int&)@APTINST_1.6" 0.8.0
+ (c++)"debDebFile::ControlExtract::~ControlExtract()@APTINST_1.6" 0.8.0
+ (c++)"debDebFile::ExtractTarMember(pkgDirStream&, char const*)@APTINST_1.6" 0.9.15.4
+ (c++)"debDebFile::ExtractArchive(pkgDirStream&)@APTINST_1.6" 0.8.0
+ (c++)"debDebFile::MemControlExtract::TakeControl(void const*, unsigned long long)@APTINST_1.6" 1.0.5
+ (c++)"debDebFile::MemControlExtract::Read(debDebFile&)@APTINST_1.6" 0.8.0
+ (c++)"debDebFile::MemControlExtract::DoItem(pkgDirStream::Item&, int&)@APTINST_1.6" 0.8.0
+ (c++)"debDebFile::MemControlExtract::Process(pkgDirStream::Item&, unsigned char const*, unsigned long long, unsigned long long)@APTINST_1.6" 1.0.5
+ (c++)"debDebFile::MemControlExtract::~MemControlExtract()@APTINST_1.6" 0.8.0
+ (c++)"debDebFile::debDebFile(FileFd&)@APTINST_1.6" 0.8.0
+ (c++)"pkgExtract::FinishedFile(pkgDirStream::Item&, int)@APTINST_1.6" 0.8.0
+ (c++)"pkgExtract::CheckDirReplace(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int)@APTINST_1.6" 0.8.0
+ (c++)"pkgExtract::HandleOverwrites(pkgFLCache::NodeIterator, bool)@APTINST_1.6" 0.8.0
+ (c++)"pkgExtract::Fail(pkgDirStream::Item&, int)@APTINST_1.6" 0.8.0
+ (c++)"pkgExtract::DoItem(pkgDirStream::Item&, int&)@APTINST_1.6" 0.8.0
+ (c++)"pkgExtract::Aborted()@APTINST_1.6" 0.8.0
+ (c++)"pkgExtract::Finished()@APTINST_1.6" 0.8.0
+ (c++)"pkgExtract::pkgExtract(pkgFLCache&, pkgCache::VerIterator)@APTINST_1.6" 0.8.0
+ (c++)"pkgExtract::~pkgExtract()@APTINST_1.6" 0.8.0
+ (c++)"pkgFLCache::TreeLookup(unsigned int*, char const*, char const*, unsigned long, unsigned int*, bool)@APTINST_1.6" 0.8.0
+ (c++)"pkgFLCache::AddConfFile(char const*, char const*, pkgFLCache::PkgIterator const&, unsigned char const*)@APTINST_1.6" 0.8.0
+ (c++)"pkgFLCache::AddDiversion(pkgFLCache::PkgIterator const&, char const*, char const*)@APTINST_1.6" 0.8.0
+ (c++)"pkgFLCache::BeginDiverLoad()@APTINST_1.6" 0.8.0
+ (c++)"pkgFLCache::FinishDiverLoad()@APTINST_1.6" 0.8.0
+ (c++)"pkgFLCache::GetPkg(char const*, char const*, bool)@APTINST_1.6" 0.8.0
+ (c++)"pkgFLCache::Header::Header()@APTINST_1.6" 0.8.0
+ (c++)"pkgFLCache::GetNode(char const*, char const*, unsigned int, bool, bool)@APTINST_1.6" 0.8.0
+ (c++)"pkgFLCache::DropNode(unsigned int)@APTINST_1.6" 0.8.0
+ (c++)"pkgFLCache::HashNode(pkgFLCache::NodeIterator const&)@APTINST_1.6" 0.8.0
+ (c++)"pkgFLCache::PrintTree(unsigned int, unsigned long)@APTINST_1.6" 0.8.0
+ (c++)"pkgFLCache::pkgFLCache(DynamicMMap&)@APTINST_1.6" 0.8.0
+ (c++)"pkgDirStream::FinishedFile(pkgDirStream::Item&, int)@APTINST_1.6" 0.8.0
+ (c++)"pkgDirStream::Fail(pkgDirStream::Item&, int)@APTINST_1.6" 0.8.0
+ (c++)"pkgDirStream::DoItem(pkgDirStream::Item&, int&)@APTINST_1.6" 0.8.0
+ (c++)"pkgDirStream::Process(pkgDirStream::Item&, unsigned char const*, unsigned long long, unsigned long long)@APTINST_1.6" 1.0.5
+ (c++)"pkgDirStream::~pkgDirStream()@APTINST_1.6" 0.8.0
+ (c++)"ARArchive::LoadHeaders()@APTINST_1.6" 0.8.0
+ (c++)"ARArchive::ARArchive(FileFd&)@APTINST_1.6" 0.8.0
+ (c++)"ARArchive::~ARArchive()@APTINST_1.6" 0.8.0
+ (c++)"pkgFLCache::NodeIterator::RealPackage() const@APTINST_1.6" 0.8.0
+ (c++)"pkgFLCache::Header::CheckSizes(pkgFLCache::Header&) const@APTINST_1.6" 0.8.0
+ (c++)"ARArchive::FindMember(char const*) const@APTINST_1.6" 0.8.0
+ (c++)"typeinfo for ExtractTar@APTINST_1.6" 0.8.0
+ (c++)"typeinfo for pkgExtract@APTINST_1.6" 0.8.0
+ (c++)"typeinfo for pkgDirStream@APTINST_1.6" 0.8.0
+ (c++)"typeinfo for debDebFile::ControlExtract@APTINST_1.6" 0.8.0
+ (c++)"typeinfo for debDebFile::MemControlExtract@APTINST_1.6" 0.8.0
+ (c++)"typeinfo name for ExtractTar@APTINST_1.6" 0.8.0
+ (c++)"typeinfo name for pkgExtract@APTINST_1.6" 0.8.0
+ (c++)"typeinfo name for pkgDirStream@APTINST_1.6" 0.8.0
+ (c++)"typeinfo name for debDebFile::ControlExtract@APTINST_1.6" 0.8.0
+ (c++)"typeinfo name for debDebFile::MemControlExtract@APTINST_1.6" 0.8.0
+ (c++)"vtable for ExtractTar@APTINST_1.6" 0.8.0
+ (c++)"vtable for pkgExtract@APTINST_1.6" 0.8.0
+ (c++)"vtable for pkgDirStream@APTINST_1.6" 0.8.0
+ (c++)"vtable for debDebFile::ControlExtract@APTINST_1.6" 0.8.0
+ (c++)"vtable for debDebFile::MemControlExtract@APTINST_1.6" 0.8.0
 ### gcc artefacts
- (c++|optional=std)"std::vector<APT::Configuration::Compressor, std::allocator<APT::Configuration::Compressor> >::~vector()@Base" 0.8.12
+ (c++|optional=std)"std::vector<APT::Configuration::Compressor, std::allocator<APT::Configuration::Compressor> >::~vector()@APTINST_1.6" 0.8.12
+### symbol versioning
+ APTINST_1.6@APTINST_1.6 1.1~exp9
 ### try to ignore std:: template instances
- (c++|optional=std)"std::ctype<char>::do_widen(char) const@Base" 1.0.3
+ (c++|optional=std)"std::ctype<char>::do_widen(char) const@APTINST_1.6" 1.0.3

File diff suppressed because it is too large
+ 0 - 1502
debian/libapt-pkg4.15.symbols


debian/libapt-pkg4.15.install.in → debian/libapt-pkg5.0.install.in


File diff suppressed because it is too large
+ 1503 - 0
debian/libapt-pkg5.0.symbols


+ 4 - 3
prepare-release

@@ -15,13 +15,14 @@ LIBAPTINSTVERSION="$(egrep '^MAJOR=' apt-inst/makefile |cut -d '=' -f 2)"
 
 librarysymbolsfromfile() {
 	local MISSING="$(grep '^+#MISSING' "$1")"
+	local SYMVER="$2"
 	echo '=== Missing optional symbols:'
 	echo -n "$MISSING" | grep '|optional=' || true
 	echo '=== Missing required symbols:'
 	echo -n "$MISSING" | grep -v '|optional=' || true
 	echo '=== New symbols:'
 	grep '^+ ' "$1" | cut -d' ' -f 2 | cut -d'@' -f 1 | c++filt | while read line; do
-		echo " (c++)\"${line}@Base\" $VERSION"
+		echo " (c++)\"${line}@${SYMVER}\" $VERSION"
 	done | sort -u
 }
 
@@ -109,7 +110,7 @@ elif [ "$1" = 'library' ]; then
 		echo "Checking $1 in version $2"
 		local tmpfile=$(mktemp)
 		dpkg-gensymbols -p${1}${2} -ebuild/bin/${1}.so.${2} -Idebian/${1}${2}.symbols -O/dev/null 2> /dev/null > $tmpfile || true
-		librarysymbolsfromfile "$tmpfile"
+		librarysymbolsfromfile "$tmpfile" "$(echo "${1}" | cut -c 4- | tr -d '-' | tr 'a-z' 'A-Z')_${2}"
 		rm -f $tmpfile
 	}
 	librarysymbols 'libapt-pkg' "${LIBAPTPKGVERSION}"
@@ -117,7 +118,7 @@ elif [ "$1" = 'library' ]; then
 	librarysymbols 'libapt-inst' "${LIBAPTINSTVERSION}"
 elif [ "$1" = 'buildlog' ]; then
 	while [ -n "$2" ]; do
-		librarysymbolsfromfile "$2"
+		librarysymbolsfromfile "$2" 'UNKNOWN'
 		shift
 	done
 elif [ "$1" = 'travis-ci' ]; then