Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1033600rdb; Mon, 19 Feb 2024 01:53:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVZY1TBKmlKiWIx7L5pbRgr31+ubN4mMqW2HIroOkwB/aSV2bk8dla6xGd6LJG0CId+uu08hmYO2ZIlhXnfkfaM/7KuOBjJUMNMfY4ycg== X-Google-Smtp-Source: AGHT+IGcCdo3IgPJde2YPob0dGgtEl2BUkDpsvDBZIn4hdCR6ckZ/hLHwcUvP5V2wDnolm9wyavc X-Received: by 2002:a05:6358:7611:b0:178:dad2:f32b with SMTP id r17-20020a056358761100b00178dad2f32bmr13805348rwg.4.1708336433436; Mon, 19 Feb 2024 01:53:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708336433; cv=pass; d=google.com; s=arc-20160816; b=xvCaiJ1n7XjfM2ceNlbaVpriBFjcbqfS5ZozGuFrWzaoltTEf1h/4jj4UcgKxWE06y a35XxewTrnkM+p7fCvgwyoAKINYEo8soLHaZqDs4nUxNxMj2GGa8OC1aqq7+7ALE3rkB 8ANjolviSCOnwp7QCzquad5FZdM/A4xZpPJ8LilF+QHSS+cV24X+sTZvLLp2iovz1HdL ntXEPxtKbln7r360SVixID2vLE4FNbrxc/Sp3bt0ptmP6jiq5H0WIGFrCgGSGPUt//cf SQU6OhFBxBSFU+4urfUqe/QqcubC04uO2ClYb6/svCxkKKEbddt/5zB17yLfsPBGR2KF paOA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=r/h2jpPDYgXtfXZa856PSgA0VAjbWBELGgpavRLRjZA=; fh=lLtu4XfsSticOVsd7zXSotOelgvVUMpj1gBH6Oee+G4=; b=d0DXGzsJtNeo08VkRowvAg+/lHE7lYBA7xO6LbltYmXLct3j25TSscDrW0q+WggY3C mgnWDFcNZn8bJ6ZrVYj33b6oTsh3eZbosnwPm2sSr/wZtYZ92yovgeC19gRYs686xyc3 dxs4GTaWLKv0mKJtradpnuC2NLMuBWdE32HNN+Mc80eORNdbRUY20ixEPVfCqcHN3Wj4 YEmnUQieu+uTxlzBTqmF6rNdqS/B9vJelHFMythRAD0nUNKWMPu4t3kBEGhW1o0ckliK Jm00NA19uaNGSVXhds71b7BVxJw4XdhggA5AlKe65ziNovOqjJO6axlahH+sw6d1RuAj sSdg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="kO9kJ/t3"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-71071-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71071-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ln12-20020a056a003ccc00b006e46bc37aa9si536232pfb.60.2024.02.19.01.53.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 01:53:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71071-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="kO9kJ/t3"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-71071-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71071-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 21D342824E3 for ; Mon, 19 Feb 2024 09:53:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B109E288AE; Mon, 19 Feb 2024 09:53:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kO9kJ/t3" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CDDD628DA7; Mon, 19 Feb 2024 09:53:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708336390; cv=none; b=q8jchfVcAfAEYZ7Y+xWNmgjSrYzyqokHH7lQBpnOuDQ9YQIaQVn8h3oz2V24qwNDZ69qh/C2GsZUduMvrR0sOTIhvPucjAIfo+Qacd1cKfZXF6AU0BGW5HOGgh158mYKzCyuSq9sA2ECdZ07M2jYG+Ssbo5sS5aRpnz89wKkvZ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708336390; c=relaxed/simple; bh=r/h2jpPDYgXtfXZa856PSgA0VAjbWBELGgpavRLRjZA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=SiwlmM0TfKWDj8QBpfeiFsvhdIlzolJsGzK08GB1sFV6GVWRHNe7EuvL0Zkl+/QtUMs9M5Yx+PdmP5GCW19d61Z6G8BsWerjsmOH1K6C+gVYIdnNN2sxChrz8yYEz7BF9d3DxItAGJaixqp9eKXFVtPOpNcqMYtv7CsPl8M9K6k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kO9kJ/t3; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8270AC433C7; Mon, 19 Feb 2024 09:53:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708336390; bh=r/h2jpPDYgXtfXZa856PSgA0VAjbWBELGgpavRLRjZA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=kO9kJ/t3G0jAOCDIhSLY1AQAFvgfCoFc3tRKvHMfg1znoRsYmju7r2LReykQn8B// pgkPSdQy+5n8DlDZvKImpCBcswChM9a1RdkLRc9YS+LIkEnJZggUyptYOkYwaYVQuC yoRONjM+Ah6NNUwQpyVGU84lJBVlEM4fN5O1E4BYks1jDNCdsyg2M9wpbsqWGdK6Ln wtxHVvvl54Kb0Z0H4zUdg5nkuHKFvaSf4OZ9VeedASEoggOUvuBCr+3Y9zRIqDg6N4 amlnhDkReqZ2GGazLxkfdonQ30wI32/7S9KmFgGJIWtyjByBYp+6MsFh23CLJr8t6h 10AiIyEikrlMQ== Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-512bd533be0so272478e87.0; Mon, 19 Feb 2024 01:53:10 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXJPxjB0tenNGJen/axyCoS9U4NBiDED3i/t3c3kFCtb2RVZMV7D4ZMoYnw1eWBguJexhtEa3BO+RF1poHdeLiUNBvvFzoypTZHZRGgzI2kt1J5gA+Z2l30zwPrIw0EzXnnqDW9rMmI88YXk4eJzRdBm+0EKmiB4l+1E0g5Wgd5+8n1IpznknmCrRc= X-Gm-Message-State: AOJu0YwVYh89MJGIE33cPG78RS2vjfC40OeZx4XGA0rdTUvrH8e0QJ2b 2PSeKffDAYaOSVxdPx/SXYbY1UvSusE9nQTQ+lbk6+I2+LiclnBAxrovwrPUUzJnnVrFM2XEMoX Ikg4cBO81I27UR5r6YXI6RyO02hY= X-Received: by 2002:a05:6512:52f:b0:512:afcc:3fe8 with SMTP id o15-20020a056512052f00b00512afcc3fe8mr1989946lfc.23.1708336389049; Mon, 19 Feb 2024 01:53:09 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240217002638.57373-1-ojeda@kernel.org> In-Reply-To: <20240217002638.57373-1-ojeda@kernel.org> From: Masahiro Yamada Date: Mon, 19 Feb 2024 18:52:32 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] kbuild: mark `rustc` (and others) invocations as recursive To: Miguel Ojeda Cc: Wedson Almeida Filho , Alex Gaynor , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , linux-kbuild@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Feb 17, 2024 at 9:27=E2=80=AFAM Miguel Ojeda wro= te: > > `rustc` (like Cargo) may take advantage of the jobserver at any time > (e.g. for backend parallelism, or eventually frontend too). In the kernel= , > we call `rustc` with `-Ccodegen-units=3D1` (and `-Zthreads` is 1 so far), > so we do not expect parallelism. However, in the upcoming Rust 1.76.0, a > warning is emitted by `rustc` when it cannot connect to the jobserver it > was passed (in many cases, but not all: compiling and `--print sysroot` > do, but `--version` does not). And given GNU Make always passes > the jobserver in the environment variable (even when a line is deemed > non-recursive), `rustc` will end up complaining about it (in particular > in Make 4.3 where there is only the simple pipe jobserver style). > > One solution is to remove the jobserver from `MAKEFLAGS`. However, we > can mark the lines with calls to `rustc` (and Cargo) as recursive, which > looks simpler. This is what is now documented and recommended by `rustc` > and allows us to be ready for the time we may use parallelism inside > `rustc` (potentially now, if a user passes `-Zthreads`). Thus do so. > > Similarly, do the same for `rustdoc` and `cargo` calls. > > Finally, there is one case that the solution does not cover, which is the > `$(shell ...)` call we have. Thus, for that one, set an empty `MAKEFLAGS` > environment variable. > > Link: https://github.com/rust-lang/rust/issues/120515 > Signed-off-by: Miguel Ojeda Acked-by: Masahiro Yamada --=20 Best Regards Masahiro Yamada