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 46A2B6F153; Thu, 1 Sep 2022 13:18:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 46A2B6F153 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1662027539; bh=l/HW8pFNkn+48zXfKxeCT6pCE/A6MSdZCk8VoLl8pVQ=; 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=jLV2pmI1BcIP9RuQweM3vZPWzhttuZeINrmPIjqMTZvXtpW4ILpkoRKSgaQuh7BVz 7lMLUuWsQ4L+ErzQ4CR7PvIUedJjrJBYOd/SfQARkZQ5UPJUeH6aT5583T3u2jlvUM H1+PhW/aZRNhH3czw5oMFeo4wnojru0pHOvthgAI= Received: from smtpng3.i.mail.ru (smtpng3.i.mail.ru [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id C95CF6F153 for ; Thu, 1 Sep 2022 13:18:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C95CF6F153 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1oThHl-0001SI-0D; Thu, 01 Sep 2022 13:18:57 +0300 Date: Thu, 1 Sep 2022 13:16:19 +0300 To: Igor Munkin Message-ID: References: <1d05bbecc9c9ae57250ec563e202a8e103f86fa4.1660216002.git.imun@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: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD9D8E1125CB37184E1C7694BA8CA54B48E14788A9DC669AB301867C24CE74E72BB5FE18E9CBFBE7C078291C47D1BAFF37AB8F595C7E30AEB1F70E0747545AA7292CEE4813122F9A0DF X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7C6068CE86C2B75F5EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AD4B8DECD34330378638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D858FC2C1B19156E710FE4B65522057A3A117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAA867293B0326636D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8B3733B5EC72352B9FA471835C12D1D977C4224003CC8364762BB6847A3DEAEFB0F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7C5C8BF3F796D5A11743847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 9604B64F49C60606AD91A466A1DEF99B296C473AB1E142185AC9E3593CE4B31AB1881A6453793CE9274300E5CE05BD4401A9E91200F654B01A22A53B1D49F786523897933F9F83872D0210AB7065F39F3B0968F950B8D14F9C2B6934AE262D3EE7EAB7254005DCED8DA55E71E02F9FC08E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3467D08F30473A5842C88ED2282F93E3FDDF5252ECFC6A93ED7961B8299EA7EA616933E928C559FEDA1D7E09C32AA3244CA1186BF7C025056921FEC5220CEA21BF725D5B54B2FE4575FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojCtRLoEB0IE2R8xZ8xvIcZw== X-DA7885C5: FFBEAE8FE220A6D0286F27119454DC1877E1E47C56F7F25581F8E664D14623BE262E2D401490A4A0DB037EFA58388B346E8BC1A9835FDE71 X-Mailru-Sender: 689FA8AB762F7393CC2E0F076E87284E6E1A4C11095C1BA745E1AD1D83F0D0160FBE9A32752B8C9C2AA642CC12EC09F1FB559BB5D741EB962F61BD320559CF1EFD657A8799238ED55FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 2/8] test: introduce MakeLuaPath.cmake helper 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, Igor! Thanks for the fixes! On 31.08.22, Igor Munkin wrote: > Sergey, > > Thanks for your review! > > On 18.08.22, Sergey Kaplun wrote: > > > +# XXX: Mind the reverse order of the entries in the result string. > > > > Why do we need this behaviour? May be it is better to save strict order > > of entries? > > The code will become more complex as a result and in the 99.999% of the > cases the order of LUA_PATH entries doesn't bother you. But it bothers me for the lua-Harness tests already. We get the following snippet from <303-package.t>: | f = io.open('syntax.lua', 'w') | f:write [[?syntax error?]] | f:close() | local r, e = pcall(require, 'syntax') | error_matches(function () require('syntax') end, | "^error loading module 'syntax' from file '%.[/\\]syntax%.lua':", | "function require (syntax error)") As we can see `error_matches()` expects "file './syntax.lua'" string from the output, but if "./.?lua" path isn't the first one, this test will fail due to the whole path in the output. > So I don't see > we should make the code more complex to save the order of the entries. As far as I don't usually read from bottom to top (except mcode encoding) it is more convenient to me to use strict order. Also, as for me the following patch (feel free to modify it as you want) doesn't make the code too complex: =================================================================== diff --git a/cmake/MakeLuaPath.cmake b/cmake/MakeLuaPath.cmake index 9a5a3bb8..f92bdb19 100644 --- a/cmake/MakeLuaPath.cmake +++ b/cmake/MakeLuaPath.cmake @@ -28,19 +28,23 @@ function(make_lua_path path) "${multiValues}" ${ARGN}) - # XXX: This is the sentinel semicolon having special meaning - # for LUA_PATH and LUA_CPATH variables. For more info, see the - # link below: - # https://www.lua.org/manual/5.1/manual.html#pdf-LUA_PATH - set(result "\;") - foreach(inc ${ARG_PATHS}) # XXX: If one joins two strings with semicolon, the value # automatically becomes a list. I found a single working # solution to make result variable be a string via "escaping" # the semicolon right in string interpolation. - set(result "${inc}\;${result}") + if(result) + set(result "${result}\;${inc}") + else() + set(result "${inc}") + endif() endforeach() + # XXX: This is the sentinel semicolon having special meaning + # for LUA_PATH and LUA_CPATH variables. For more info, see the + # link below: + # https://www.lua.org/manual/5.1/manual.html#pdf-LUA_PATH + set(result "${result}\;\;") + set(${path} "${result}" PARENT_SCOPE) endfunction() =================================================================== > > > > > > + > > > +function(make_lua_path path) > > > > -- > > Best regards, > > Sergey Kaplun > > -- > Best regards, > IM -- Best regards, Sergey Kaplun