From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 71FF2E2080A; Tue, 10 Dec 2024 10:37:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 71FF2E2080A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1733816244; bh=aULzUO5AgrRx61NZ8ZU0CJ+el9/rK98uJ1HruDaU7cs=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Zs4hVgTx311/LyUALPXUwXTc3f7ZOSHFT5FAp/C950Du/7DYGZRrlvWcysY88Kz/A Ydz0Zwf4pYJCPeEcrLaorLo9fP8eJrkFc0qMv47A5Ie51d7bVPYPkEYBz/2qCL00Cf vKQtKxCaI8kjEEoLZPyKyndtUW/SK560sHrNLmeE= Received: from send126.i.mail.ru (send126.i.mail.ru [89.221.237.221]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 6B872E2080A for ; Tue, 10 Dec 2024 10:37:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6B872E2080A Received: by exim-smtp-fb95f984f-gggzq with esmtpa (envelope-from ) id 1tKuo5-00000000Ap4-1fLY; Tue, 10 Dec 2024 10:37:21 +0300 Content-Type: multipart/alternative; boundary="------------bipdTQU1o9cBJJysQ4XmG4mL" Message-ID: <1459189d-0f10-41c7-aebd-6989e7f65acb@tarantool.org> Date: Tue, 10 Dec 2024 10:37:20 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Sergey Kaplun References: <616560a5fc0131d0f6c5358cebbc267025444334.1733739230.git.skaplun@tarantool.org> <9763bdee-230a-4a09-95bd-15333ef1b3d6@tarantool.org> Content-Language: en-US In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9008082F162C50007667EBA1F8A10172219AA070D8945B426182A05F538085040B40DB47A057F78FF3DE06ABAFEAF6705CDD3712FD00B80F883779A4B3CF5996271713673A8881951 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7F2393C4755A27B53EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006379B0255B5E5688AF88638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D85E087EC374477C895A0B4A56C4D2AAE952E13888F778C1BACC7F00164DA146DAFE8445B8C89999728AA50765F79006375FFD5C25497261569FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C34964A708C60C975A117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CFD22EEC73CD09A32ABA3038C0950A5D36C8A9BA7A39EFB766D91E3A1F190DE8FDBA3038C0950A5D36D5E8D9A59859A8B63271950E746CB25C76E601842F6C81A1F004C906525384303E02D724532EE2C3F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7C089C7B220955F2D643847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A51781C37BA6594E9F5002B1117B3ED696021DF3D9B6B0915DCCE9A60C8CB01D7C823CB91A9FED034534781492E4B8EEADB1D70E2111C441FFBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF506CD5AC216FFB3BFC432BA72FBE2BF2E2FC388527FFDEEC185B3049B6BD916CACCA692FBCDC96C25C69F0120C2109DF90E289A778486FC3CECBC06753F4CB888F8AF4BD4DC38CB95F4332CA8FE04980913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojwdtfQel0s3ksQQDMFE6gKA== X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F2588458018681EBBEAD0B3CAC4385294E02B5FBA768B59E013D5881B2E6CBC00E44093A645D15D82EE4B272BD6E4642A116CA93524AA66B5ACBE6721EF430B9A63E2A504198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 2/2] test: fix LuaJIT-tests for old libc version X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------bipdTQU1o9cBJJysQ4XmG4mL Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, Sergey! thanks for fixes! LGTM On 09.12.2024 17:40, Sergey Kaplun wrote: > 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 " > + COMMAND ${ECHO} "#include " > 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 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 >>> --- > > >>> 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 " >> 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 " >> +    COMMAND ${ECHO} "#include " >>      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 >>> + ) >>> + > > >>> +endmacro() --------------bipdTQU1o9cBJJysQ4XmG4mL Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi, Sergey!

thanks for fixes! LGTM

On 09.12.2024 17:40, Sergey Kaplun wrote:
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()

    
--------------bipdTQU1o9cBJJysQ4XmG4mL--