This is an automated email from the ASF dual-hosted git repository.

Jens-G pushed a commit to branch release/0.24.0
in repository https://gitbox.apache.org/repos/asf/thrift.git

commit c1df044f2eb290c7e51cc99ddb547e34fdbf0430
Author: Jens Geyer <[email protected]>
AuthorDate: Sun Jul 5 11:10:25 2026 +0200

    Fix Go and Rust version detection for multi-digit version numbers
    
    The configure checks parsed the toolchain version with sed expressions that
    only matched single-digit components (e.g. [0-9].[0-9].[0-9]).  Modern
    toolchains such as go1.25.0 therefore did not match, and the raw, unparsed
    command output -- including the "go: downloading ..." toolchain line and the
    "linux/amd64" path -- was stored verbatim in golang_version / rustc_version.
    
    That value (a multi-line string containing a '/') broke AX_COMPARE_VERSION's
    internal sed and corrupted config.status, which made configure fail while
    bootstrapping the dependency-tracking makefile fragments and produced a
    malformed Makefile.
    
    Anchor both expressions to the reported version line and accept multi-digit,
    multi-component version numbers, yielding a clean value (e.g. 1.25.0 / 
1.85.1).
    
    Client: go,rs
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
---
 configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 93df96ec8..477d3cf00 100644
--- a/configure.ac
+++ b/configure.ac
@@ -388,7 +388,7 @@ if test "$with_go" = "yes";  then
       ax_go118_version="1.18"
 
       AC_MSG_CHECKING([for Go version])
-      golang_version=`$GO version 2>&1 | $SED -e 's/\(go \)\(version 
\)\(go\)\(@<:@0-9@:>@.@<:@0-9@:>@.@<:@0-9@:>@\)\(@<:@\*@:>@*\).*/\4/'`
+      golang_version=`$GO version 2>&1 | $SED -n -e 's/^go version 
go\(@<:@0-9@:>@@<:@0-9.@:>@*\).*/\1/p'`
       AC_MSG_RESULT($golang_version)
       AC_SUBST([golang_version],[$golang_version])
       AX_COMPARE_VERSION([$ax_go_version],[le],[$golang_version],[
@@ -431,7 +431,7 @@ if test "$with_rs" = "yes";  then
       min_rustc_version="1.13"
 
       AC_MSG_CHECKING([for rustc version])
-      rustc_version=`$RUSTC --version 2>&1 | $SED -e 's/\(rustc 
\)\([0-9]\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\2.\3/'`
+      rustc_version=`$RUSTC --version 2>&1 | $SED -n -e 's/^rustc 
\(@<:@0-9@:>@@<:@0-9.@:>@*\).*/\1/p'`
       AC_MSG_RESULT($rustc_version)
       AC_SUBST([rustc_version],[$rustc_version])
 

Reply via email to