Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2417236rwd; Mon, 15 May 2023 11:21:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4PeTYT27ebDs9YrEkeDW645tZnnmAJphUwMUPdYtHBMxILpoS4tUfkNt+Ky73xAWsj3BYX X-Received: by 2002:a05:6a00:2289:b0:63f:120a:1dc3 with SMTP id f9-20020a056a00228900b0063f120a1dc3mr47873103pfe.0.1684174865413; Mon, 15 May 2023 11:21:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684174865; cv=none; d=google.com; s=arc-20160816; b=yJ9USOgCeVQdgoHjbbuMPOB6w2tDFAngiY5WWCE10vcdMLT5MfhXEAVQgM6JqDoZNn 5PVL/Q6ENTnLGMjRvKHBTwfWnoOj41ZBGKVvMEwZQ+tDSIt4VFGTk68ktll/NzVt9iYQ ZYBXBfnbXMoRLqsNL5VIKocf5ygbhGIH8fYQS24ztdRgKpcz3n5ef7dViIx9P17tKqyw DMTpY/PCnFOks9BV2hrFlkUeKwCimT8gZ/5QptphLLLzp87DBSDinM2l4BUn1kwagQV3 O+qDeWa1fVklPTG03hqPgsIuErM8o6gg1fQcUNJ3mPc4TDh8TRkmOALUGQthXG1rcACt Ul8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:in-reply-to:date:subject:cc:to:from:user-agent :references:dkim-signature; bh=xmonrEr4WjNysQoQ1LLwqU/RtcUbfFNLN3JcLmX+2Vw=; b=WUuIw7CxxcV6xvib3e6IqwFnr+G01lyqGhI7S3GYDi2FZ5O6JS0mu4fBgkPWVbH+mQ 4h+NIw5Lwngh7bcCbR8dcJ6PxyLn6mcSDiVz8HDIvPCEd0kir5NQ2GnOy8rzzYR7rLLy H/odStJj9bJO4sOmj2a1+GQpbZzW+KFM4ByGAZ7ovdMrWXuW4YT1sqm/uf1Fk41TJcXV WOHmX1WI5+fd0EmsCqeilb+0JMlXCbFg91R9rMfV4R8nR+Hk8cDW5inKGrhwOP0aeoRq eI0QzTfokqVUzaGhMZCjlHdvckmNLzHDD7YdtK63fmAFcOJTQMvA9AcbU/Yiq6x1Qb5J P+6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@metaspace-dk.20221208.gappssmtp.com header.s=20221208 header.b=N5uK4Rw1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u132-20020a62798a000000b0064398a54dc8si18491151pfc.376.2023.05.15.11.20.52; Mon, 15 May 2023 11:21:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@metaspace-dk.20221208.gappssmtp.com header.s=20221208 header.b=N5uK4Rw1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245141AbjEOSNL (ORCPT + 99 others); Mon, 15 May 2023 14:13:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245136AbjEOSMu (ORCPT ); Mon, 15 May 2023 14:12:50 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 699041F329 for ; Mon, 15 May 2023 11:10:11 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-9659e9bbff5so2427356866b.1 for ; Mon, 15 May 2023 11:10:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=metaspace-dk.20221208.gappssmtp.com; s=20221208; t=1684174162; x=1686766162; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:from:to:cc:subject:date :message-id:reply-to; bh=xmonrEr4WjNysQoQ1LLwqU/RtcUbfFNLN3JcLmX+2Vw=; b=N5uK4Rw1dAlrxwugTedYBk3M57qUMUBdF+8n4U7MPPM0L4RynTMTFQLRGN93J9kYPd kiU8MzbSz+iS8H645FC4vKFetClKBouuHaufmIQ+PsMLQBsuLwBJkxxBhmMGc77LWoyV LHeGzdo6gRIH/EhTzLBo1RhjLxgVvGqEaBq5cXdsjHQt7Woe8pXXrXb/1VVSXz4v0soI Z8C2YOMMHMtiBaaVeyMH4Dx5ovMv9IJ0ZPhTMn7frPUocv2N43aD0Hp3qkkpy0kvQS9P VOckrsW/QVMasDiMmZoEk3CU8u8DuOAEE4g5su43zHfWrg2KlSwkZNwvaCQ4Jj8yhDD8 Rydw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684174162; x=1686766162; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=xmonrEr4WjNysQoQ1LLwqU/RtcUbfFNLN3JcLmX+2Vw=; b=GFIRpcDXlca9lzqXKLkX2UPm9qKP9SDv52FmQve7NQdJgzmHt1lxuptf0qVYiDZaGw r98EqP/8/Eoyf5QNbzPCMscI2BEM3xZf9AzMepu3HRqb4n2S7DDJjYFY3Fh1vnv3Rqta YQECTPIVSHhSejlV2Hm/m1qenFh1njfSfTWyFiu27wrLwaH8imaEtrApiPHokbikL3HN 61QLxDWaSFmmmYMBRXjk/3xq/Q5JGaL+XX8V2t1Rni4o4WZyPZZ4u6xGV7duutTPXgSf /CTKo7jzlBk1v+S1ULlYuInWgHwhnaPOxzr7oAjXvTdLVchlj7fQc/cvzH8C9Z5T4QDT F3QQ== X-Gm-Message-State: AC+VfDyuvq6CF5At5jdN0q1rJxCqPeSE1qbmrk062718LYszXp77csgl 9o8X5Pmfkg+6ZX+o/EhCQFq/0Q== X-Received: by 2002:a17:907:7b9c:b0:966:7a0a:28c0 with SMTP id ne28-20020a1709077b9c00b009667a0a28c0mr26586892ejc.58.1684174162347; Mon, 15 May 2023 11:09:22 -0700 (PDT) Received: from localhost ([79.142.230.34]) by smtp.gmail.com with ESMTPSA id x13-20020aa7cd8d000000b0050488d1d376sm7204332edv.0.2023.05.15.11.09.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 11:09:22 -0700 (PDT) References: <20230508124701.443ba331.gary@garyguo.net> <20230509080700.1608146-1-aliceryhl@google.com> <2023050937-scouring-truck-d7c0@gregkh> User-agent: mu4e 1.10.3; emacs 28.2.50 From: Andreas Hindborg To: Miguel Ojeda Cc: Greg KH , Alice Ryhl , gary@garyguo.net, alex.gaynor@gmail.com, benno.lossin@proton.me, bjorn3_gh@protonmail.com, boqun.feng@gmail.com, linux-kernel@vger.kernel.org, ojeda@kernel.org, patches@lists.linux.dev, rust-for-linux@vger.kernel.org, wedsonaf@gmail.com Subject: Re: [PATCH v2] rust: error: add missing error codes Date: Mon, 15 May 2023 20:07:12 +0200 In-reply-to: Message-ID: <875y8teab3.fsf@metaspace.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Miguel Ojeda writes: > On Tue, May 9, 2023 at 10:46=E2=80=AFAM Greg KH wrote: >> >> It depends on which arch you are building for. That's why we have >> per-platform errno.h files, the values are different for different ones. >> So you need to handle them all properly somehow. How is rust going to >> handle per-arch stuff like this? > > We can do conditional compilation in the same file, possibly with a > Rust macro which takes a nice table that shows all arches at once. > > We can also split into files like C and move it to each `arch/`, there > are a couple of approaches for this. This is best for `MAINTAINERS`, > although these headers almost never change, so it is not a big > advantage. > > We could also automatically do everything based on the C headers, too. > Back then it felt to me like too much complexity for little gain, > given those C headers almost never change, but now it may be worth it. > Or, instead, having a test that verifies they are the same instead, > and that way we don't introduce complexity for the build itself. > > Alice only needs `ERESTARTSYS` so far, as far as I understand, so > perhaps it is simplest to only add the rest of the non-generic ones > for the moment; and gather opinions on the approaches above meanwhile. Let's add the ones we need for now. When we need target specific error codes we can have a `mod` for each arch, gate behind the target feature and conditionally reexport them. BR Andreas