From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48943C3DA4A for ; Tue, 20 Aug 2024 17:22:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A66796B0085; Tue, 20 Aug 2024 13:22:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A3DF06B0088; Tue, 20 Aug 2024 13:22:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9055A6B0089; Tue, 20 Aug 2024 13:22:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 739BC6B0085 for ; Tue, 20 Aug 2024 13:22:56 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id E787E1A03E6 for ; Tue, 20 Aug 2024 17:22:55 +0000 (UTC) X-FDA: 82473293910.26.2E8592A Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) by imf09.hostedemail.com (Postfix) with ESMTP id 16502140031 for ; Tue, 20 Aug 2024 17:22:53 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=C8P2ka7y; spf=pass (imf09.hostedemail.com: domain of mmaurer@google.com designates 209.85.208.52 as permitted sender) smtp.mailfrom=mmaurer@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724174496; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=T/1WG/9ldCtAUxEKSi+2OpNUvCL9Q6L1YzxrQLiosWY=; b=j4W37+pgw2RERWgPrvkMVGVp6U2BED9pJqxJykiESC5n5sFxdGyDo3tODhQDGlov7HPEga imr6z6Wy+mZgC7Bmajc3uy7KK+FN1l+doJyfNWtvmhBr8RohG8mxJdiaRssrTg410V0GIZ iYtnq0jKkCTXrazDIzWgYrD2Ty+OcCo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724174496; a=rsa-sha256; cv=none; b=e+UJEqJiCUjsevoCeb9mxOvgbowuyfI/r9xHgUyzbHq7zr2znR9icYuiZzPvk8nB9xbufk QJpLyDhl7VXOlp1QotlallJCT3ini/lKgWElWNM9Cvi3/LXBryM0B8BoVANX2E4rseBgrR Ko9RSha++x4fizaEcU0MDwS7Q6FlXF0= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=C8P2ka7y; spf=pass (imf09.hostedemail.com: domain of mmaurer@google.com designates 209.85.208.52 as permitted sender) smtp.mailfrom=mmaurer@google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5bebb241fddso602a12.1 for ; Tue, 20 Aug 2024 10:22:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1724174572; x=1724779372; darn=kvack.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=T/1WG/9ldCtAUxEKSi+2OpNUvCL9Q6L1YzxrQLiosWY=; b=C8P2ka7yRgR9SEV7cAS4X3PcrwVJ+xGnguWv98OH9xYsuJNLS0VLsuaGVqDomiOOhW GhESpYb4LMnchBCmzzTHKiVXYXHtGKsZoeNKwC4YWxEdZERz5iZ65mvWcfafpfjO4f1l lC2VbG8LZGyWzMRTnlgl9vkFI+zEn5S5nqJjv/wBxtIeivmoiwXjW8I5NOPS69ZHizCs 0b5r1xLAhoOD+zQqi1dFUMurwljY7fAmZ62lcDiX4MRMavtxNWKr80Oplt1WogkOstKt QQ0luhZ0Rcw8oIf9uV2baqa3Pf7WhSK+ODUwP1asGvmuOchZaqPpJbi9twtH/qMyCcMk VRkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724174572; x=1724779372; 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=T/1WG/9ldCtAUxEKSi+2OpNUvCL9Q6L1YzxrQLiosWY=; b=ttqJJG7uiU3e8hMvgMgXkupXMRSjbu1yEPKrReySBl1/iXNyIqeRNB2wt2EvkxYBBz 3aLcWu74Bi2LvRIVSSC0Gd4+HSIsPw8rIaROv1MaogXeE/k7iEL6/pt6pi8vdR8RPqFt vhgyB8iQkghOrVM15xTDcNqL7DOyyc8zAHW728YtRtWQsBFvKlGG2Ej84KVSswMCtJnP da5qCoNivU65kFf6ogKvoWv6RtU0Jovf48v1dwLeHQDrO+B7k/0GOBSh6+Iol6LQBM3d 76JDzv/5RboFfojK7rH554bnWyyhk5mkPiaaIezzhRExewMNgO6zT9rfScr1txIqjQWY secA== X-Forwarded-Encrypted: i=1; AJvYcCWbE10OYhSx9LtS54lN5iRnLu+tqEHS2Llak2PyMUDIiiBjSd2p4SlpQr6yhT0iBOVbVn/WZ1guCQ==@kvack.org X-Gm-Message-State: AOJu0Yx9+iajNoQCpSOZCASEzr2+regVXZDJ9xpwwSd4Y4Wj+Uh2LMUJ 0/Ib74W06SR2iNwRElyM8h4QHZWk7XtPoNfzxTwPhyE5lgiNCA3lMBwn3YCodrfp3Bw/y/5jIaX BmVSpfzWa0l3XmFUp7JJdgin97qirqZMI0GyH X-Google-Smtp-Source: AGHT+IHnzEjfKJoOP6zSpqnlVKYAp79gjJZtHxgxIKFwml3ILU+99PRFpoeiHBZGo2fYFeU5opRvNpd5SUSI7TMWSrI= X-Received: by 2002:a05:6402:35c4:b0:5be:9bb0:1189 with SMTP id 4fb4d7f45d1cf-5bf0be0c727mr163175a12.2.1724174572142; Tue, 20 Aug 2024 10:22:52 -0700 (PDT) MIME-Version: 1.0 References: <20240819213534.4080408-1-mmaurer@google.com> <20240819213534.4080408-2-mmaurer@google.com> In-Reply-To: From: Matthew Maurer Date: Tue, 20 Aug 2024 10:22:39 -0700 Message-ID: Subject: Re: [PATCH v3 1/4] kbuild: rust: Define probing macros for rustc To: Miguel Ojeda Cc: dvyukov@google.com, ojeda@kernel.org, andreyknvl@gmail.com, Masahiro Yamada , Alex Gaynor , Wedson Almeida Filho , Nathan Chancellor , aliceryhl@google.com, samitolvanen@google.com, kasan-dev@googlegroups.com, linux-mm@kvack.org, glider@google.com, ryabinin.a.a@gmail.com, Nicolas Schier , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Nick Desaulniers , Bill Wendling , Justin Stitt , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 16502140031 X-Stat-Signature: oar8tyxahfznb9jq7aq4wzsnorxitnzt X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1724174573-791455 X-HE-Meta: U2FsdGVkX1/wKkzToFOusrMnCmocLU+B/pZsIPpDP0jqPyGl3qRB96TIFVrZtmN32Hgo4eiqelsFpXWDMoj/cgXUF7K5nlP8EaAbfSa+CIbWzEOulFNDT8mFXfwxTmG69YmcjHLbe/5X8ItE1yCXZlu4V8xYXz8hEYnA/lUh3BkOr2s87HHm8ynqlQ+8TI+zkMUSpHDvicIlUDVTt+B2xZywWTYLgtYBadTcYSByD4DxRkolEkfE4spH3Dc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ity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Aug 20, 2024 at 7:20=E2=80=AFAM Miguel Ojeda wrote: > > I had some feedback on v2 -- was it missed? > > https://lore.kernel.org/rust-for-linux/CANiq72khUrha-a+59KYZgc63w-3P9= =3DDp_fs=3D+sgmV_A17q+PTA@mail.gmail.com/ Sorry, I did miss that in the refresh. To respond to a few points before I send up a replacement for this patch: >> >> 1. `rustc` support will soon be a minimum rather than a pinned version. > In the meantime, this happened, so we should update this sentence. Will update. >> 2. We already support multiple LLVMs linked into `rustc`, and these are > I guess you mean `rustc` is able to use multiple major versions of > LLVM -- or what do you mean by "multiple LLVMs linked"? I meant that the `rustc` consumed by the kernel build may use a wide range of different LLVMs, including unreleased ones. This means that which options are valid fundamentally needs to be probed - there's not necessarily a clean "LLVM version" for us to use. I'll rephrase. >> +# $(rustc-option,) >> +# Return y if the Rust compiler supports , n otherwise >> +# Calls to this should be guarded so that they are not evaluated if >> +# CONFIG_HAVE_RUST is not set. >Hmm... why `HAVE_RUST`? Should that be `RUST_IS_AVAILABLE`? Or what is t>he intention? Perhaps a comment would help here -- e.g. something >like the comment I used in the original approach [1]. Otherwise we >will forget... :) Yes, this should be RUST_IS_AVAILABLE, will update. >Also, I guess you wanted to relax the precondition as much as >possible, which is great, just to double check, do we expect a case >outside `RUST=3Dy`? I expect this to be potentially used for whether you're *allowed* to set `RUST=3Dy` - for example, if a particular sanitizer is enabled, you may need to probe whether Rust+LLVM supports that sanitizer before allowing RUST to be set to y. >> rustc-option =3D $(success,trap "rm -rf .tmp_$$" EXIT; mkdir .tmp_$$; $(= RUSTC) $(1) --crate-type=3Drlib /dev/null -o .tmp_$$/tmp.rlib) >I also had `out-dir` [1] since, if I remember correctly, `rustc` may >create temporary files in a potentially read-only location even in >this case. OK, I will add that. >> Also, should we do `-Dwarnings` here? I don't think so - I can't think of a case where we'd want to error on a warning from an empty crate (though that may be a failure of imagination.) Do you have an example of a warning we might trip that we'd want to make the build reject an option's availability? > > Thanks! > > Cheers, > Miguel