branch: master commit 1fc54e815f85213f4daafb4806b077d3c98a7cfa Author: Ileana Dumitrescu <ileanadumitresc...@gmail.com> AuthorDate: Tue Jan 28 16:23:54 2025 +0200
ltmain.in: Increase revision limit to 19 digits Current, age, and revision values for a library seem to have been chosen arbitrarily, which is limiting users to a 5 digit maximum. Now, users can set revision to at most 19 digits, which is referencing Unix epoch time in nanoseconds. Reported: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75880 * build-aux/ltmain.in: Update revision check to allow up to 19 digits. * tests/versioning.at: Add more version checks to test. * NEWS: Update. --- NEWS | 3 +++ build-aux/ltmain.in | 28 ++++++++++------------------ tests/versioning.at | 4 ++-- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/NEWS b/NEWS index 2412efff..71ee0ef9 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,9 @@ NEWS - list of user-visible changes between releases of GNU Libtool - Add tagging for Objective-C and Objective-C++, OBJC and OBJCXX. + - Increase 5 digit limit on revision value for libraries to 19 digits, + which is referencing Unix epoch time in nanoseconds. + ** Bug fixes: - Fix wrongly deduplicated compiler dependencies on linux. diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index caec9db2..c59459d0 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -7177,29 +7177,21 @@ func_mode_link () esac # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "CURRENT '$current' must be a nonnegative integer" + if echo "$current" | $EGREP -v '(^0$)|(^[1-9]$)|(^[1-9][0-9]{1,4}$)' > /dev/null; then + func_error "CURRENT '$current' must be a nonnegative integer and <= 5 digits" func_fatal_error "'$vinfo' is not valid version information" - ;; - esac + fi - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "REVISION '$revision' must be a nonnegative integer" + # Currently limiting revision length by Unix epoch time in nanoseconds. + if echo "$revision" | $EGREP -v '(^0$)|(^[1-9]$)|(^[1-9][0-9]{1,18}$)' > /dev/null; then + func_error "REVISION '$revision' must be a nonnegative integer and <= 19 digits" func_fatal_error "'$vinfo' is not valid version information" - ;; - esac + fi - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "AGE '$age' must be a nonnegative integer" + if echo "$age" | $EGREP -v '(^0$)|(^[1-9]$)|(^[1-9][0-9]{1,4}$)' > /dev/null; then + func_error "AGE '$age' must be a nonnegative integer and <= 5 digits" func_fatal_error "'$vinfo' is not valid version information" - ;; - esac + fi if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" diff --git a/tests/versioning.at b/tests/versioning.at index 902b0f7d..0725cef2 100644 --- a/tests/versioning.at +++ b/tests/versioning.at @@ -120,7 +120,7 @@ done # and large ones. # TODO: check something like 1001:2419:189 after fixing issues # for 'version_type's of 'irix', 'nonstopux', or 'osf'. -for version_info in 1 1:2 0:0:0 1:1:1 13:241:7; do +for version_info in 1 1:2 0:0:0 1:1:1 13:241:7 55555:1234567890123456789:55555; do AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o liba.la liba1.lo ]dnl [-version-info $version_info -rpath $libdir], [], [ignore], [ignore]) done @@ -131,7 +131,7 @@ AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o liba.la liba1.lo ]dnl AT_CHECK([$GREP 'AGE.*is greater than' stderr], [], [ignore]) # Hypothesis: we diagnose invalid values. -for version_info in 1:2:3:4 -1 0:-1 0:0:-1; do +for version_info in 1:2:3:4 -1 0:-1 0:0:-1 666666:1:1 1:1:666666 0:12345678901234567890:0; do AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o liba.la liba1.lo ]dnl [-version-info $version_info -rpath $libdir], [1], [ignore], [ignore]) done