Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Bronnikov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Kaplun <skaplun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [v2][PATCH 4/5] build/ninja: create file lists outside of cmake commands
Date: Wed, 15 Jun 2022 17:31:11 +0300	[thread overview]
Message-ID: <ab844365-a672-67a3-9615-186025199092@tarantool.org> (raw)
In-Reply-To: <YqmkPPF/pc85xioh@root>

Sergey, thanks for review!

On 15.06.2022 12:19, Sergey Kaplun via Tarantool-patches wrote:
> Hi, Sergey!
>
> Thanks for the patch!
>
> LGTM, except a few nits regarding the commit message.
>
> On 02.06.22, Sergey Bronnikov via Tarantool-patches wrote:
>> Patch adds a last change required for building LuaJIT with Ninja - using
> Typo: s/Patch/The patch/
Fixed, thanks.
>
>> glob inside CMake commands (add_custom_command and
>> set_source_files_properties) breaks buildng with Ninja.
> Typo: s/buildng/building/

Fixed, thanks!


>> By default CMake generates files suitable for building a project with
>> Make. However, it allows to generate files for Ninja too. Ninja [1] may
>> build project a bit faster than Make, see comparison in [2].
> Typo: s/comparison/the comparison/
Fixed, thanks!
>> How-to build with Ninja:
>>
>> $ cmake -G Ninja -B build -S .
>> $ cmake --build build --parallel
> Side note: Unfortunately `make test` command (or what should I use for
> tests, when build with ninja?)

Use 'ninja' instead:

sergeyb@pony:~/sources/MRG/tarantool/third_party/luajit$ cmake -G Ninja 
-B . -S .
-- The C compiler identification is GNU 9.4.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-193-gd8c86e28
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Configuring done
-- Generating done
-- Build files have been written to: 
/home/sergeyb/sources/MRG/tarantool/third_party/luajit
sergeyb@pony:~/sources/MRG/tarantool/third_party/luajit$ ninja -f 
build.ninja
[165/165] Linking C static library src/libluajit.a
sergeyb@pony:~/sources/MRG/tarantool/third_party/luajit$ ninja -f 
build.ninja test
<snipped>


 >>> closing state <<<

sergeyb@pony:~/sources/MRG/tarantool/third_party/luajit$ echo $?
0
sergeyb@pony:~/sources/MRG/tarantool/third_party/luajit$

or even do everything (confgure and build) using CMake:

sergeyb@pony:~/sources/MRG/tarantool/third_party/luajit$ cmake -G Ninja 
-B . -S .
-- The C compiler identification is GNU 9.4.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-193-gd8c86e28
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Configuring done
-- Generating done
-- Build files have been written to: 
/home/sergeyb/sources/MRG/tarantool/third_party/luajit
sergeyb@pony:~/sources/MRG/tarantool/third_party/luajit$ cmake --build . 
--parallel
[165/165] Linking C static library src/libluajit.a
sergeyb@pony:~/sources/MRG/tarantool/third_party/luajit$

> fails with the following error:
>
> | Checking /home/burii/reviews/luajit/ninja/build/src/jit/vmdef.lua 3 warnings
> |
> |     /home/burii/reviews/luajit/ninja/build/src/jit/vmdef.lua:5:121: (W631) line is too long (595 > 120)
> |     /home/burii/reviews/luajit/ninja/build/src/jit/vmdef.lua:7:121: (W631) line is too long (613 > 120)
> |     /home/burii/reviews/luajit/ninja/build/src/jit/vmdef.lua:11:121: (W631) line is too long (273 > 120)
>
> But this is the problem of OOS build (default for ninja), not this
> patch, IINM.

Hmm, it works fine for me (see output above).

But yes, luacheck has a problems with running OOS. See description of 
the problem in [1].

The problem was workarounded in Tarantool source repository, see commit:

commit af448464d15f60b87f1c9ef41a7816911c889459
Author: Alexander Turenko <alexander.turenko@tarantool.org>
Date:   Wed Nov 11 10:09:25 2020 +0300

     tools: fix luacheck invocation in different cases

     Now `make luacheck` gracefully handles different cases[^1]: in-source
     and out-of-source build (within the source tree or outside), current
     working directory as a real path or with symlink components.

     As result of looking into those problems I filed the issue [1] against
     luacheck. It seems, there are problems around absolute paths with
     symlinks components.

     [^1]: We have the similar problems with LuaJIT's luacheck rule. They
           will be fixed in a separate patch.

     [1]: https://github.com/mpeterv/luacheck/issues/208

     Reviewed-by: Sergey Bronnikov <sergeyb@tarantool.org>
     Reviewed-by: Igor Munkin <imun@tarantool.org>

1. https://github.com/mpeterv/luacheck/issues/208

>
>> 1. https://ninja-build.org/
>> 2. https://mesonbuild.com/Simple-comparison.html
>> ---
>>   src/host/CMakeLists.txt | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/host/CMakeLists.txt b/src/host/CMakeLists.txt
>> index e01db87d..1ce3e224 100644
>> --- a/src/host/CMakeLists.txt
>> +++ b/src/host/CMakeLists.txt
> <snipped>
>
>> -- 
>> 2.25.1
>>

  reply	other threads:[~2022-06-15 14:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02 13:22 [Tarantool-patches] [v2][PATCH 0/5] Support building with Ninja Sergey Bronnikov via Tarantool-patches
2022-06-02 13:22 ` [Tarantool-patches] [v2][PATCH 1/5] build/ninja: refactoring Sergey Bronnikov via Tarantool-patches
2022-06-15  8:56   ` Sergey Kaplun via Tarantool-patches
2022-06-02 13:22 ` [Tarantool-patches] [v2][PATCH 2/5] build/ninja: create target with cli binary only once Sergey Bronnikov via Tarantool-patches
2022-06-15  9:10   ` Sergey Kaplun via Tarantool-patches
2022-06-15 16:03     ` Sergey Bronnikov via Tarantool-patches
2022-06-02 13:22 ` [Tarantool-patches] [v2][PATCH 3/5] build/ninja: rename default target Sergey Bronnikov via Tarantool-patches
2022-06-15  9:11   ` Sergey Kaplun via Tarantool-patches
2022-06-02 13:22 ` [Tarantool-patches] [v2][PATCH 4/5] build/ninja: create file lists outside of cmake commands Sergey Bronnikov via Tarantool-patches
2022-06-15  8:48   ` Igor Munkin via Tarantool-patches
2022-06-15  9:19   ` Sergey Kaplun via Tarantool-patches
2022-06-15 14:31     ` Sergey Bronnikov via Tarantool-patches [this message]
2022-06-03 13:29 ` [Tarantool-patches] [v2][PATCH 0/5] Support building with Ninja Sergey Bronnikov via Tarantool-patches
2022-06-06 11:24 ` [Tarantool-patches] [v2][PATCH 5/5] ci: add job with build using Ninja on linux-x86_64 Sergey Bronnikov via Tarantool-patches
2022-06-15  8:48   ` Igor Munkin via Tarantool-patches
2022-06-15  9:27     ` Sergey Kaplun via Tarantool-patches
2022-06-15 14:09       ` Sergey Bronnikov via Tarantool-patches
2022-06-15 14:15     ` Sergey Bronnikov via Tarantool-patches
2022-06-15  8:47 ` [Tarantool-patches] [v2][PATCH 0/5] Support building with Ninja Igor Munkin via Tarantool-patches
2022-06-15 14:57   ` Sergey Bronnikov via Tarantool-patches
2022-06-20 12:48 ` Igor Munkin via Tarantool-patches
2022-06-20 13:04   ` Sergey Bronnikov 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=ab844365-a672-67a3-9615-186025199092@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=sergeyb@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [v2][PATCH 4/5] build/ninja: create file lists outside of cmake commands' \
    /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