From: Sergey Bronnikov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Igor Munkin <imun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit 15/15] test: run flake8 static analysis via CMake
Date: Mon, 7 Aug 2023 16:48:11 +0300 [thread overview]
Message-ID: <03560736-8f1a-de8f-f5f6-61d17d4688fe@tarantool.org> (raw)
In-Reply-To: <ZNDg8dEGubw9Lra9@tarantool.org>
Igor,
On 8/7/23 15:17, Igor Munkin wrote:
<snipped>
>>> + 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()
>
> ================================================================================
>
next prev parent reply other threads:[~2023-08-07 13:48 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-03 7:30 [Tarantool-patches] [PATCH luajit 00/15] Add flake8 linter Igor Munkin via Tarantool-patches
2023-08-03 7:30 ` [Tarantool-patches] [PATCH luajit 01/15] test: fix E122 errors by pycodestyle Igor Munkin via Tarantool-patches
2023-08-03 14:25 ` Sergey Bronnikov via Tarantool-patches
2023-08-03 15:49 ` Maxim Kokryashkin via Tarantool-patches
2023-08-03 7:30 ` [Tarantool-patches] [PATCH luajit 02/15] test: fix E128 " Igor Munkin via Tarantool-patches
2023-08-03 14:26 ` Sergey Bronnikov via Tarantool-patches
2023-08-03 15:52 ` Maxim Kokryashkin via Tarantool-patches
2023-08-03 7:30 ` [Tarantool-patches] [PATCH luajit 03/15] test: fix E201 and E202 " Igor Munkin via Tarantool-patches
2023-08-03 14:26 ` Sergey Bronnikov via Tarantool-patches
2023-08-03 15:53 ` Maxim Kokryashkin via Tarantool-patches
2023-08-03 7:30 ` [Tarantool-patches] [PATCH luajit 04/15] test: fix E203 " Igor Munkin via Tarantool-patches
2023-08-03 14:26 ` Sergey Bronnikov via Tarantool-patches
2023-08-03 15:55 ` Maxim Kokryashkin via Tarantool-patches
2023-08-03 7:30 ` [Tarantool-patches] [PATCH luajit 05/15] test: fix E231 " Igor Munkin via Tarantool-patches
2023-08-03 14:26 ` Sergey Bronnikov via Tarantool-patches
2023-08-03 15:55 ` Maxim Kokryashkin via Tarantool-patches
2023-08-03 7:30 ` [Tarantool-patches] [PATCH luajit 06/15] test: fix E251 " Igor Munkin via Tarantool-patches
2023-08-03 14:27 ` Sergey Bronnikov via Tarantool-patches
2023-08-03 15:58 ` Maxim Kokryashkin via Tarantool-patches
2023-08-03 7:30 ` [Tarantool-patches] [PATCH luajit 07/15] test: fix E301 " Igor Munkin via Tarantool-patches
2023-08-03 14:28 ` Sergey Bronnikov via Tarantool-patches
2023-08-03 16:01 ` Maxim Kokryashkin via Tarantool-patches
2023-08-03 7:30 ` [Tarantool-patches] [PATCH luajit 08/15] test: fix E302 " Igor Munkin via Tarantool-patches
2023-08-03 14:28 ` Sergey Bronnikov via Tarantool-patches
2023-08-03 16:02 ` Maxim Kokryashkin via Tarantool-patches
2023-08-03 7:30 ` [Tarantool-patches] [PATCH luajit 09/15] test: fix E303 " Igor Munkin via Tarantool-patches
2023-08-03 14:28 ` Sergey Bronnikov via Tarantool-patches
2023-08-03 16:03 ` Maxim Kokryashkin via Tarantool-patches
2023-08-03 7:30 ` [Tarantool-patches] [PATCH luajit 10/15] test: fix E305 " Igor Munkin via Tarantool-patches
2023-08-03 14:28 ` Sergey Bronnikov via Tarantool-patches
2023-08-03 16:05 ` Maxim Kokryashkin via Tarantool-patches
2023-08-03 7:30 ` [Tarantool-patches] [PATCH luajit 11/15] test: fix E502 " Igor Munkin via Tarantool-patches
2023-08-03 14:29 ` Sergey Bronnikov via Tarantool-patches
2023-08-03 16:06 ` Maxim Kokryashkin via Tarantool-patches
2023-08-03 7:30 ` [Tarantool-patches] [PATCH luajit 12/15] test: fix E711 " Igor Munkin via Tarantool-patches
2023-08-03 14:29 ` Sergey Bronnikov via Tarantool-patches
2023-08-03 16:06 ` Maxim Kokryashkin via Tarantool-patches
2023-08-03 7:30 ` [Tarantool-patches] [PATCH luajit 13/15] test: fix E722 " Igor Munkin via Tarantool-patches
2023-08-03 14:29 ` Sergey Bronnikov via Tarantool-patches
2023-08-03 16:10 ` Maxim Kokryashkin via Tarantool-patches
2023-08-03 7:30 ` [Tarantool-patches] [PATCH luajit 14/15] test: fix E741 " Igor Munkin via Tarantool-patches
2023-08-03 14:34 ` Sergey Bronnikov via Tarantool-patches
2023-08-07 11:00 ` Igor Munkin via Tarantool-patches
2023-08-07 13:45 ` Sergey Bronnikov via Tarantool-patches
2023-08-03 16:15 ` Maxim Kokryashkin via Tarantool-patches
2023-08-07 10:57 ` Igor Munkin via Tarantool-patches
2023-08-13 20:25 ` Maxim Kokryashkin via Tarantool-patches
2023-08-03 7:30 ` [Tarantool-patches] [PATCH luajit 15/15] test: run flake8 static analysis via CMake Igor Munkin via Tarantool-patches
2023-08-03 14:23 ` Sergey Bronnikov via Tarantool-patches
2023-08-03 14:25 ` Sergey Bronnikov via Tarantool-patches
2023-08-07 13:35 ` Igor Munkin via Tarantool-patches
2023-08-07 13:41 ` [Tarantool-patches] [PATCH luajit 16/15] gdb: fix Python <assert> statement usage Igor Munkin via Tarantool-patches
2023-08-08 8:26 ` Sergey Bronnikov via Tarantool-patches
2023-08-13 20:24 ` Maxim Kokryashkin via Tarantool-patches
2023-08-07 13:41 ` [Tarantool-patches] [PATCH luajit 17/15] test: fix E275 errors by pycodestyle Igor Munkin via Tarantool-patches
2023-08-08 8:26 ` Sergey Bronnikov via Tarantool-patches
2023-08-13 19:25 ` Maxim Kokryashkin via Tarantool-patches
2023-08-08 8:18 ` [Tarantool-patches] [PATCH luajit 15/15] test: run flake8 static analysis via CMake Sergey Bronnikov via Tarantool-patches
2023-08-07 12:17 ` Igor Munkin via Tarantool-patches
2023-08-07 13:48 ` Sergey Bronnikov via Tarantool-patches [this message]
2023-08-03 21:02 ` Maxim Kokryashkin via Tarantool-patches
2023-08-08 19:29 ` Igor Munkin via Tarantool-patches
2023-08-08 19:42 ` [Tarantool-patches] [PATCH luajit 18/15] test: suppress E131 errors by pycodestyle Igor Munkin via Tarantool-patches
2023-08-13 13:52 ` Maxim Kokryashkin via Tarantool-patches
2023-08-08 19:42 ` [Tarantool-patches] [PATCH luajit 19/15] test: fix E501 " Igor Munkin via Tarantool-patches
2023-08-13 13:55 ` Maxim Kokryashkin via Tarantool-patches
2023-08-14 7:28 ` [Tarantool-patches] [PATCH luajit 15/15] test: run flake8 static analysis via CMake Maxim Kokryashkin via Tarantool-patches
2023-08-21 11:05 ` [Tarantool-patches] [PATCH luajit 00/15] Add flake8 linter Igor Munkin via Tarantool-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=03560736-8f1a-de8f-f5f6-61d17d4688fe@tarantool.org \
--to=tarantool-patches@dev.tarantool.org \
--cc=imun@tarantool.org \
--cc=sergeyb@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH luajit 15/15] test: run flake8 static analysis via CMake' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox