From patchwork Wed Oct 18 15:55:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miguel Ojeda X-Patchwork-Id: 154947 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4890906vqb; Wed, 18 Oct 2023 08:56:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHC82j9KOjEnU1cprRfw2dbQfmkpWrXKwvRF9BLX5eR6LG/OE6pOR7bv59BX7axIJChqdBS X-Received: by 2002:a05:6830:6e9a:b0:6c7:aab5:6e50 with SMTP id ed26-20020a0568306e9a00b006c7aab56e50mr7357174otb.2.1697644590217; Wed, 18 Oct 2023 08:56:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697644590; cv=none; d=google.com; s=arc-20160816; b=cNtIzzq0Tgra8unxfxxG6OQT0rAQEcwByT5jLn6qqLmvKbZkLFDubcVDeAVqFmDxE9 RdWPlJPMUPIOQQEZxvkwSBFCAddtcQwRr8xuYL9xhbVvzKMFU3eoltX1aRrXyytVScIy 6AClYGlxJNAvRGcsIeYDgc5N+gkAzpeJeioO3E+wJ/utNXT1/uWmfe3ksbTmBzK9/LXp lnJ3/4aSsm4CPuhBmK2ziEdJKnWcD2l1N9OpiKaRdFFlu+GZbYHvksMzk/g1BmzfJeqW 6SN/6PuGeA4uxf6VlVlYAJjwi9iBKdXZPtUXoMJrnRXwXhIj0JMmTQHgDUCuLJjTQKa/ ImYw== 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:date:subject:cc:to:from:dkim-signature; bh=CnozprX7+HHuLB4v7t0hIj5PGUjtIlMXFqnu2/k1YG0=; fh=7xg1uVJO0dHe8NoZyQe/oF8KJzkAzzTLebWjOhseT3s=; b=u8QD2hTnOfd9/ra/KjPZm0mbkMK9oTCOycbQcs+GC8Jf0xtTCGG9XC7/bjH1apb/jQ L9s8mUAdhMkSgwBUtXt55m57UGvuEhmDndphZkbZjlz6DHhdATgQog/OFNzhtc3+NNi5 tesFQlkf4SApB5mTT+KJnQalMJYQ/doYfkfmeeKpiwI74CXw5R9o6zy+Q6gd4Q3pVRkn zuMg7mIIGouT3iW1f6ATqAAZJH3fXcaNaR6A4k+0f3Q3xccD39ONf2TTgkW0KOflOb8Z /XF1utTEcn2LL6lNrq7tOOmIdDcj6f2kofLslAQC+Ve5mrkosE7pQmqQeoRyEJAzlV/3 8Dgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cOBM6IcD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id x13-20020aa79a4d000000b006bd92721f4esi4218648pfj.293.2023.10.18.08.56.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 08:56:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cOBM6IcD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 2324C8032BA7; Wed, 18 Oct 2023 08:56:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344782AbjJRP4A (ORCPT + 23 others); Wed, 18 Oct 2023 11:56:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232191AbjJRPz6 (ORCPT ); Wed, 18 Oct 2023 11:55:58 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF20C125; Wed, 18 Oct 2023 08:55:56 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84DC7C433C7; Wed, 18 Oct 2023 15:55:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697644556; bh=QOxEFIuVVtPbHt6SDOXDaVCFqda4cdEMS/w7hpcXpcY=; h=From:To:Cc:Subject:Date:From; b=cOBM6IcDPq8PDGVpDXBEVv2ba4ZO3hdCRkDH99bm77Lm0p9dV07OIINqZGvUli5kW 393SvZ2692e9Fm6JpK5M+pUYen/CfJ8cEkLgIPpHSnc8ZPsZUSzrEZKLTYOYIZXuws zctziMrDbUICAaZl8dzV9yyBm3Ij9I8MuBfYGe0x+ipPe2748ZDpdQebMcGCmuE8Ei RR2qjbaefdWlVhex7QO6OKYUhHCfKVR68q/klDBXpBimYRdUJA58dK2GK45ZJqLz+4 5+4o702K+xpZPiVl6aK/cZgGZlX5jTGz3K0JHczF50iUsNM0qQ5+1pu7AYvcsO2PmN 1kShxUpTolNRA== From: Miguel Ojeda To: Miguel Ojeda , Wedson Almeida Filho , Alex Gaynor Cc: Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, stable@vger.kernel.org Subject: [PATCH] rust: docs: fix logo replacement Date: Wed, 18 Oct 2023 17:55:27 +0200 Message-ID: <20231018155527.1015059-1-ojeda@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 18 Oct 2023 08:56:12 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780109373951928048 X-GMAIL-MSGID: 1780109373951928048 The static files placement by `rustdoc` changed in Rust 1.67.0 [1], but the custom code we have to replace the logo in the generated HTML files did not get updated. Thus update it to have the Linux logo again in the output. Hopefully `rustdoc` will eventually support a custom logo from a local file [2], so that we do not need to maintain this hack on our side. Link: https://github.com/rust-lang/rust/pull/101702 [1] Link: https://github.com/rust-lang/rfcs/pull/3226 [2] Fixes: 3ed03f4da06e ("rust: upgrade to Rust 1.68.2") Cc: stable@vger.kernel.org Signed-off-by: Miguel Ojeda Tested-by: Benno Lossin Reviewed-by: Andreas Hindborg --- rust/Makefile | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/rust/Makefile b/rust/Makefile index 87958e864be0..08af1f869f0c 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -93,15 +93,14 @@ 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 $(rustdoc_output) - $(Q)cp $(srctree)/Documentation/images/COPYING-logo $(rustdoc_output) + $(Q)cp $(srctree)/Documentation/images/logo.svg $(rustdoc_output)/static.files/ + $(Q)cp $(srctree)/Documentation/images/COPYING-logo $(rustdoc_output)/static.files/ $(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; }' \ - >> $(rustdoc_output)/rustdoc.css + -e 's:rust-logo-[0-9a-f]+\.svg:logo.svg:g' \ + -e 's:favicon-[0-9a-f]+\.svg:logo.svg:g' \ + -e 's:::g' + $(Q)for f in $(rustdoc_output)/static.files/rustdoc-*.css; do \ + echo ".logo-container > img { object-fit: contain; }" >> $$f; done rustdoc-macros: private rustdoc_host = yes rustdoc-macros: private rustc_target_flags = --crate-type proc-macro \