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 C88955802D5; Mon, 7 Aug 2023 16:48:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C88955802D5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1691416093; bh=KwpUp/SjZ45/bwXvqQ2s9J/2p7V74hy+uY2FoX0nxwI=; 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=yZdz9XfsBF7h1loRHPz+gJpSS1DzG3kRjq5yoHzXin7lVpLBF55rzuiBPBKFuoZas vaWWq+OEwfhqX79hYpLrVxboS+HPFp/VsMGBi5VE4bRUdeM5y4ZhAW+owJihRKKT98 CvEuiUfHpxA/yYWfelApa5P+R9goTxargmekyFq8= 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 2C7E45802D5 for ; Mon, 7 Aug 2023 16:48:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2C7E45802D5 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1qT0ah-0006bX-DA; Mon, 07 Aug 2023 16:48:11 +0300 Message-ID: <03560736-8f1a-de8f-f5f6-61d17d4688fe@tarantool.org> Date: Mon, 7 Aug 2023 16:48:11 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: Igor Munkin References: <2f20f91c-1336-b34b-6681-3947e96b486d@tarantool.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD969E04B5EED670DC86EE92E42F0C271DDDF6A6B73F41FC074182A05F538085040D607E9A57B5865FEE1EF8E3952B8AEEDC8B59C180F56DD835312EE60EB7FADDF X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7E50C24D7D7C3118AC2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE73C696014E2DCCA1EEA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BE5CCB53A13BC8DBACDAB4D3E016C1BC3D3326830A64DB6DFCC7F00164DA146DAFE8445B8C89999728AA50765F7900637BA939FD1B3BAB99B389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8D56D36E97F3F038CF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F79006378A4BC95AACA28A5322CA9DD8327EE4930A3850AC1BE2E735D2457FAF19517CF2C4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A57CF123B45B9F3113D8C76D77C396AD13C6369F121ABE294BF87CCE6106E1FC07E67D4AC08A07B9B0D2AC72D04CD5349BCB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFA2DC98FE0C85EC1C9806850796239D245EC20B8CCEA6134F954CB44CD89A8B2CA0D894938C2B729C1529AA6C8ABD04CA3B123D17F79A5BF8C93FBAD0B886F67BE48CAC7CA610320002C26D483E81D6BE0DBAE6F56676BC7117BB6831D7356A2DEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj/xSHLV4ZQPs1TOrfO92APw== X-DA7885C5: 08DFF7E699C2C5704F762DD6C728FE01791A6232B52FCF63BF46E53922127748262E2D401490A4A0DB037EFA58388B346E8BC1A9835FDE71 X-Mailru-Sender: 689FA8AB762F73930F533AC2B33E986B69B32C4F68DCA7B2B9E0BB94F4DC947EDD788429FD8613638ED9BB8B05EE7B3AFB559BB5D741EB96D19CD4E7312BAA970A04DAD6CC59E3365FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 15/15] test: run flake8 static analysis via CMake 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" Igor, On 8/7/23 15:17, Igor Munkin wrote: >>> + set(FLAKE8_RC ${FLAKE8_SOURCE_DIR}/.flake8rc) >>> + file(GLOB_RECURSE FLAKE8_DEPS ${FLAKE8_SOURCE_DIR}/*.py) >>> + add_custom_target(${PROJECT_NAME}-flake8 >>> + DEPENDS ${FLAKE8_DEPS} >>> + ) >>> + add_custom_command(TARGET ${PROJECT_NAME}-flake8 >>> + COMMENT "Running flake8 static analysis" >>> + COMMAND >>> + ${FLAKE8} ${FLAKE8_DEPS} >>> + --config ${FLAKE8_RC} >>> + --jobs ${CMAKE_BUILD_PARALLEL_LEVEL} >>> + WORKING_DIRECTORY ${FLAKE8_SOURCE_DIR} >>> + ) >>> +else() >>> + add_custom_target(${PROJECT_NAME}-flake8) >>> + add_custom_command(TARGET ${PROJECT_NAME}-flake8 >>> + COMMENT "`flake8' is not found, so ${PROJECT_NAME}-flake8 target is dummy" >> Please add a command to a dummy target: >> >> |COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --red "||`flake8' is not >> found, so ${PROJECT_NAME}-flake8 target is dummy" with added COMMAND target >> will print a message | > Well, 0 days since "CMake is doing something unexpected". COMMENT is > totally fine, the problem is in Ninja generated artefacts: I'm not an > expert in Ninja but looks like CMake generates kinda nop if COMMAND is > omitted. Here is the dump: > > | $ cmake --version > | cmake version 3.26.4 > | > | CMake suite maintained and supported by Kitware (kitware.com/cmake). > | $ rm -f CMakeCache.txt > | $ cmake . -G Ninja > | -- The C compiler identification is GNU 13.2.0 > | -- Detecting C compiler ABI info > | -- Detecting C compiler ABI info - done > | -- Check for working C compiler: /usr/bin/cc - skipped > | -- Detecting C compile features > | -- Detecting C compile features - done > | -- [SetVersion] Reading version from VCS: v2.1.0-beta3-355-g6dd0b0e2 > | -- [SetBuildParallelLevel] CMAKE_BUILD_PARALLEL_LEVEL is 4 > | -- The ASM compiler identification is GNU > | -- Found assembler: /usr/bin/cc > | -- Configuring done (0.3s) > | -- Generating done (0.0s) > | -- Build files have been written to: /home/imun/projects/tarantool-luajit > | $ cmake --build . --target LuaJIT-flake8 > | ninja: no work to do. > | $ rm -f CMakeCache.txt > | $ cmake . > | -- The C compiler identification is GNU 13.2.0 > | -- Detecting C compiler ABI info > | -- Detecting C compiler ABI info - done > | -- Check for working C compiler: /usr/bin/cc - skipped > | -- Detecting C compile features > | -- Detecting C compile features - done > | -- [SetVersion] Reading version from VCS: v2.1.0-beta3-355-g6dd0b0e2 > | -- [SetBuildParallelLevel] CMAKE_BUILD_PARALLEL_LEVEL is 4 > | -- The ASM compiler identification is GNU > | -- Found assembler: /usr/bin/cc > | -- Configuring done (0.3s) > | -- Generating done (0.1s) > | -- Build files have been written to: /home/imun/projects/tarantool-luajit > | $ cmake --build . --target LuaJIT-flake8 > | `flake8' is not found, so LuaJIT-flake8 target is dummy > | Built target LuaJIT-flake8 > > Hence, I suggest to leave everything as is (see luacheck-related part), > but in scope of the CTest series implement another way of interaction > with user. Does it work for you? Actually it doesn't work for me even with Ninja generator. However, I don't want to block this patch due to this. LGTM > >>> + ) >>> +endif() >>> + >>> +add_custom_target(${PROJECT_NAME}-lint DEPENDS >>> + ${PROJECT_NAME}-luacheck >>> + ${PROJECT_NAME}-flake8 >>> +) >>> + >>> set(LUAJIT_TEST_COMMAND "${LUAJIT_TEST_BINARY} -e dofile[[${LUAJIT_TEST_INIT}]]") >>> separate_arguments(LUAJIT_TEST_COMMAND) >> You've introduced a new target LuaJIT-lint, that includes LuaJIT-luacheck >> and LuaJIT-flake8. >> >> I suppose we need replace dependence "LuaJIT-luacheck" to "LuaJIT-lint" for >> a target "test". > Oops, my bad, thanks! Fixed. > > ================================================================================ > > diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt > index 17ac5cac..58cba5ba 100644 > --- a/test/CMakeLists.txt > +++ b/test/CMakeLists.txt > @@ -102,6 +102,6 @@ if(LUAJIT_USE_TEST) > > add_custom_target(test DEPENDS > ${PROJECT_NAME}-test > - ${PROJECT_NAME}-luacheck > + ${PROJECT_NAME}-lint > ) > endif() > > ================================================================================ >