From: Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Bronnikov <sergeyb@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2 luajit 2/2] test: fix LuaJIT-tests for old libc version
Date: Mon, 9 Dec 2024 17:40:57 +0300 [thread overview]
Message-ID: <Z1cBeV8UrteAl1xG@root> (raw)
In-Reply-To: <9763bdee-230a-4a09-95bd-15333ef1b3d6@tarantool.org>
Hi, Sergey!
Thanks for the review!
On 09.12.24, Sergey Bronnikov wrote:
> Hi, Sergey!
>
> thanks for the patch!
>
> LGTM after fix a comment below
Fixed the comment with a slightly modified patch of yours:
===================================================================
diff --git a/test/cmake/GetLibCVersion.cmake b/test/cmake/GetLibCVersion.cmake
index d87e8b70..521a6e45 100644
--- a/test/cmake/GetLibCVersion.cmake
+++ b/test/cmake/GetLibCVersion.cmake
@@ -1,8 +1,12 @@
# Get the libc version installed in the system.
macro(GetLibCVersion output)
+ find_program(ECHO echo)
+ if(NOT ECHO)
+ message(FATAL_ERROR "`echo' is not found")
+ endif()
# Try to directly parse the version.
execute_process(
- COMMAND echo "#include <gnu/libc-version.h>"
+ COMMAND ${ECHO} "#include <gnu/libc-version.h>"
COMMAND ${CMAKE_C_COMPILER} -E -dM -
OUTPUT_VARIABLE LIB_C_INFO
ERROR_VARIABLE ERROR_MSG
@@ -31,6 +35,7 @@ macro(GetLibCVersion output)
set(${output} "${GLIBC_MAJOR}.${GLIBC_MINOR}")
+ unset(ECHO)
unset(CMAKE_MATCH_1)
unset(GLIBC_MAJOR)
unset(GLIBC_MINOR)
===================================================================
Force-pushed the branch and updated the PR.
>
> On 09.12.2024 13:16, Sergey Kaplun wrote:
> > The `strtod parsing` subtest in the <lib/base/tonumber_scan.lua> checks
> > the results yielded by the `strtod()` via FFI call. In GLibc versions
> > before 2.19 it returns an incorrect result for "0x1p-2075" [1]. This
> > patch skips this test for a smaller version of the libc installed.
> >
> > [1]:https://sourceware.org/bugzilla/show_bug.cgi?id=16151
> > ---
<snipped>
> > diff --git a/test/cmake/GetLibCVersion.cmake b/test/cmake/GetLibCVersion.cmake
> > new file mode 100644
> > index 00000000..d87e8b70
> > --- /dev/null
> > +++ b/test/cmake/GetLibCVersion.cmake
> > @@ -0,0 +1,41 @@
> > +# Get the libc version installed in the system.
> > +macro(GetLibCVersion output)
> > + # Try to directly parse the version.
> > + execute_process(
> > + COMMAND echo "#include <gnu/libc-version.h>"
>
> I propose to replace "echo" with a variable set by `find_program()`:
>
>
> diff --git a/test/cmake/GetLibCVersion.cmake
> b/test/cmake/GetLibCVersion.cmake
> index d87e8b70..15a8b440 100644
> --- a/test/cmake/GetLibCVersion.cmake
> +++ b/test/cmake/GetLibCVersion.cmake
> @@ -1,8 +1,14 @@
> # Get the libc version installed in the system.
> macro(GetLibCVersion output)
> + find_program(ECHO echo)
> + if(NOT ECHO)
> + message(FATAL_ERROR "`echo` is not found'")
> + return()
> + endif()
> +
> # Try to directly parse the version.
> execute_process(
> - COMMAND echo "#include <gnu/libc-version.h>"
> + COMMAND ${ECHO} "#include <gnu/libc-version.h>"
> COMMAND ${CMAKE_C_COMPILER} -E -dM -
> OUTPUT_VARIABLE LIB_C_INFO
> ERROR_VARIABLE ERROR_MSG
> @@ -31,6 +37,7 @@ macro(GetLibCVersion output)
>
> set(${output} "${GLIBC_MAJOR}.${GLIBC_MINOR}")
>
> + unset(ECHO)
> unset(CMAKE_MATCH_1)
> unset(GLIBC_MAJOR)
> unset(GLIBC_MINOR)
>
> > + COMMAND ${CMAKE_C_COMPILER} -E -dM -
> > + OUTPUT_VARIABLE LIB_C_INFO
> > + ERROR_VARIABLE ERROR_MSG
> > + OUTPUT_STRIP_TRAILING_WHITESPACE
> > + RESULT_VARIABLE RES
> > + )
> > +
<snipped>
> > +endmacro()
--
Best regards,
Sergey Kaplun
next prev parent reply other threads:[~2024-12-09 14:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-09 10:16 [Tarantool-patches] [PATCH v2 luajit 0/2] Fix LuaJIT tests for old libc versions Sergey Kaplun via Tarantool-patches
2024-12-09 10:16 ` [Tarantool-patches] [PATCH v2 luajit 1/2] test: support number value of tag in LuaJIT-tests Sergey Kaplun via Tarantool-patches
2024-12-09 11:12 ` Sergey Bronnikov via Tarantool-patches
2024-12-09 10:16 ` [Tarantool-patches] [PATCH v2 luajit 2/2] test: fix LuaJIT-tests for old libc version Sergey Kaplun via Tarantool-patches
2024-12-09 11:17 ` Sergey Bronnikov via Tarantool-patches
2024-12-09 14:40 ` Sergey Kaplun via Tarantool-patches [this message]
2024-12-10 7:37 ` Sergey Bronnikov via Tarantool-patches
2024-12-17 12:30 ` [Tarantool-patches] [PATCH v2 luajit 0/2] Fix LuaJIT tests for old libc versions Sergey Kaplun via Tarantool-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z1cBeV8UrteAl1xG@root \
--to=tarantool-patches@dev.tarantool.org \
--cc=sergeyb@tarantool.org \
--cc=skaplun@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH v2 luajit 2/2] test: fix LuaJIT-tests for old libc version' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox