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 58CB06ECE3; Mon, 4 Jul 2022 13:20:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 58CB06ECE3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1656930004; bh=B0VoOoqLlRElfltjlVKcCwmsF2o063o5MFAovu31zkY=; 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=IUnYlhDzcz5RpVnmwyU/EbP0XduVDyqyoJGw7jSloOFjaCwI15NPFRwtMLX+2QR+3 +1/byfBPkawnK686FExsk3ls+86i7PaylmuodaKguA4y8m8ifyZtUfmwKUypyJu7CI lOS64aPdENvfyY+gG6T87m3ohckkCi0L8V47fqWQ= Received: from smtpng2.i.mail.ru (smtpng2.i.mail.ru [94.100.179.3]) (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 240D16ECE3 for ; Mon, 4 Jul 2022 13:20:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 240D16ECE3 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1o8JBR-0007h6-Vx; Mon, 04 Jul 2022 13:20:02 +0300 Date: Mon, 4 Jul 2022 13:12:50 +0300 To: Sergey Bronnikov Message-ID: References: <62acf609d9e1ea43d95cb27213e1b8f1331b57a7.1656685987.git.sergeyb@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <62acf609d9e1ea43d95cb27213e1b8f1331b57a7.1656685987.git.sergeyb@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD987C0EE6E7F0A597DE8DF41BCBBF099100D095FC9B0989D88CD62213F67905E7A73BB3F97DD9956477497CCCC392874DE9D9271E2FFA328CAF253FDB7F52A2E4C X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7466896EF24E80F12EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063795DC1BB912715AE68638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D81C5481462C4CFF1252D5EE4604051A2E117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAA867293B0326636D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8B2EE5AD8F952D28FBA471835C12D1D977C4224003CC8364762BB6847A3DEAEFB0F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7C2C2559B29ED8195043847C11F186F3C59DAA53EE0834AAEE X-8FC586DF: 6EFBBC1D9D64D975 X-C1DE0DAB: 9604B64F49C60606AD91A466A1DEF99B296C473AB1E14218C6CDE5D1141D2B1C3AB806CAD83B83C9295D5E2A923D9F7106F0D93246F915CDAD91A466A1DEF99B296C473AB1E14218B936CB490224F2464EEA7BD89490CAC0EDDA962BC3F61961 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34FD9114F69CA58D1E1FAC725FD49D2FE162BA925417E0DAC44A0552D799CC1E5ABBA7AAAD69672D071D7E09C32AA3244CF173B2BC02B5B9C8DA39360AA3802C49F26BFA4C8A6946B883B48618A63566E0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojoR2RQGvSEnRiUqCuwuurDQ== X-Mailru-Sender: 689FA8AB762F7393CC2E0F076E87284EE6C1644CEE7F8FCB66B4AD3E85A0227DA7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E3365FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH] build: configure parallel jobs 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: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Sergey, Thanks for the patch! Please consider my several nits below. On 01.07.22, Sergey Bronnikov wrote: > lua-Harness and tarantool testsuites uses a prove(1) for running tests. Typo: s/testsuites/test suites/. Typo: s/a prove/prove/ since it's program name. > prove(1) allows to run tests in parallel with option "--jobs" [1]. Minor: It's worth to mention that this option requires an argument, so we can't rely on the default behaviour (since there is none). > > In CMake it is not possible to get a number of parallel jobs in CMake Typo: Let's leave only the latter "in CMake" occurrence. > passed by user with option "-j", but it allows to pass a number of Typo: s/"-j"/"--parallel"/, am I right? > parallel jobs with environment variable CMAKE_BUILD_PARALLEL_LEVEL [2] > on configuration phase. We use a value set by that environment variable Minor: It's better (but not obligatory) use the passive voice here, to get something like "The value set by that environment variable is used as a number of CPU threads when it was not specified by user." > and set it to a number of CPU threads when it was not specified by user. > Number of CPU threads detected using builtin CMake function [3]. > > NOTE: CMAKE_BUILD_PARALLEL_LEVEL has been added in a version 3.12. Minor: It's also worth to mention whether this envvar is just ignored or the error is raised. > > 1. https://perldoc.perl.org/prove > 2. https://cmake.org/cmake/help/latest/envvar/CMAKE_BUILD_PARALLEL_LEVEL.html > 3. https://cmake.org/cmake/help/latest/module/ProcessorCount.html > --- > > Branch: https://github.com/tarantool/luajit/tree/ligurio/prove-in-parallel > CI: https://github.com/tarantool/luajit/commit/62acf609d9e1ea43d95cb27213e1b8f1331b57a7 > > test/CMakeLists.txt | 13 +++++++++++++ > test/lua-Harness-tests/CMakeLists.txt | 1 + > test/tarantool-tests/CMakeLists.txt | 1 + > 3 files changed, 15 insertions(+) > > diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt > index ba25af54..fc4ffc51 100644 > --- a/test/CMakeLists.txt > +++ b/test/CMakeLists.txt > @@ -43,6 +43,19 @@ endif() > set(LUAJIT_TEST_COMMAND "${LUAJIT_TEST_BINARY} -e dofile[[${LUAJIT_TEST_INIT}]]") > separate_arguments(LUAJIT_TEST_COMMAND) > I guess all code below can be moved to a function somewhere in cmake/ and its usage -- to the root CMakeLists.txt. Thoughts? > +set(CMAKE_BUILD_PARALLEL_LEVEL $ENV{CMAKE_BUILD_PARALLEL_LEVEL}) > +if(NOT CMAKE_BUILD_PARALLEL_LEVEL) > + include(ProcessorCount) > + ProcessorCount(N) > + # Function ProcessorCount() is guaranteed to return a positive integer (>=1) > + # if it succeeds. It returns 0 if there's a problem determining the processor > + # count. > + if(NOT N EQUAL 0) > + set(CMAKE_BUILD_PARALLEL_LEVEL ${N}) I believe we need else branch here to set CMAKE_BUILD_PARALLEL_LEVEL, if ProcessorCount yields zero. > + endif() > +endif() > +message(STATUS "Using CMAKE_BUILD_PARALLEL_LEVEL: ${CMAKE_BUILD_PARALLEL_LEVEL}") > + > add_subdirectory(LuaJIT-tests) > add_subdirectory(PUC-Rio-Lua-5.1-tests) > add_subdirectory(lua-Harness-tests) > -- > 2.25.1 > -- Best regards, IM