From patchwork Wed Dec 28 17:46:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Bilbao X-Patchwork-Id: 37255 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2010120wrt; Wed, 28 Dec 2022 09:51:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXv2cAQnBiOouV8UptgKwQjxKE0bL+2JcynHfTIslcmkHkNQWLn606+YB3/ZX7ZCO/d7+M5e X-Received: by 2002:a05:6402:88d:b0:467:956b:1610 with SMTP id e13-20020a056402088d00b00467956b1610mr21632101edy.0.1672249883894; Wed, 28 Dec 2022 09:51:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672249883; cv=pass; d=google.com; s=arc-20160816; b=cgpFyCpwYEfYne4iKDxmvC9d6+srWZQ2lC+zLmdSfFwxnYuieSVj5aFU7u3+V+tILe EU3EKYFhp6dCZZROQ5K3kONkVljXFzqy6Ncc35GA9IHrfvEMk9oDw9vO3e3nKaz8fBTg cgU+Env+ixbhn0+skC6sY44rqhvJL/ZYHILkwmEAx509vgVJnvff1f7NQs8juEyrdH4p AJ9DLqpA2jpH1mFp4b49QqVmhydNXvzadUG2OSLqNDmO/TpZbKTgEVVww+9YwwcF1vXF a6BpDPG3PMwJzI+KrfGznHEFemS790bnzP5OaXHNLcPuR7y1IhnbodjC+nxyXX9CoT8b 6tAg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eEvYD05+DILWPF29H57c5xi+s7dBsP1BYajS+dY1OuA=; b=oRRGqniDZLavwuwnj0WixDNR1kWLQRIciryju9A92zatkzK8SXwJtg90Xy8zG3ysH0 nIWhh9gdIZ8cCgkCw9lCk9hWOM6c9EFVv3pTQluIdUGpc6jez8zx3GeX0GMLNJOBeRI+ GkQufOm6FhO8Rqnm3AGffYOE8/59Y9YoeAKPBxGT4w4DMiguKl2fLYXxJNWwqjBDnK0j 9pmHDw2ocEN4hMWO/NMSsuLk8OyxLL652d2GhWNUfik2uECLWe/a9tx6gRlB7SKW13FD DGUzOhGHLFyaVJ4M421tmUruBBWaoqbfw6gXFIzPnrnDjAVfvyxcRCMdVI97tWXdNISC Ln+w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="0WW/TmMu"; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u4-20020aa7d884000000b00473204b6c93si13433407edq.372.2022.12.28.09.50.57; Wed, 28 Dec 2022 09:51:23 -0800 (PST) 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=@amd.com header.s=selector1 header.b="0WW/TmMu"; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233769AbiL1Rqg (ORCPT + 99 others); Wed, 28 Dec 2022 12:46:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233411AbiL1Rqa (ORCPT ); Wed, 28 Dec 2022 12:46:30 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2071.outbound.protection.outlook.com [40.107.92.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B11D6CD4; Wed, 28 Dec 2022 09:46:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mjfQwGR+9dN/zsRG8EyonRLIX2152uNjqBRWCllODUdPlJmyWm6Qv4143bS1ShXwSoLeES90+NURsbk5MdJbHIlHdrNczqyMkzROcIeokuPuR1ISuM5bCWbqKmRCX8xNnaDgXwaEorlbtME0qmPtUPhX+2UB6oe7wsgZuNIp/2s/JqyRtPm7rBCplAvI3iHlKoqcID0eIBaYYIGICSH6JEqm67kWbXdDfQcIgeD9KKTxzECPTACwGeIKInw+d4O1gsKoc8vacdmtPr+be5UjQEe6Tsc5mc39n+6oZo1sgDjAs4A0d6ZquX769fVvHDwfm5yKSHAoM33GYKgBWBNCkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eEvYD05+DILWPF29H57c5xi+s7dBsP1BYajS+dY1OuA=; b=lahCGdCXLKG3adi0VmAwyLun3lLaXphRRugl8/E8u2xb19rN0qpVWIAWhM+d/sFUbRzLvGVUUin5fxLDMqjkwYUDzPogBkkhuwpYACKRxnEow/kHzMpskYqUAcGNvR0pg+SAdlhp094ez/Hth8Zv1yF5UV+oFQOCISiuCLJaj14nHqtEk24XDbJ8wYfSgmWTf2z2TMs9I+xEbWyPcS59Y51N0mJ6QJe3QgFzp4Gd1OPb25w1C6HbTVwHVLoUPbSciQ8achBf6ca6TAHO91ejEkRFmrtKx8+aYauMnK+r5AMC+fof78vMp4zdnX4dX+527G7Fb5s8fABLptLR+6fUFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eEvYD05+DILWPF29H57c5xi+s7dBsP1BYajS+dY1OuA=; b=0WW/TmMuRixjQoIfiOzhak3mgxCq9IAzqCbk/nqjY4QUoa1RRaLUFvWzgatMCtNDMAxSPdPiCIecWOE7f19LXeFffgyQNd6ERUpZu0nmhYe1t3inz/CRlka0735emjAgsuuU8UjHvPepNZDPVYt+wwwLs+ykNkLjuU+GBTjLAWc= Received: from MW4PR04CA0281.namprd04.prod.outlook.com (2603:10b6:303:89::16) by CH0PR12MB5185.namprd12.prod.outlook.com (2603:10b6:610:b8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Wed, 28 Dec 2022 17:46:26 +0000 Received: from CO1NAM11FT084.eop-nam11.prod.protection.outlook.com (2603:10b6:303:89:cafe::84) by MW4PR04CA0281.outlook.office365.com (2603:10b6:303:89::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.17 via Frontend Transport; Wed, 28 Dec 2022 17:46:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1NAM11FT084.mail.protection.outlook.com (10.13.174.194) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5944.17 via Frontend Transport; Wed, 28 Dec 2022 17:46:26 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 28 Dec 2022 11:46:25 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 28 Dec 2022 11:46:24 -0600 Received: from iron-maiden.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Wed, 28 Dec 2022 11:46:24 -0600 From: Carlos Bilbao To: , , , , CC: , , , Carlos Bilbao Subject: [PATCH v5 1/2] docs: Move rustdoc output, cross-reference it Date: Wed, 28 Dec 2022 11:46:22 -0600 Message-ID: <20221228174623.144199-2-carlos.bilbao@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221228174623.144199-1-carlos.bilbao@amd.com> References: <20221207173053.1463800-1-carlos.bilbao@amd.com> <20221228174623.144199-1-carlos.bilbao@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT084:EE_|CH0PR12MB5185:EE_ X-MS-Office365-Filtering-Correlation-Id: 6246acff-361f-4c78-d139-08dae8fb7157 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wrdnr6FTgSDEM4DxMHTYm6RdT1AOqCujDODHEpPX4vmigs/1x/x49nzmL1v0/kHIBfrst6tUD35FFE6e/vo4nBWOAtQsFSYzeAVGNtPOsehnllOiN801xV3qnkzVPF+4hu0WHkKCZRQiSSk/HnC+01PWZfTWdgo/lokf68qA1P2SUDLzMiidCESZwHEiVUVEqg4YoJvn3H9Aoe4oLmm0zmkcZwBCYbPDy80qQxtxUVlajkSVuE8RElw1ZG0dKWPzAbg8J+9rjTLdWDjKZijGzh2rWWrxp45SiZflDELPjUjkpvE5zbaPjx4KWhZafTBMlTnRUj5y46P4ICbinfkdwc40881iJGwKdtvBARRNuNc/9G1Ldyu5zcMR0epueNIFO++JDqjILObHkavW7kHr7yTiGGyPKQjX5vaqJg5vMRyb9gw/bSKwZLnyn8ffTHho4/O5FtZzz/wJMY7HkqqOIx3KahBcUZkwfP15lwSOH6pO/8ZDZQQWrd22BdFBtaTyBoW5lAg0lIzKpCcesUHYGW8kam9YgFx8l+n62mWPN65bPUAeG5sXWL2MbqIGtTRN1Jm4z74Cjvh3ytmkwixm+ovaIkSOHx/YRFk3zWRifOF6VyNtsqK9iNTPKwz3N8ft8+4hoowVnWsGJ9hrpsAK5bAb42f0xaY6fEDA+CKuFvK9mnyZbYDr+kN5mAGZ8/Rwt7H/i+czQZchr3NCF7dVhouApn/EcC6ZKOHKSGCsh+U= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(136003)(346002)(396003)(376002)(451199015)(46966006)(40470700004)(36840700001)(54906003)(110136005)(40460700003)(83380400001)(2906002)(316002)(36756003)(44832011)(2616005)(478600001)(1076003)(82740400003)(26005)(356005)(186003)(82310400005)(81166007)(47076005)(426003)(7696005)(36860700001)(336012)(86362001)(8676002)(41300700001)(8936002)(4326008)(40480700001)(70206006)(70586007)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2022 17:46:26.0800 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6246acff-361f-4c78-d139-08dae8fb7157 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT084.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5185 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751578111812195040?= X-GMAIL-MSGID: =?utf-8?q?1753481094363151398?= Generate rustdoc documentation with the rest of subsystem's documentation in Documentation/output. Add a cross reference to the generated rustdoc in Documentation/rust/index.rst if Sphinx target rustdoc is set. Reviewed-by: Akira Yokosawa Signed-off-by: Carlos Bilbao --- Documentation/rust/index.rst | 8 ++++++++ rust/Makefile | 15 +++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Documentation/rust/index.rst b/Documentation/rust/index.rst index 4ae8c66b94fa..e599be2cec9b 100644 --- a/Documentation/rust/index.rst +++ b/Documentation/rust/index.rst @@ -6,6 +6,14 @@ Rust Documentation related to Rust within the kernel. To start using Rust in the kernel, please read the quick-start.rst guide. +.. only:: rustdoc and html + + You can also browse `rustdoc documentation `_. + +.. only:: not rustdoc and html + + This documentation does not include rustdoc generated information. + .. toctree:: :maxdepth: 1 diff --git a/rust/Makefile b/rust/Makefile index ff70c4c916f8..04f4ee3a193e 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -1,5 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 +# Where to place rustdoc generated documentation +RUSTDOC_OUTPUT = $(objtree)/Documentation/output/rust/rustdoc + always-$(CONFIG_RUST) += target.json no-clean-files += target.json @@ -64,7 +67,7 @@ quiet_cmd_rustdoc = RUSTDOC $(if $(rustdoc_host),H, ) $< OBJTREE=$(abspath $(objtree)) \ $(RUSTDOC) $(if $(rustdoc_host),$(rust_common_flags),$(rust_flags)) \ $(rustc_target_flags) -L$(objtree)/$(obj) \ - --output $(objtree)/$(obj)/doc \ + --output $(RUSTDOC_OUTPUT) \ --crate-name $(subst rustdoc-,,$@) \ @$(objtree)/include/generated/rustc_cfg $< @@ -81,15 +84,15 @@ quiet_cmd_rustdoc = RUSTDOC $(if $(rustdoc_host),H, ) $< # and then retouch the generated files. rustdoc: rustdoc-core rustdoc-macros rustdoc-compiler_builtins \ rustdoc-alloc rustdoc-kernel - $(Q)cp $(srctree)/Documentation/images/logo.svg $(objtree)/$(obj)/doc - $(Q)cp $(srctree)/Documentation/images/COPYING-logo $(objtree)/$(obj)/doc - $(Q)find $(objtree)/$(obj)/doc -name '*.html' -type f -print0 | xargs -0 sed -Ei \ + $(Q)cp $(srctree)/Documentation/images/logo.svg $(RUSTDOC_OUTPUT) + $(Q)cp $(srctree)/Documentation/images/COPYING-logo $(RUSTDOC_OUTPUT) + $(Q)find $(RUSTDOC_OUTPUT) -name '*.html' -type f -print0 | xargs -0 sed -Ei \ -e 's:rust-logo\.svg:logo.svg:g' \ -e 's:rust-logo\.png:logo.svg:g' \ -e 's:favicon\.svg:logo.svg:g' \ -e 's:::g' $(Q)echo '.logo-container > img { object-fit: contain; }' \ - >> $(objtree)/$(obj)/doc/rustdoc.css + >> $(RUSTDOC_OUTPUT)/rustdoc.css rustdoc-macros: private rustdoc_host = yes rustdoc-macros: private rustc_target_flags = --crate-type proc-macro \ @@ -150,7 +153,7 @@ quiet_cmd_rustdoc_test = RUSTDOC T $< @$(objtree)/include/generated/rustc_cfg \ $(rustc_target_flags) $(rustdoc_test_target_flags) \ --sysroot $(objtree)/$(obj)/test/sysroot $(rustdoc_test_quiet) \ - -L$(objtree)/$(obj)/test --output $(objtree)/$(obj)/doc \ + -L$(objtree)/$(obj)/test --output $(RUSTDOC_OUTPUT) \ --crate-name $(subst rusttest-,,$@) $< # We cannot use `-Zpanic-abort-tests` because some tests are dynamic,