[Tarantool-patches] [PATCH luajit] ci: make GitHub workflows more CMake-ish

Sergey Bronnikov sergeyb at tarantool.org
Thu Jun 2 15:25:17 MSK 2022


Igor, thanks for the patch!

See my comments below.

1. I propose to use long-options for clarity. In particular I mean 
long-option for "-j", it is better to replace it with "--parallel", see [1].

2. I propose to define a number of threads explicitly, because Ninja and 
Make have different meaning for -j without a number of threads:

Ninja:

       -j N   run N jobs in parallel (0 means infinity) [default=#CPUs]

Make:

        -j [jobs], --jobs[=jobs]
             Specifies the number of jobs (commands) to run 
simultaneously.  If
             there is more than one -j option, the last one is 
effective.  If
             the -j option is given without an argument, make will not limit
             the number of jobs that can run simultaneously. When make 
invokes
             a sub-make, all instances of make will coordinate to run the
             specified number of jobs at a time; see the section 
PARALLEL MAKE
             AND THE JOBSERVER for details.

It is recommended to use a number (CPU cores + 1), so we can explicitly 
set "$(nproc) + 1".

There is a CMake option "" [2], but we couldn't use it as it is 
available since CMake 3.12,

when LuaJIT build system has a minimal version only 3.1.


1. https://cmake.org/cmake/help/v3.12/manual/cmake.1.html#build-tool-mode

2. 
https://cmake.org/cmake/help/latest/envvar/CMAKE_BUILD_PARALLEL_LEVEL.html

Sergey

On 01.06.2022 18:54, Igor Munkin wrote:
> Using explicit <make> commands makes changing the build system generator
> to another one (e.g. Ninja) too verbose. Fortunately, we can use
> generator-agnostic command provided by CMake, so the only spot where
> generator name occurs is the configuration step of GitHub workflow
> (UNIX Makefiles are generated for UNIX-like platforms by default).
>
> Signed-off-by: Igor Munkin <imun at tarantool.org>
> ---
>
> Branch: https://github.com/tarantool/luajit/tree/imun/cmake-ish-workflow
> CI: https://github.com/tarantool/luajit/commit/8826142
> Tarantool CI results ares excess, since the changeset relates only to
> tarantool/luajit GitHub Actions.
>
>   .github/workflows/lint.yml          | 2 +-
>   .github/workflows/linux-aarch64.yml | 4 ++--
>   .github/workflows/linux-x86_64.yml  | 4 ++--
>   .github/workflows/macos-m1.yml      | 4 ++--
>   .github/workflows/macos-x86_64.yml  | 4 ++--
>   5 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
> index 9e7cc1f1..ff4b0ac2 100644
> --- a/.github/workflows/lint.yml
> +++ b/.github/workflows/lint.yml
> @@ -45,4 +45,4 @@ jobs:
>         - name: configure
>           run: cmake .
>         - name: test
> -        run: make -j LuaJIT-luacheck
> +        run: cmake --build . -j -t LuaJIT-luacheck
> diff --git a/.github/workflows/linux-aarch64.yml b/.github/workflows/linux-aarch64.yml
> index 09b85b56..2f62394f 100644
> --- a/.github/workflows/linux-aarch64.yml
> +++ b/.github/workflows/linux-aarch64.yml
> @@ -54,6 +54,6 @@ jobs:
>         - name: configure
>           run: cmake . ${{ matrix.CMAKEFLAGS }} -DLUAJIT_ENABLE_GC64=${{ matrix.GC64 }}
>         - name: build
> -        run: make -j
> +        run: cmake --build . -j
>         - name: test
> -        run: make -j test
> +        run: cmake --build . -j -t test
> diff --git a/.github/workflows/linux-x86_64.yml b/.github/workflows/linux-x86_64.yml
> index a1e3a618..4e6e3d9b 100644
> --- a/.github/workflows/linux-x86_64.yml
> +++ b/.github/workflows/linux-x86_64.yml
> @@ -54,6 +54,6 @@ jobs:
>         - name: configure
>           run: cmake . ${{ matrix.CMAKEFLAGS }} -DLUAJIT_ENABLE_GC64=${{ matrix.GC64 }}
>         - name: build
> -        run: make -j
> +        run: cmake --build . -j
>         - name: test
> -        run: make -j test
> +        run: cmake --build . -j -t test
> diff --git a/.github/workflows/macos-m1.yml b/.github/workflows/macos-m1.yml
> index eb822142..a272e39b 100644
> --- a/.github/workflows/macos-m1.yml
> +++ b/.github/workflows/macos-m1.yml
> @@ -68,6 +68,6 @@ jobs:
>         - name: configure
>           run: ${ARCH} cmake . ${{ matrix.CMAKEFLAGS }} -DLUAJIT_ENABLE_GC64=${{ matrix.GC64 }}
>         - name: build
> -        run: ${ARCH} make -j
> +        run: ${ARCH} cmake --build . -j
>         - name: test
> -        run: ${ARCH} make -j test
> +        run: ${ARCH} cmake --build . -j -t test
> diff --git a/.github/workflows/macos-x86_64.yml b/.github/workflows/macos-x86_64.yml
> index 09f391db..d639e872 100644
> --- a/.github/workflows/macos-x86_64.yml
> +++ b/.github/workflows/macos-x86_64.yml
> @@ -63,6 +63,6 @@ jobs:
>         - name: configure
>           run: cmake . ${{ matrix.CMAKEFLAGS }} -DLUAJIT_ENABLE_GC64=${{ matrix.GC64 }}
>         - name: build
> -        run: make -j
> +        run: cmake --build . -j
>         - name: test
> -        run: make -j test
> +        run: cmake --build . -j -t test


More information about the Tarantool-patches mailing list