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 C7E3DE7FAEC; Fri, 13 Dec 2024 16:00:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C7E3DE7FAEC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1734094832; bh=IRtkd+LuROmQJG/cqk6huzQFu9zfRD5SFjRSOD/lVxM=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=XJR9kGl/DH/qvLNDbF0PQ2CKwOz6G/6O+KYUbrsxV+c707j8/fabEev2bodN6RPsZ ZGOIuS8ybSIayxJVK88elXYdyR1hJkC6ybtFAow7oQozx/sHsZW/iehxHhz27O9vzJ XbixR5F57YYOR+bIP9VYn+3yr1A4614dmLlTYsKY= Received: from send83.i.mail.ru (send83.i.mail.ru [89.221.237.178]) (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 7E450E7FAE7 for ; Fri, 13 Dec 2024 16:00:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7E450E7FAE7 Received: by exim-smtp-bf6fb4755-kdv8w with esmtpa (envelope-from ) id 1tM5HO-00000000PPw-0ws1; Fri, 13 Dec 2024 16:00:26 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Fri, 13 Dec 2024 15:59:29 +0300 Message-ID: <20241213125929.22051-1-skaplun@tarantool.org> X-Mailer: git-send-email 2.47.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD911C40A3FA7A65883AF9C0D1700C8E95EBE4CA8779969ECD3182A05F538085040F089E7A4DDA746BB3DE06ABAFEAF67058A9E0B35A5E10CB3E01BDA35A9C8DF0AC4241D229770A8A5 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE737BB76880A4CA9A4EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637968EC5F77C2942FE8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8B5337EA830C39C5AFF1FAD4E4F69A8D565F29A87D8540058CC7F00164DA146DAFE8445B8C89999728AA50765F79006370D9A29B7FD16D1239FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C353FA85A707D24CADCC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB86D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE7E1BCFB2C0BE3F189731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A5F3187F43662745B05002B1117B3ED6963672D4961C49F502F09842853758E9E5823CB91A9FED034534781492E4B8EEAD078C6A30171164F2C79554A2A72441328621D336A7BC284946AD531847A6065A535571D14F44ED41 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF77DD89D51EBB7742D3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFDC852A132A1ABB67DDDA16B8084C8BF026230C545C79DAEDC17017C74961AB829C8755E3AEA661EF8E708AA2021A9CC2605BEED5CF9199A9C7330FDC825EA20A343E1A5566F04626C226CC413062362A913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojgFHDrhqZ0P+ttKWUSTsLIQ== X-DA7885C5: 04D6625E089CF0C2F255D290C0D534F9F62B320EB254228D60D5174F76920E2D60B66630AECC786A5B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F739381B31377CF4CA2192EDBFD787A0A0061B094F0E86471E26E3A1866579040C534E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit] cmake: fix build for Alpine 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 Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Since Alpine uses musl [1] as its C standard library, the build for it failed after the commit af0f59da76292f30ff75be1ab01458d47b226995 ("test: fix LuaJIT-tests for old libc version"), since `GetLibCVersion()` raises an error. This patch adds the check of the ID in the /etc/os-release [2] of the Linux distribution and avoids setting the GLibC version if the distro is "alpine". [1]: https://wiki.alpinelinux.org/wiki/Musl [2]: https://www.linux.org/docs/man5/os-release.html --- Branch: https://github.com/tarantool/luajit/tree/skaplun/gh-noticket-fix-alpine-build PR for tests on master: https://github.com/tarantool/tarantool/pull/10824 Side note: build locally in Docker for test for Alpine. test/CMakeLists.txt | 1 + test/LuaJIT-tests/CMakeLists.txt | 18 +++++++++++------- test/cmake/GetLinuxDistro.cmake | 18 ++++++++++++++++++ 3 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 test/cmake/GetLinuxDistro.cmake diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index be02d2e4..86de9ed1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -74,6 +74,7 @@ separate_arguments(LUAJIT_TEST_COMMAND) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(AddTestLib) include(GetLibCVersion) +include(GetLinuxDistro) include(LibRealPath) # CTEST_FLAGS is used by CMake targets in test suites. diff --git a/test/LuaJIT-tests/CMakeLists.txt b/test/LuaJIT-tests/CMakeLists.txt index 0df3f4ea..adc630f0 100644 --- a/test/LuaJIT-tests/CMakeLists.txt +++ b/test/LuaJIT-tests/CMakeLists.txt @@ -62,13 +62,17 @@ if(CMAKE_C_FLAGS MATCHES "-march=skylake-avx512") list(APPEND LUAJIT_TEST_TAGS_EXTRA +avx512) endif() -if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") - GetLibCVersion(LIBC_VERSION) - # XXX: uses `strtod()`, old versions of - # which have the bug [1] for "0x1p-2075" parsing. Add the skip - # check for it. - # [1]: https://sourceware.org/bugzilla/show_bug.cgi?id=16151 - list(APPEND LUAJIT_TEST_TAGS_EXTRA +libc=${LIBC_VERSION}) +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + GetLinuxDistro(LINUX_DISTRO) + # Alpine uses musl instead of GLibC. + if(NOT LINUX_DISTRO MATCHES "alpine") + GetLibCVersion(LIBC_VERSION) + # XXX: uses `strtod()`, old versions of + # which have the bug [1] for "0x1p-2075" parsing. Add the skip + # check for it. + # [1]: https://sourceware.org/bugzilla/show_bug.cgi?id=16151 + list(APPEND LUAJIT_TEST_TAGS_EXTRA +libc=${LIBC_VERSION}) + endif() endif() if(LUAJIT_ENABLE_TABLE_BUMP) diff --git a/test/cmake/GetLinuxDistro.cmake b/test/cmake/GetLinuxDistro.cmake new file mode 100644 index 00000000..027368be --- /dev/null +++ b/test/cmake/GetLinuxDistro.cmake @@ -0,0 +1,18 @@ +# Determine the Linux distro id and return it in the `output` +# variable. See https://www.linux.org/docs/man5/os-release.html +# for details. +macro(GetLinuxDistro output) + if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") + message(FATAL_ERROR "GetLinuxDistro macro must be used only on Linux") + endif() + file(READ /etc/os-release OS_RELEASE) + string(REGEX MATCH "ID=([0-9a-z._-]+)" MATCH ${OS_RELEASE}) + if(MATCH) + set(${output} ${CMAKE_MATCH_1}) + else() + set(${output} linux) + endif() + unset(OS_RELEASE) + unset(MATCH) + unset(CMAKE_MATCH_1) +endmacro() -- 2.47.0