From nobody Thu May 16 21:59:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1712909031; cv=none; d=zohomail.com; s=zohoarc; b=Zy/kfnTaxFAbFefWLHWCO+LVJYvLI7ldj0q2kwtK+8MXz17r+U0Y3YojcUNm2JNFOFZStJYIsmyBSGzeonQ+fxhN2hM7ynUErWlDWiNxf/A1cmCOUAfxccJcN0ik65OfFpbzgGZVH4sL8PLlcLAuG8U9SgMXHCxNNYyYO0WU6WM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1712909031; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=A5Llucl1jLUHeO2gAswtv29kQ2WFQbLL8CXHS8kKVi4=; b=ABN112L3iFUeR5SWRyHq6KkDKM5wprLnh6+o3UWibJ0Kq0W0EUANSnBg7Pz0TFKOL3GTRiXBajQ3xAjj0TFW9bcdGMtRNM4cZiA8hwhNmNqsF7+U3OGTPtO58FLU+RUPx1MEAYnOvfcSyyVvDdj0NHmVakqrGJ1po/SnJxXjFA4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1712909031340774.5717648961916; Fri, 12 Apr 2024 01:03:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rvBs6-0003L5-Hc; Fri, 12 Apr 2024 04:02:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rvBs4-0003Ks-KQ for qemu-devel@nongnu.org; Fri, 12 Apr 2024 04:02:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rvBrz-0004K1-VT for qemu-devel@nongnu.org; Fri, 12 Apr 2024 04:02:52 -0400 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-98-JP5lpbHiN1GS-J5tbQCdjA-1; Fri, 12 Apr 2024 04:02:40 -0400 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a523c6b9639so11540266b.1 for ; Fri, 12 Apr 2024 01:02:39 -0700 (PDT) Received: from [192.168.10.117] ([176.206.87.39]) by smtp.gmail.com with ESMTPSA id wp20-20020a170907061400b00a5226f9542dsm1178675ejb.27.2024.04.12.01.02.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 01:02:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712908966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A5Llucl1jLUHeO2gAswtv29kQ2WFQbLL8CXHS8kKVi4=; b=SjAgnY8GRyKGp7YSVmhnqrV8l4HGqzTzezOAnF/6hbu9q+CNCDVv8JWBX54VOMh3ueP4ro 5lSPva4d5LEhr0FmJB5rrBn4WOODICOcHTLUQ+BKiEvpYfD1NBJkdy9AElmXHePDqrRVdd ig0xfaMdQJae7fPwIs7DcEN6bsbPbBk= X-MC-Unique: JP5lpbHiN1GS-J5tbQCdjA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712908957; x=1713513757; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=A5Llucl1jLUHeO2gAswtv29kQ2WFQbLL8CXHS8kKVi4=; b=df7gQjUdsTxTti38j1sr3gXg2htjiBpxx0S26/t4kbeuty1HMFMwmiBCkRYrnQU4gM UC2An6EkCtvtzj2G/WuuAHNZa83zxLWU3poNRLmYl7Kzun41DpCrkvFPqjS6ZWVsRrL5 2ILboixskUvCX6bmoR/g14Flfbh2JPj5fARRNVCqXWOnGgK/ZqhhbtDWz1WGLLEYzJeB U6G0lZPPMJnivOq149oKA+jFLWYMGFX9nCoUYtgwHG5qmO7ursBGYVWDpG0X1NXOKhPV yymziSqe60x/f+08fc48jo/6MiwFKFMzI+nb1qVACy24REX0kObRGCNnXoClxY7VXrxA xBuw== X-Gm-Message-State: AOJu0YzFXirfDbz9CNGkLi+cVXeShic484MsWwK5Jm2wNSm5+yJkNX2N qfAWESt213Di34f9yxl5LfvWHGu/yovr8V3fsbC9yGZ8ofLWlIEOw6VVNV0MxKDf53w3lXOnpmu IsxZOMMUuTnHFgjC4gjyexHhfuJUgvWQaKww22q1zlBV9cYtyOANti6dEbT9FUlExAk2FARPVUE fPYeVEyeB2D6NSMvYI+8lz6LoNwSHFOWiMkOXF X-Received: by 2002:a17:906:5fc2:b0:a51:ae51:5206 with SMTP id k2-20020a1709065fc200b00a51ae515206mr1062252ejv.42.1712908957514; Fri, 12 Apr 2024 01:02:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErYet4bg0RW0ZUFW5vbK0hieqtx589Pl3BQxJEIVNRcGIFWcxktt9Y+3yogZ4bLyEvdBLGIQ== X-Received: by 2002:a17:906:5fc2:b0:a51:ae51:5206 with SMTP id k2-20020a1709065fc200b00a51ae515206mr1062236ejv.42.1712908957125; Fri, 12 Apr 2024 01:02:37 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Matheus Tavares Bernardino Subject: [PATCH v2] Makefile: fix use of -j without an argument Date: Fri, 12 Apr 2024 10:02:35 +0200 Message-ID: <20240412080235.11478-1-pbonzini@redhat.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.49, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1712909033433100003 Content-Type: text/plain; charset="utf-8" From: Matheus Tavares Bernardino Our Makefile massages the given make arguments to invoke ninja accordingly. One key difference is that ninja will parallelize by default, whereas make only does so with -j or -j. The make man page says that "if the -j option is given without an argument, make will not limit the number of jobs that can run simultaneously". We use to support that by replacing -j with "" (empty string) when calling ninja, so that it would do its auto-parallelization based on the number of CPU cores. This was accidentally broken at d1ce2cc95b (Makefile: preserve --jobserver-auth argument when calling ninja, 2024-04-02), causing `make -j` to fail: $ make -j V=3D1 /usr/bin/ninja -v -j -d keepdepfile all | cat make -C contrib/plugins/ V=3D"1" TARGET_DIR=3D"contrib/plugins/" all ninja: fatal: invalid -j parameter make: *** [Makefile:161: run-ninja] Error Let's fix that and indent the touched code for better readability. Signed-off-by: Matheus Tavares Bernardino Fixes: d1ce2cc95b ("Makefile: preserve --jobserver-auth argument when calli= ng ninja", 2024-04-02) Signed-off-by: Paolo Bonzini --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 183756018ff..02a257584ba 100644 --- a/Makefile +++ b/Makefile @@ -141,8 +141,13 @@ MAKE.n =3D $(findstring n,$(firstword $(filter-out --%= ,$(MAKEFLAGS)))) MAKE.k =3D $(findstring k,$(firstword $(filter-out --%,$(MAKEFLAGS)))) MAKE.q =3D $(findstring q,$(firstword $(filter-out --%,$(MAKEFLAGS)))) MAKE.nq =3D $(if $(word 2, $(MAKE.n) $(MAKE.q)),nq) -NINJAFLAGS =3D $(if $V,-v) $(if $(MAKE.n), -n) $(if $(MAKE.k), -k0) \ - $(or $(filter -l% -j%, $(MAKEFLAGS)), $(if $(filter --jobserver-au= th=3D%, $(MAKEFLAGS)),, -j1)) \ +NINJAFLAGS =3D \ + $(if $V,-v) \ + $(if $(MAKE.n), -n) \ + $(if $(MAKE.k), -k0) \ + $(filter-out -j, \ + $(or $(filter -l% -j%, $(MAKEFLAGS)), \ + $(if $(filter --jobserver-auth=3D%, $(MAKEFLAGS)),, -j1))) \ -d keepdepfile ninja-cmd-goals =3D $(or $(MAKECMDGOALS), all) ninja-cmd-goals +=3D $(foreach g, $(MAKECMDGOALS), $(.ninja-goals.$g)) --=20 2.44.0