-
Notifications
You must be signed in to change notification settings - Fork 429
libtidy.so.5 has removed symbols between 5.2.0 and 5.6.0, but kept SONAME #743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Since the issue is apparently being ignored here, I am just announcing that the package in Debian will bump the SONAME to |
Specifically, this is wrong:
The |
This issue is being tracked and discussed downstream in Debian right here: https://bugs.debian.org/911130 |
@oerdnj, @hosiet, all, sorry for the delay... I was hoping a unix person, with more understanding of unix shared libraries, and their .so version, would pick this up... As suggested, the so called missing Since its beginning As you may know, the MS Windows compiler/linker handles this So maybe someone with unix understanding should/could do something similar for a Given this explanation, is it really necessary to bump the Anyway, look forward to more feedback... |
@geoffmcl Unfortunately, yes, it is needed to bump to I am not well accustomed with |
While the developer in me agrees with you, the package maintainer screams in horror :) |
Deprecating a function is easy, but removing it would be really costly and you have to bump the SONAME when doing removal to prevent any and every user from encountering missing symbols (missing functions) when using a newer version of library (of the same SONAME. So the workflow is clear: feel free to deprecate a function, but whenever you remove one (or change API / break ABI), bump the SONAME immediately. |
(BTW: remove function --> soname bump only applies to exported public symbols (functions). If you believe all changes are made on private functions (prvTidy...) then it is not necessary. But you removed tidyAttrIs[name], tidyAttrGet[name], and tidyNodeIs[element] from v5.2 to v5.6 so the soname has to be bumped this time anyway.) |
@oerdnj Would bumping the SONAME to libtidy.so.5.6 be an option? I'm afraid that libtidy.so.6 might cause issues, if there'll ever be an libtidy 6. |
In fact SONAME can only be an (rising) integer, from 0 to 1, 2, 3, ... On Unix-like systems, the programs that are looking for dynamic libraries will only search for something like So your proposal is not valid :-/ It's really okay to make the project version and SONAME different and there's already countless examples all around. |
@hosiet Thanks for the explanation! |
That’s not entirely true, the Debian now has libtidy.so.5deb1 to make room for upstream to use 6 as next. Nevertheless the library soname has to be decoupled from source version. There’s no reason to keep them same. |
@hosiet WOW, I am not really the person to be discussing this... The process of creating a It also seem quite normal for the diff --git a/CMakeLists.txt b/CMakeLists.txt
index 631f0fd..227e1ea 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -405,12 +405,15 @@ if (BUILD_SHARED_LIB)
if (UNIX AND APPLE)
set(CMAKE_MACOSX_RPATH 1)
endif ()
+ if (NOT TIDY_SO_VERSION)
+ set(TIDY_SO_VERSION ${TIDY_MAJOR_VERSION})
+ endif ()
add_library ( ${name} SHARED ${CFILES} ${HFILES} ${LIBHFILES} )
set_target_properties( ${name} PROPERTIES
OUTPUT_NAME ${LIB_NAME} )
set_target_properties( ${name} PROPERTIES
VERSION ${LIBTIDY_VERSION}
- SOVERSION ${TIDY_MAJOR_VERSION} )
+ SOVERSION ${TIDY_SO_VERSION} )
set_target_properties( ${name} PROPERTIES
COMPILE_FLAGS "-DBUILD_SHARED_LIB" )
set_target_properties( ${name} PROPERTIES
diff --git a/build/cmake/build-me.sh b/build/cmake/build-me.sh
index 61bdbdd..a3d7317 100755
--- a/build/cmake/build-me.sh
+++ b/build/cmake/build-me.sh
@@ -35,8 +35,9 @@ TMPOPTS=""
##############################################
### ***** NOTE THIS INSTALL LOCATION ***** ###
### Change to suit your taste, environment ###
-TMPINST="/usr"
+TMPINST="$HOME/projects/html_tidy"
TMPOPTS="$TMPOPTS -DCMAKE_INSTALL_PREFIX=$TMPINST"
+TMPOPTS="$TMPOPTS -DTIDY_SO_VERSION=6"
##############################################
### Accept user argument This makes it user settable, but is that what we want... some distributions deciding to, and some more carefully weighing this up, and leaving it as we chose, the default Used this would result in an install as follows, perhaps a little confusing to some -
Unfortunately, I do not feel it is the time to bump the What do others think? I need more feedback... thanks... But this does not yet address the |
What if #752 / #754 is included :) If you need to bump the version to 6 maybe that's enough of an excuse? It'd be nice if the debian people could take a look at that PR and comment. The interesting bit starts here
|
@ler762 Would any of these affect libtidy? Anyhow, since tidy 5.6.0 had removed some exported symbols, it's already too late to push to 6.0.0. @geoffmcl See how the export stuff is done in libgd, which might give some ideas for libtidy. |
@ler762, as @cmb69 points out, changes to console tidy.c sample code have nothing to do with @cmb69 thanks for the Like the import library, in Windows, of the |
@geoffmcl Ping me in two weeks (5. November) and I might have some time during next IETF, and I'll prepare MR for this. |
@geoffmcl I'm sorry if I came across as trying to hijack the thread. I was responding to your comment about
with a justification for bumping the version. ... assuming that if you release a new console version of tidy you'd also be releasing a new libtidy version even if nothing in libtidy has changed. As for
I'm probably missing something, but it looks like debian libtidy is still on 5.2.0
|
@ler762 This page is more informative: https://tracker.debian.org/pkg/tidy-html5 |
@tehnick thanks for the link. In the News section it has So it looks like the decision to go with 5.6.0 is less than 3 weeks old. If a new version of tidy is released in the next few weeks can that be changed or is debian set on going with 5.6.0 regardless? |
If you are wondering Debian's decision on next stable release: it really depends on to which extent the next tidy-html5 release would break its API. Well, at least we Debian developers can cherry-pick commits that are important enough from git trunk. |
@oerdnj and @hosiet are official maintainers of I am just a side observer here. I found this issue only due to current library transition for package
This is note about uploading package to Debian experimental branch. Probably you do not know, but this is something like a "play ground" in Debian. In this branch package maintainers may decide to break any parts of packages for testing and debugging purpose. The most critical part of Debian maintainers work is uploading of packages into Debian unstable branch. Ideally on this step there are no new issues should happen during upgrade of end-user system. (Many people use Debian unstable branch as a "true" rolling release even nowdays.) So when you are looking at debian/changelog pay more attention to timestamps in blocks with uploads to Debian unstable. Uploads to Debian experimental may be interesting as well, but they are not so important... |
In more details it is described here: (Just in case if you are curious about it.) |
@tehnick Thanks for all the background info - I appreciate it! And yes
for anything related to administration is most likely true for me. @hosiet Yes, I am wondering if picking tidy 5.6.0 for unstable now means that version is locked in for the next year or three. |
That's related to workflow in Debian. Basically it's like this:
So the sooner a new version of libtidy is released, the more likely it would be included in next Debian release. Of course if the API of new libtidy broke too much we may as well decide not to include it for now (since great breakage will break downstream software). Anyway it depends. |
@hosiet thanks for the info! I'm guessing that any more questions I have for this will be pretty much off-topic for tidy. After I read a lot more, follow up questions would best be submitted where? |
I'm not sure what kind of questions would emerge, but there are some pointers:
|
@oerdnj, @hosiet, @ler762, @cmb69, et al... 20210410: Experimentation with trying to First, in general support bumping the SO number to 6, so this is not about that... and decoupling the SO number from the major version number... all ok... But to avoid that in future when only First try, with a simple, but failed - diff --git a/src/forward.h b/src/forward.h
index 7f59371..5ce01d3 100644
--- a/src/forward.h
+++ b/src/forward.h
@@ -19,7 +19,11 @@
#include "tidy.h"
/* Internal symbols are prefixed to avoid clashes with other libraries */
+#ifdef _WIN32
#define TYDYAPPEND(str1,str2) str1##str2
+#else
+#define TYDYAPPEND(str1,str2) __attribute__((__visibility__("hidden"))) str1##str2
+#endif
#define TY_(str) TYDYAPPEND(prvTidy,str)
struct _StreamIn; BUT it FAILED! Many, many warnings, errors - Ugh Another try, with - harder, but just many files to modify - diff --git a/src/forward.h b/src/forward.h
index 7f59371..4ce8ca5 100644
--- a/src/forward.h
+++ b/src/forward.h
@@ -22,6 +22,13 @@
#define TYDYAPPEND(str1,str2) str1##str2
#define TY_(str) TYDYAPPEND(prvTidy,str)
+/* Internal symbols are prefixed with 'hidden' attr, to avoid exporting */
+#ifdef _WIN32
+#define TY_PRIVATE
+#else
+#define TY_PRIVATE __attribute__((__visibility__("hidden")))
+#endif
+
struct _StreamIn;
typedef struct _StreamIn StreamIn; Then adding This reduced the original over 1000 This was at a cost of modifying some 24 files, adding some 370+ 20210412: pushed Using The current The current There are however 12 that do not commence with the usual
The remaining 10 (2 + 8), are just anomolies in the There are some 138 of the form One(1) is marked with a ' D ', by The remaining 137 of the form So far, my experiments using But, this Look forward to further feedback, comments, patches, etc, etc... to solve the outstanding 137 items... thanks... |
Seem to have solved, and pushed, the fix for the last 137... Trick was to keep the Appreciated if others could checkout this |
@oerdnj, it looks like I can take this an run with it. I'm sorry that this issue has been hanging around for so many years; I've not had a lot of opportunity to be able to step in an help @geoffmcl, who is very much a Windows person. I get along on Linux just fine, but package management is a black art to me, so bear with me. It looks like @geoffmcl has gone to some pains to hide some internal private symbols that escaped into the ABI somehow. If this goes live, then I understand we need to bump the SONAME; is that correct? Aside from being an integer and increasing, are there any other restrictions to the SONAME? HTML Tidy is using a modified version of semantic versioning, so if the SONAME is flexible enough, I think it would be quite easy to manage. Because 5.6.0 is the current, stable, officially-released version, it's the only one that we guarantee API/ABI stability for. If we patch it to 5.6.1, we guarantee full compatibility. This, can we publish this as We guarantee this stability for every minor release. There will never be a 5.7.x stable release; when we're ready, we will release our master, stable as This means that our Does this seem like a workable approach? If so, I'll merge @geoffmcl's changes to hide the symbols, and prepare a new, stable 5.8 release with a SONAME of 58. Also pinging @hosiet, @ler762, @cmb69, who were also participating in this thread. |
When (exported) symbols are removed from the library it's important for library to bump the SONAME for programs not to break. This hasn't happened and it needs to be done.
I would rather bump the version in a coordinated manner than do that only in Debian.
Excerpts:
Also if
prvTidy
means private symbols, you need to use symbol visibility. If the symbol is out there (e.g. exported) it doesn't matter what name you pick: https://gcc.gnu.org/wiki/Visibility (the page says C++, but it should be used for C). In your case it would be easier to use LD Version Script: https://www.gnu.org/software/gnulib/manual/html_node/LD-Version-Scripts.htmlThe text was updated successfully, but these errors were encountered: