Received: by 2002:ab2:3b09:0:b0:1ed:14ea:9113 with SMTP id b9csp166288lqc; Thu, 29 Feb 2024 13:33:42 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVxzNo1Ii+dWeVnYZmnya/WbvQtq+gwrqBT06YPiLPsgcUnxgyYAOYR8pCj6p+zr6M5SH6mrJ2udI/k6jWn9ObvADq35lSZaQA5Vnv90Q== X-Google-Smtp-Source: AGHT+IH4rsgavTcxI/8bHMg4R63FtthryZ9I9TTNt3hOnP91MLXQvxfBz8mQ2WTR0U6oF6QTQoPD X-Received: by 2002:a17:903:298e:b0:1db:f811:66f7 with SMTP id lm14-20020a170903298e00b001dbf81166f7mr4038430plb.60.1709242422195; Thu, 29 Feb 2024 13:33:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709242422; cv=pass; d=google.com; s=arc-20160816; b=UeWCu5vmFamR/3ZfVvW0uIDP8qTvsU/LTPrsvD2Hy2y7uy9HKI6J+iiPrGtkkgFxUa gVQ7JVeZjXQH0MvNThHynwGA/YI0ja0HTW63XcaN7mE1pXNOMRzhTH7iopJl8wXJXrAj AvKccs4wNl7CdY+nJmAtHMjBAR+DsPXBtz+e4NAqDpGe5ebGvIEqe5h/Hf5X74PdnIZw w+IBMCzTJh9VbXHljx+1SSJTUD46BDUcoNCw+x0LegTSXNjp+/LfEr8Ts6gYdDx3YYeb btrFBJedsEb1EocQbx3Oj84sAz9Xs46cZp2kM65M8bCkdN9o9cHnYYW2AsyXYrsu0gVs JpuA== 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=BnJoVXU1CaeQbXBgRnIHjar/FV4NrO1c9oIQRiWiPpU=; fh=O7ZEFNx6uh0gENTX+jd1W8KpiI7wFPjE9Y6zEwdpOgM=; b=CqyQLjeg3HCc17lRmIY2w5RnQmkYWZL7tzT8auFu7yx9/SN+QkWpLCZKK/1uNBjzl4 t5kEj2SWt9pIRXf2ej840QSZfcu/S8oCMJoQvOw9AgIzBEybzsaox5MsmujHMGxYcP4G GJaVx2BNIWmfWFP59XAYnfo24d9ce1N6zlQzEXASraEW9wYVxL3irHAvDHdvfNYmXu6m 06tIxDxjQldXGd/NuvtuxsOaZ3yoruykyTx9VYjJ161Qa9DQhUOCTjGoKinsE6S+OUBh Mc9v15yMAq3iLU3YyRvE+1vs8wMQQchu4i2BDxe9TNmEaBgM0T7tIF6X8CXl7FyZWczZ Cntw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Z6ajt57F; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87590-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87590-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id l4-20020a170903004400b001dc127050absi1960233pla.374.2024.02.29.13.33.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 13:33:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87590-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=@gmail.com header.s=20230601 header.b=Z6ajt57F; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-87590-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87590-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 DCD7F28343E for ; Thu, 29 Feb 2024 21:33:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0948E6D510; Thu, 29 Feb 2024 21:33:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Z6ajt57F" Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D131D16FF47; Thu, 29 Feb 2024 21:33:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709242413; cv=none; b=TpikuBKU2Y3IE7C3HjSLW/e6g7vHQeCYX/nvWvmBicjgvGsa3f2Q1or3PxDCRWm0ynF5E2KqmpJP34uguEcjEAi7Wc/g0HWFsLxbdSTOMHr96ikMCvpPH1tFHRlwgggTI8BgoW754v4JndnXszsZWu9uCwM2lfP52WguZum2+JM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709242413; c=relaxed/simple; bh=BnJoVXU1CaeQbXBgRnIHjar/FV4NrO1c9oIQRiWiPpU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=oRmnQ8rRwLuKPMGiRM5Lh174bp6kZOK5KPCETdzXSeGVK4wIHcRjNK2ti1YhAwYfLS8tsdTaokYOUzhSoHD2JA6+qJvhseMIV2pU6jOfjKB4NsWbzsvMRL43B8rp9DhklOQpM9fIEpstoC+DVTwSNka1xMb3visERnJU1AHHeT4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Z6ajt57F; arc=none smtp.client-ip=209.85.216.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-299b92948a6so981103a91.3; Thu, 29 Feb 2024 13:33:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709242411; x=1709847211; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=BnJoVXU1CaeQbXBgRnIHjar/FV4NrO1c9oIQRiWiPpU=; b=Z6ajt57F1WSceLYkGweS7MrRdWKj2xFqPlkvjMxKXtei3ZVqpmYHfdmuNceUMakYiT Oaj39fT1B89truMMx8OU6v3bhb5L8T/fxMCUJ7ruu9GZ51UhuvYQNISZlUcmlitpP7MF rAe029msPQjM3igUt7dzHkGIE6MWtXOlOF5Cy/2L9rXZEbL/vehHsLzjSVQK4qOtJl8o bP9X4Y299SHxk0hB0doIc1xGg8iKMAMbVdh9rFmJTzGe9W/gGjVBUnCAMU9zjOooG3Pd C661SSum/+00GjD5XAID6lb3mNOaVvKZrjishBCIZslCEKCzlcZ8LaVA4vlFyCICRaWg sVoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709242411; x=1709847211; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BnJoVXU1CaeQbXBgRnIHjar/FV4NrO1c9oIQRiWiPpU=; b=jRb4/c7kWid1rDDaSBPlqj4L+Yhnw5IxzgXtI7k0tAU3ipRFM9IlI81FTkWJu16AO0 BOVWY32r1QqHjeUlaaLTQF6kz7D3gYZO2O7dmnc/odonaNB75issuXSebO8ZSq5v+VnM heA4Kp9pO8toUmJmq4Bekjdr99YOjrzGT0vsV9Sf1x+H1Yu+2mn09f1Ifae6G9Shsc3k lBsOqetrOL2kjSAwGEz4EE3QpUXGAzrzYKQkHEszFAKubrkaFRuSXjj9JHWeIdRXobWq v6wwplceezBugFNaAmhDqHflGFPL4vbG5PJndCA0Lxc4LVs1zBTVAbCGQa61/KyOc6Kn nvwg== X-Forwarded-Encrypted: i=1; AJvYcCUhsXI5qScmtkOD90MrCo016Yzl9/fO0Z0q7Zva5vXXE8wiiiusnwOhFwiWIQOHxWSZ0J2DQduZeJXrgox9+iyF2+Qk4VIz298wv90mN5R2IJ2Rc/Pn3gu0s+imrcLP13dY8m3GJg7vjjYSdcqDLTCdFE4/qwBNSEiXoCCvtMMBLnIfdLf/Z1wUn1k= X-Gm-Message-State: AOJu0YwxVSmbxB22uIkHhz6ZaE17p6LWtcAYdmYl0Xb321ljv5CYc0Vb ewaOgQs9FWEkSDzixSkiueCPV51qF8gEA/QepxCGIHXgOO5GDoUIc6iW9wZb1pxd1r3/PMNkXeL 5fQxYvdCKCCNlol2spJXNWePHers= X-Received: by 2002:a17:90b:104b:b0:29a:cbfb:5b28 with SMTP id gq11-20020a17090b104b00b0029acbfb5b28mr300141pjb.13.1709242411118; Thu, 29 Feb 2024 13:33:31 -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: Miguel Ojeda Date: Thu, 29 Feb 2024 22:33:18 +0100 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 , Masahiro Yamada , 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 1:26=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 Applied (i.e. including the upgrade to 1.76.0) to `rust-next` -- thanks everyone! [ Reworded to add link to PR documenting the recommendation. ] Cheers, Miguel