[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: library dependency information in status output (here: lz4)

From: James McCoy <jamessan_at_jamessan.com>
Date: Tue, 19 Dec 2017 23:49:23 -0500

On Tue, Dec 19, 2017 at 04:46:18PM +0100, Andreas Stieger wrote:
> > checking for lz4 library via pkg-config... yes
> >
> > and build says:
> >
> > subversion/libsvn_subr/compress_lz4.c:30:5: warning: "SVN_INTERNAL_LZ4"
>
> That is actually a side-effect of r1818662. Earlier versions of lz4
> distributed a pkg-conf file with a Version relating to their svn
> revision.

The headers still had the LZ4_VERSION_* defines, though. After r131,
lz4 upstream made everything use a consisten versioning scheme and
jumped to 1.7.3. That's also when the LZ4_VERSION_STRING define and the
corresponding function were added.

> Your 131 is obviously not continuous with the later 1.7.5. I
> have not traced back which version is actually the minimum. Using
> LZ4_versionString() really does bump it to 1.7.5. I am not sure if
> this is desired? I have no particular issue with that.

LZ4_versionNumber() has existed since r120, so we could use that and the
individual LZ4_VERSION_* defines instead. Something like the below.

If that looks good, I'll revert r1818662, since we won't need
LZ4_versionString() anymore, and commit.

[[[
Index: subversion/include/private/svn_subr_private.h
===================================================================
--- subversion/include/private/svn_subr_private.h (revision 1818733)
+++ subversion/include/private/svn_subr_private.h (working copy)
@@ -742,7 +742,7 @@
 const char *svn_lz4__compiled_version(void);
 
 /* Return the lz4 version we run against. */
-const char *svn_lz4__runtime_version(void);
+int svn_lz4__runtime_version(void);
 
 #ifdef __cplusplus
 }
Index: subversion/libsvn_subr/compress_lz4.c
===================================================================
--- subversion/libsvn_subr/compress_lz4.c (revision 1818733)
+++ subversion/libsvn_subr/compress_lz4.c (working copy)
@@ -130,13 +130,21 @@
 const char *
 svn_lz4__compiled_version(void)
 {
- static const char lz4_version_str[] = LZ4_VERSION_STRING;
+#define SVN_QUOTE(x) #x
+#define SVN_EXPAND(x) SVN_QUOTE(x)
+#define SVN_VERSTR(x) SVN_EXPAND(LZ4_VERSION_ ## x)
+ static const char lz4_version_str[] = SVN_VERSTR(MAJOR) "." \
+ SVN_VERSTR(MINOR) "." \
+ SVN_VERSTR(RELEASE);
+#undef SVN_QUOTE
+#undef SVN_EXPAND
+#undef SVN_VERSTR
 
   return lz4_version_str;
 }
 
-const char *
+int
 svn_lz4__runtime_version(void)
 {
- return LZ4_versionString();
+ return LZ4_versionNumber();
 }
Index: subversion/libsvn_subr/sysinfo.c
===================================================================
--- subversion/libsvn_subr/sysinfo.c (revision 1818733)
+++ subversion/libsvn_subr/sysinfo.c (working copy)
@@ -170,8 +170,13 @@
   lib = &APR_ARRAY_PUSH(array, svn_version_ext_linked_lib_t);
   lib->name = "LZ4";
   lib->compiled_version = apr_pstrdup(pool, svn_lz4__compiled_version());
- lib->runtime_version = apr_pstrdup(pool, svn_lz4__runtime_version());
 
+ int lz4_version = svn_lz4__runtime_version();
+ lib->runtime_version = apr_psprintf(pool, "%d.%d.%d",
+ lz4_version / 100 / 100,
+ (lz4_version / 100) % 100,
+ lz4_version % 100);
+
   return array;
 }
 
]]]

-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB
Received on 2017-12-20 05:49:33 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.