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 74FA9E500A3; Fri, 13 Dec 2024 17:46:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 74FA9E500A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1734101211; bh=YjU1HGVQiMLQoWrvgKr8PzdOGfXKu2VfFLUXGRpeQDI=; 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=kiZXXQJwT2tq/WJrboL7sfSTJpUV7+oYq+0PZ8N8S2FRG/lrQN52H416HLElkjhK/ 3IPOKUv87ZED9PDjHh56giXFPCnaNAPxj9h3TB9DWkcj8ZD90HQ6+gwNZQcL22ziBy kSbzAnm8nBQZ3Mr/w+oP7rA0ejusQYA3003Sd9U8= Received: from send103.i.mail.ru (send103.i.mail.ru [89.221.237.198]) (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 E687E46049D for ; Fri, 13 Dec 2024 17:46:50 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E687E46049D Received: by exim-smtp-76d484c77c-gd74g with esmtpa (envelope-from ) id 1tM6wL-00000000O1L-3ked; Fri, 13 Dec 2024 17:46:50 +0300 Date: Fri, 13 Dec 2024 17:45:52 +0300 To: Sergey Bronnikov Message-ID: References: <20241213125929.22051-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD977EAE61095F37AC56C46B4EF361F6502CB7EDB8F7424247E182A05F5380850403C35BD90ECD632BD3DE06ABAFEAF670585DC3FCC1C5D3CFBB88812279EC04AD6400F39C12E319FF0 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE72E2D36A15E1833D8EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006377548186386978BE68638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D826CBBB3449B102A962A47C51280BF074E105F36BE3A045F0CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F3E38EE449E3E2AE389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8D2DCF9CF1F528DBCF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BDCE939D40DBB93CA75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A51109D5EEDD58AFD45002B1117B3ED69696CD07ADAF71566D0E58516B1639A14B823CB91A9FED034534781492E4B8EEAD5E90D3DD2A5B7EAFBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFAA3BEFA71F561D982569DB43F3DCADCF25D6EEC602A0DDA613241282B7A50F5020A397324AFDE1B88E708AA2021A9CC2CEB8FEFA06AD0D84CFA80FC2854AC00F7C0620F28BC30D1C5F4332CA8FE04980913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojQCcRYJ72L2RXDSjWnf5RjQ== X-DA7885C5: BB5B59D8B1879819F255D290C0D534F9A58DA9C2830D2F2675A3A30039713403FDD3777D6BE9DD0C5B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F739381B31377CF4CA2198A434D733EA863040E17B565FF88748D9C4B822A5A8C6D48E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [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" Hi, Sergey! Thanks for your comments! Fixed them and force-pushed the branch. On 13.12.24, Sergey Bronnikov wrote: > Hello again, Sergey, > > thanks for the patch! > > LGTM with minor comments, see below > > On 13.12.2024 15:59, Sergey Kaplun wrote: > > Since Alpine uses musl [1] as its C standard library, the build for it > s/musl/Musl/ > > 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 Replaced typo: s/GLibC/glibc/. > > distro is "alpine". > > > > [1]:https://wiki.alpinelinux.org/wiki/Musl > > [2]:https://www.linux.org/docs/man5/os-release.html > > There is also a documentation about os-release on Freedesktop [1]. > > I would add this link as well. Feel free to ignore. Added, thanks! > > > [1]: https://www.freedesktop.org/software/systemd/man/latest/os-release.html The new commit message is the following: | cmake: fix build for Alpine | | 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 | [2][3] 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 | [3]: https://www.freedesktop.org/software/systemd/man/latest/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. > > > > +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") > > + GetLinuxDistro(LINUX_DISTRO) > > + # Alpine uses musl instead of GLibC. > > s/musl/Musl/ I've used as a reference (don't be confused by the links themselfs) [1][2], looks like it should be "musl", after all. [1]: https://wiki.alpinelinux.org/wiki/Musl [2]: https://en.wikipedia.org/wiki/Musl > > s/GLibC/glibc/ or s/GLibC/GNU C Library/, see [2]. Replaced with glibc. =================================================================== diff --git a/test/LuaJIT-tests/CMakeLists.txt b/test/LuaJIT-tests/CMakeLists.txt index adc630f0..c1dbde35 100644 --- a/test/LuaJIT-tests/CMakeLists.txt +++ b/test/LuaJIT-tests/CMakeLists.txt @@ -64,7 +64,7 @@ endif() if(CMAKE_SYSTEM_NAME STREQUAL "Linux") GetLinuxDistro(LINUX_DISTRO) - # Alpine uses musl instead of GLibC. + # Alpine uses musl instead of glibc. if(NOT LINUX_DISTRO MATCHES "alpine") GetLibCVersion(LIBC_VERSION) # XXX: uses `strtod()`, old versions of =================================================================== > > [2]: https://www.gnu.org/software/libc/ > > > + 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. Seehttps://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) > > Fallback to /usr/lib/os-release as suggested in doc: > > > Applications should check for the former, and exclusively use its > data if it exists, and only fall back to /usr/lib/os-release if it is > missing. Added the fallback: =================================================================== diff --git a/test/cmake/GetLinuxDistro.cmake b/test/cmake/GetLinuxDistro.cmake index 027368be..2636019c 100644 --- a/test/cmake/GetLinuxDistro.cmake +++ b/test/cmake/GetLinuxDistro.cmake @@ -5,13 +5,18 @@ 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) + set(OS_RELEASE_FILE /etc/os-release) + if(NOT EXISTS ${OS_RELEASE_FILE}) + set(OS_RELEASE_FILE /usr/lib/os-release) + endif() + file(READ ${OS_RELEASE_FILE} 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_FILE) unset(OS_RELEASE) unset(MATCH) unset(CMAKE_MATCH_1) =================================================================== > > > + 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() -- Best regards, Sergey Kaplun