Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6596309rdb; Fri, 15 Dec 2023 03:15:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJEyRqw7725F8To+dWYQg2aIs6Rr0Q2g2xJ/IBO8lUd0gK5vHquG5bq9GrkveqqwgGfWR7 X-Received: by 2002:a17:903:1207:b0:1d0:c0d3:5c1 with SMTP id l7-20020a170903120700b001d0c0d305c1mr6759108plh.102.1702638923223; Fri, 15 Dec 2023 03:15:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702638923; cv=none; d=google.com; s=arc-20160816; b=Pp0uDY6gsY+PS1grCDQ4/JQ64zMxIPP7VLWtJ9dDr2pj1YqfkcrCrhRv4kp6VvPpDc kV95du1nOzEyYUtdixxsKSmFdgvEW6kEjAk4jeHlqAlGWw1wx9opWjFP4LEejU6qllKF d28dFLFahhca/BdzYcap8yZY0Bas3rMJ0wIxG2cLB3T4lH7tQTDgHBq7zr5Two4+7Z1O 5voX1ab3eqRU2T7wa43Nyc3rBHyV7YT3ghIXx3uT96dZERfpp6FGF10mTsvpcXS3tg75 9EMI+JnJbHDvVQyZoXHpMtZhg/Ji6qOW3oay5wwG+5y122Mw0+Z5bq3QpkqYfzMTxkgo Zwiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=k+yoIAvPDl135lIcXlo6qqmeUnqlKdg0n91rabpsyIE=; fh=TYbLlXVWdv+cEjEHxBo0IJXPv9DZGAh2bK1jbPYS+aU=; b=maORSeBp0x6y4MhhTXkHCp8oaU89OAU762S0xq1K2NSkitFcI/Uposl17ZPcvLe7R2 q8zRntqhI2vjH0nJtUOSJxCKxGcc7/iDwqmvLHFbSkwQ5pqzXbQdWzA4l6K8De417zMK 1WcjjhsgBIPFw2z47xWucnX2auKDKu/UqH3oSGsQCfbQvZBSdrdop2itEPRAgIwbRu0t UMUkeepZWg4faaGXZl+5yJRARxM8PZFOTdQF987Q6VC9spLldE7ph8e1L+L60ykd9mir gKgFEgw8CbQGUPI5PhEKHrPVMHvAYMzYw6Bx6LExkika5qpeVo8nEIaxMhQ0TIxlUrm5 exZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=k1t+f9oY; spf=pass (google.com: domain of linux-kernel+bounces-804-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-804-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 s13-20020a170902a50d00b001d07b6a0ae9si12749636plq.203.2023.12.15.03.15.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 03:15:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-804-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=k1t+f9oY; spf=pass (google.com: domain of linux-kernel+bounces-804-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-804-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 E29A4283B50 for ; Fri, 15 Dec 2023 11:14:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C19A24A0D; Fri, 15 Dec 2023 11:14:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="k1t+f9oY" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 0EFBE1C292; Fri, 15 Dec 2023 11:14:06 +0000 (UTC) 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-wr1-f53.google.com with SMTP id ffacd0b85a97d-3364a1451c6so273741f8f.3; Fri, 15 Dec 2023 03:14:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702638845; x=1703243645; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=k+yoIAvPDl135lIcXlo6qqmeUnqlKdg0n91rabpsyIE=; b=k1t+f9oYRpNxF7LvgN/P8g33Etk+KRRCZKSD8uBIOqpibpLUFzDkYtHI8pitLV2JNL kgg6HFBLZ2rPbi023CR9qMRbqgcptzRd0qa2A7N9ii0FheZQNQAAguQWV188XvTx9tci DEWtAWMxfz/CYB9gMj/dYYaTc7pZqjowA8MK7fUWnTMc9qW/wrrIaY0f3sKsilJK2uGQ RXITRNgw3rOrKyZLaoZQlbkKeB7uvkt0PUI/gS9xUPBYBSw4T9lBzXK4uF6EJj3bcMPl D/BpEqhm2WT1Rijw483cqqcjeEd8MEDy3C8divtzJQth4I2yvu8wZ+os6jhVSNUgyxLW ImFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702638845; x=1703243645; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=k+yoIAvPDl135lIcXlo6qqmeUnqlKdg0n91rabpsyIE=; b=l597KNjbRXCxEJRdZeGUG3W9AjCWNk6OWdD6MQ538E7Jw3IsEtCSaDd7ybUJ+MxLUB 03tWJkV66XH/18qW86TWQKxItlVQLdGbV6XYQ9/yOI0+PQkmWyYw6+8buy1iirv/Tfy8 KnId5cuw312BBpou+ciD7bSERYEDWQvgHbcmC/ckXIoT0vntTx0xCeM5IxabMtSnwpWb C/MD1zFc4BGlHQ/brxXy6evDFrZpftUMW4daxZELK+Cqq8SLlGqguLUfYoJPMLaPdmv2 zV7v7QOYZFAW+JDy5NUTiuPp1vhNme4J8Ib4KO5DJpzaCqNtyA5kHZZWtTYl3kHn2eUc AlFA== X-Gm-Message-State: AOJu0YzNhQPLeBKbN8tC6PolQ3nYCpxo3T3Jbn1HMD3RjZDTKCg4TNcI xzsUejgQmT/Kjl49VTcrfA== X-Received: by 2002:a5d:6daa:0:b0:336:4aae:811f with SMTP id u10-20020a5d6daa000000b003364aae811fmr1781196wrs.118.1702638844070; Fri, 15 Dec 2023 03:14:04 -0800 (PST) Received: from [192.168.1.148] (224.69.114.89.rev.vodafone.pt. [89.114.69.224]) by smtp.googlemail.com with ESMTPSA id dd14-20020a0560001e8e00b003364277e714sm5909747wrb.89.2023.12.15.03.14.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Dec 2023 03:14:03 -0800 (PST) Message-ID: Date: Fri, 15 Dec 2023 11:14:01 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V2] docs: rust: Clarify that 'rustup override' applies to build directory Content-Language: en-GB To: Viresh Kumar , Miguel Ojeda Cc: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Jonathan Corbet , Vincent Guittot , rust-for-linux@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org References: <1c03eb18-a6ac-45c8-8fea-46097bb4e132@gmail.com> <20231215064823.ltm55fk4zclsuuwq@vireshk-i7> From: Tiago Lam In-Reply-To: <20231215064823.ltm55fk4zclsuuwq@vireshk-i7> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 15/12/2023 06:48, Viresh Kumar wrote: > On 14-12-23, 18:22, Miguel Ojeda wrote: >> Something like v1 but a bit simpler, e.g. keeping things as they are, >> but with just a sentence after the command like "If you are building >> the kernel with `O=`, i.e. specifying an output directory, then you >> should append `--path `." could work. >> >> Or we could just provide a `rustupoverride` Make target to do this for >> us [1], since we have all the information needed and would be >> copy-pasteable by everybody. I can send it as a non-mangled patch and >> then Viresh can redo this one on top using it. > > How about this ? > > diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-start.rst > index f382914f4191..367b06f3edc2 100644 > --- a/Documentation/rust/quick-start.rst > +++ b/Documentation/rust/quick-start.rst > @@ -39,8 +39,17 @@ If ``rustup`` is being used, enter the checked out source code directory > rustup override set $(scripts/min-tool-version.sh rustc) > > This will configure your working directory to use the correct version of > -``rustc`` without affecting your default toolchain. If you are not using > -``rustup``, fetch a standalone installer from: > +``rustc`` without affecting your default toolchain. > + > +If you are building the kernel with `O=`, i.e. specifying an output > +directory, then you should append `--path ` to the above > +command. > + I think we can drop the reference to the `--path ` to avoid giving too much information to the users following the guide. It doesn't seem to bring anything given users should now always go through `make rustupoverride`. > +Alternatively, you can use the ``rustupoverride`` Make target:: > + > + make LLVM=1 O= rustupoverride > + But if I understood this correctly, the point here is that with the new target we can now abstract both cases behind the `make rustupoverride` target - i.e. we don't need to provide alternatives. So, maybe something like the following is clearer: If ``rustup`` is being used, enter the checked out source code directory, or your build directory (if you're using the `O=` option to build the kernel), and run:: make LLVM=1 rustupoverride This will configure your current directory to use the correct version of ``rustc`` without affecting your default toolchain. If you are not using ``rustup``, fetch a standalone installer from: https://forge.rust-lang.org/infra/other-installation-methods.html#standalone Tiago.