Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Bronnikov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Igor Munkin <imun@tarantool.org>, Sergey Kaplun <skaplun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit 1/3] ci: fix --parallel argument for MacOS runners
Date: Tue, 5 Jul 2022 20:20:08 +0300	[thread overview]
Message-ID: <973f58ca-bcad-cc1b-7e8c-5536008d7fc1@tarantool.org> (raw)
In-Reply-To: <024281fade12f71b734aece21637ea09c11bc759.1655911291.git.imun@tarantool.org>

Igor,

I found that hw.ncpu sysctl setting is deprecated and it is recommended 
to use

hw.logicalcpu, hw.logicalcpu_max, hw.physicalcpu, or hw.physicalcpu_max.

I believe hw.logicalcpu is the best choice for our case.

macOS manual pages are unavailable on apple.com [1], but there are other 
places:
[2], [3], [4].


1. 
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/sysctlbyname.3.html
2. https://www.unix.com/man-page/mojave/3/sysctlbyname/
3. Use of deprecated hw.ncpu https://github.com/ziglang/zig/issues/1252
4. sysctl name "hw.ncpu" (HW_NCPU) is deprecated in Mac OS X 
https://gitlab.haskell.org/ghc/ghc/-/issues/8594


Sergey

On 22.06.2022 18:33, Igor Munkin wrote:
> In scope of the commit 4195eb8f7e2abcf75f92eedd2859b7991cc8b363 ("ci:
> make GitHub workflows more CMake-ish") --parallel value has been
> explicitly set to $(nproc) + 1, since -j default behaviour differs for
> Ninja and GnuMake. However, MacOS lacks nproc command, but CI silently
> continues to execute pipeline.
>
> This patch fixed MacOS-specific workflows changing nproc command with
> sysctl -n hw.ncpu.
>
> Signed-off-by: Igor Munkin <imun@tarantool.org>
> ---
>   .github/workflows/macos-m1.yml     | 4 ++--
>   .github/workflows/macos-x86_64.yml | 4 ++--
>   2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/.github/workflows/macos-m1.yml b/.github/workflows/macos-m1.yml
> index 8387bbcf..d1d144f0 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} cmake --build . --parallel $(($(nproc) + 1))
> +        run: ${ARCH} cmake --build . --parallel $(($(sysctl -n hw.ncpu) + 1))
>         - name: test
> -        run: ${ARCH} cmake --build . --parallel $(($(nproc) + 1)) --target test
> +        run: ${ARCH} cmake --build . --parallel $(($(sysctl -n hw.ncpu) + 1)) --target test
> diff --git a/.github/workflows/macos-x86_64.yml b/.github/workflows/macos-x86_64.yml
> index 2ab2c8d0..a7c2f4e3 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: cmake --build . --parallel $(($(nproc) + 1))
> +        run: cmake --build . --parallel $(($(sysctl -n hw.ncpu) + 1))
>         - name: test
> -        run: cmake --build . --parallel $(($(nproc) + 1)) --target test
> +        run: cmake --build . --parallel $(($(sysctl -n hw.ncpu) + 1)) --target test

  parent reply	other threads:[~2022-07-05 17:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-22 15:33 [Tarantool-patches] [PATCH luajit 0/3] Integration testing and tiny fixes in CI Igor Munkin via Tarantool-patches
2022-06-22 15:33 ` [Tarantool-patches] [PATCH luajit 1/3] ci: fix --parallel argument for MacOS runners Igor Munkin via Tarantool-patches
2022-06-23  8:19   ` Sergey Kaplun via Tarantool-patches
2022-06-29 22:17     ` Igor Munkin via Tarantool-patches
2022-07-01 13:12   ` Sergey Bronnikov via Tarantool-patches
2022-07-04  7:05     ` Igor Munkin via Tarantool-patches
2022-07-05 17:20   ` Sergey Bronnikov via Tarantool-patches [this message]
2022-07-05 21:25     ` Igor Munkin via Tarantool-patches
2022-06-22 15:33 ` [Tarantool-patches] [PATCH luajit 2/3] ci: remove GC64 matrix entries for ARM64 workflows Igor Munkin via Tarantool-patches
2022-06-23  8:29   ` Sergey Kaplun via Tarantool-patches
2022-06-29 22:17     ` Igor Munkin via Tarantool-patches
2022-07-01 13:21   ` Sergey Bronnikov via Tarantool-patches
2022-07-04  7:05     ` Igor Munkin via Tarantool-patches
2022-06-22 15:33 ` [Tarantool-patches] [PATCH luajit 3/3] ci: add Tarantool integration testing Igor Munkin via Tarantool-patches
2022-06-23  8:45   ` Sergey Kaplun via Tarantool-patches
2022-06-29 22:17     ` Igor Munkin via Tarantool-patches
2022-07-04 10:24       ` Sergey Kaplun via Tarantool-patches
2022-07-01 13:39   ` Sergey Bronnikov via Tarantool-patches
2022-07-04  7:07     ` Igor Munkin via Tarantool-patches
2022-07-04 10:09       ` Sergey Bronnikov via Tarantool-patches
2022-07-13 10:09 ` [Tarantool-patches] [PATCH luajit 0/3] Integration testing and tiny fixes in CI 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=973f58ca-bcad-cc1b-7e8c-5536008d7fc1@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imun@tarantool.org \
    --cc=sergeyb@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit 1/3] ci: fix --parallel argument for MacOS runners' \
    /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