From patchwork Tue Feb 20 18:26:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Volf <~@wolfsden.cz> X-Patchwork-Id: 23849 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id AB22327BBEA; Tue, 20 Feb 2024 18:27:53 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4C6EC27BBE9 for ; Tue, 20 Feb 2024 18:27:52 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcUqF-0002da-0j; Tue, 20 Feb 2024 13:27:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcUqD-0002dA-BO for guix-patches@gnu.org; Tue, 20 Feb 2024 13:27:41 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rcUqD-0004Vx-2w for guix-patches@gnu.org; Tue, 20 Feb 2024 13:27:41 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rcUqX-0000a7-Q9; Tue, 20 Feb 2024 13:28:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69105] [PATCH v2] gnu: linux-libre-documentation: Fix compilation. References: <25150d8343cac5ca79e4d1c7d40c538605529ba2.1707841329.git.~@wolfsden.cz> In-Reply-To: <25150d8343cac5ca79e4d1c7d40c538605529ba2.1707841329.git.~@wolfsden.cz> Resent-From: Tomas Volf <~@wolfsden.cz> Original-Sender: "Debbugs-submit" Resent-CC: leo@famulari.name, me@tobias.gr, w@wmeyer.eu, guix-patches@gnu.org Resent-Date: Tue, 20 Feb 2024 18:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69105 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69105@debbugs.gnu.org Cc: Tomas Volf <~@wolfsden.cz>, leo@famulari.name, Leo Famulari , Tobias Geerinckx-Rice , Wilko Meyer X-Debbugs-Original-Xcc: Leo Famulari , Tobias Geerinckx-Rice , Wilko Meyer Received: via spool by 69105-submit@debbugs.gnu.org id=B69105.17084536422191 (code B ref 69105); Tue, 20 Feb 2024 18:28:01 +0000 Received: (at 69105) by debbugs.gnu.org; 20 Feb 2024 18:27:22 +0000 Received: from localhost ([127.0.0.1]:46533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcUpu-0000ZH-8h for submit@debbugs.gnu.org; Tue, 20 Feb 2024 13:27:22 -0500 Received: from wolfsden.cz ([37.205.8.62]:45794) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1rcUpo-0000Z2-PZ for 69105@debbugs.gnu.org; Tue, 20 Feb 2024 13:27:20 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id B8241295EA0; Tue, 20 Feb 2024 18:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1708453611; bh=XlBZSvUWWtysXsIeSE6Y2fKbPd8JwQC1vBW4ZOuiNRk=; h=From:To:Cc:Subject:Date; b=icYa8w+mWbADq7JTtMdePlt/PrhkTqwiMRRJYFIFCeVUKvRoLSWR8+mEQuYIxsGyR 5TlzXuYg7f/IzYvmjXZ4WssLueMaPA6wo6Ek/8+SnPBf0Hey/vcmBGMjs89A+fSyFh Myqr1zhdqzAK9qu666i6g0AlqNdbq9aeDRhij6+zzArXwAjf8hW8cezCHVuuPWWJRJ h3KAbggHOr8M7J6hR1Lvx28kJe8ovNktt7527MoSfXnaoTvdGWbbGSt9QPuTE5W9Yn ch6VPYeuIxZiPQCOZ5ID3pfoA/pa5hs3WIPs7xMGxmJTdYhbu4gxfLQcqn8bBfVEgJ ruPI7fCF8NawdlyBmAmX7aUrK/QlBd7h6kS2tG2N1xrpnpIafx9TzB/N91KOWZodPm JgEzCn0uXzoEEkpIUYlIXttKzqCgW5ibGZ+YJ/h9fyDKTri5kLymSdEiilJRt3AUp4 yF5nFnKkCRYLbxOSIi4X3vPDr4q43DrGh7LcEg/azfJRQ2EcXbMa1Ze/nwumOA3cXf X6uUPcvhpNj0h8bd25n7rnH0ytDuUKVcGluG9y+uG9lhfJoCXeal00zrtXltacK7uD zjKLNJnBnjXTESAEKw+j33tkBYR6VVnrEs8jTReodoUixzjg6VdxoQLSfQijnzTiwK s3hvKMDHbK/DLT3sqNOS8yKc= Received: from localhost (unknown [146.70.134.132]) by wolfsden.cz (Postfix) with ESMTPSA id D46E8253827; Tue, 20 Feb 2024 18:26:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1708453611; bh=XlBZSvUWWtysXsIeSE6Y2fKbPd8JwQC1vBW4ZOuiNRk=; h=From:To:Cc:Subject:Date; b=icYa8w+mWbADq7JTtMdePlt/PrhkTqwiMRRJYFIFCeVUKvRoLSWR8+mEQuYIxsGyR 5TlzXuYg7f/IzYvmjXZ4WssLueMaPA6wo6Ek/8+SnPBf0Hey/vcmBGMjs89A+fSyFh Myqr1zhdqzAK9qu666i6g0AlqNdbq9aeDRhij6+zzArXwAjf8hW8cezCHVuuPWWJRJ h3KAbggHOr8M7J6hR1Lvx28kJe8ovNktt7527MoSfXnaoTvdGWbbGSt9QPuTE5W9Yn ch6VPYeuIxZiPQCOZ5ID3pfoA/pa5hs3WIPs7xMGxmJTdYhbu4gxfLQcqn8bBfVEgJ ruPI7fCF8NawdlyBmAmX7aUrK/QlBd7h6kS2tG2N1xrpnpIafx9TzB/N91KOWZodPm JgEzCn0uXzoEEkpIUYlIXttKzqCgW5ibGZ+YJ/h9fyDKTri5kLymSdEiilJRt3AUp4 yF5nFnKkCRYLbxOSIi4X3vPDr4q43DrGh7LcEg/azfJRQ2EcXbMa1Ze/nwumOA3cXf X6uUPcvhpNj0h8bd25n7rnH0ytDuUKVcGluG9y+uG9lhfJoCXeal00zrtXltacK7uD zjKLNJnBnjXTESAEKw+j33tkBYR6VVnrEs8jTReodoUixzjg6VdxoQLSfQijnzTiwK s3hvKMDHbK/DLT3sqNOS8yKc= From: Tomas Volf <~@wolfsden.cz> Date: Tue, 20 Feb 2024 19:26:15 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches When compiling linux-libre-documentation@6.6.16, the compilation fails with following error message: Exception occurred: File "/tmp/guix-build-linux-libre-documentation-6.6.16.drv-0/linux-6.6.16/Documentation/sphinx/kernel_feat.py", line 112, in run nodeList = self.nestedParse(out_lines, fname) UnboundLocalError: local variable 'fname' referenced before assignment This is already fixed upstream[0], so this commit backports the change. 0: https://lore.kernel.org/all/20240206054907.066a0325@coco.lan/t/ * gnu/packages/patches/linux-libre-documentation-fix-kernel_feat.py.patch: Add patch. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/linux.scm (linux-libre-documentation): Use it. Change-Id: Ic96f14aa25df09f38e029ca70d2647cbf37c2365 --- v2: Commit the patch instead of fetching it. gnu/local.mk | 1 + gnu/packages/linux.scm | 5 ++ ...bre-documentation-fix-kernel_feat.py.patch | 52 +++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 gnu/packages/patches/linux-libre-documentation-fix-kernel_feat.py.patch base-commit: e9a6c7094822bc859d0694eeaf8f434317219367 -- 2.41.0 diff --git a/gnu/local.mk b/gnu/local.mk index ab690795a7..a75577386c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1629,6 +1629,7 @@ dist_patch_DATA = \ %D%/packages/patches/linphone-desktop-without-sdk.patch \ %D%/packages/patches/linux-libre-infodocs-target.patch \ %D%/packages/patches/linux-libre-support-for-Pinebook-Pro.patch \ + %D%/packages/patches/linux-libre-documentation-fix-kernel_feat.py.patch \ %D%/packages/patches/linux-pam-no-setfsuid.patch \ %D%/packages/patches/linux-pam-unix_chkpwd.patch \ %D%/packages/patches/linuxdcpp-openssl-1.1.patch \ diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index b8b119e474..c23f07b1d5 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -2003,6 +2003,11 @@ (define-public linux-libre-documentation (package (inherit linux-libre) (name "linux-libre-documentation") + (source + (origin + (inherit linux-libre-source) + (patches + (search-patches "linux-libre-documentation-fix-kernel_feat.py.patch")))) (arguments (list #:tests? #f diff --git a/gnu/packages/patches/linux-libre-documentation-fix-kernel_feat.py.patch b/gnu/packages/patches/linux-libre-documentation-fix-kernel_feat.py.patch new file mode 100644 index 0000000000..9d535395be --- /dev/null +++ b/gnu/packages/patches/linux-libre-documentation-fix-kernel_feat.py.patch @@ -0,0 +1,52 @@ +From c23de7ceae59e4ca5894c3ecf4f785c50c0fa428 Mon Sep 17 00:00:00 2001 +From: Vegard Nossum +Date: Mon, 5 Feb 2024 18:51:26 +0100 +Subject: docs: kernel_feat.py: fix build error for missing files + +If the directory passed to the '.. kernel-feat::' directive does not +exist or the get_feat.pl script does not find any files to extract +features from, Sphinx will report the following error: + + Sphinx parallel build error: + UnboundLocalError: local variable 'fname' referenced before assignment + make[2]: *** [Documentation/Makefile:102: htmldocs] Error 2 + +This is due to how I changed the script in c48a7c44a1d0 ("docs: +kernel_feat.py: fix potential command injection"). Before that, the +filename passed along to self.nestedParse() in this case was weirdly +just the whole get_feat.pl invocation. + +We can fix it by doing what kernel_abi.py does -- just pass +self.arguments[0] as 'fname'. + +Fixes: c48a7c44a1d0 ("docs: kernel_feat.py: fix potential command injection") +Cc: Justin Forbes +Cc: Salvatore Bonaccorso +Cc: Jani Nikula +Cc: Mauro Carvalho Chehab +Cc: stable@vger.kernel.org +Signed-off-by: Vegard Nossum +Link: https://lore.kernel.org/r/20240205175133.774271-2-vegard.nossum@oracle.com +Signed-off-by: Jonathan Corbet +--- + Documentation/sphinx/kernel_feat.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +(limited to 'Documentation/sphinx/kernel_feat.py') + +diff --git a/Documentation/sphinx/kernel_feat.py b/Documentation/sphinx/kernel_feat.py +index b9df61eb450138..03ace5f01b5c02 100644 +--- a/Documentation/sphinx/kernel_feat.py ++++ b/Documentation/sphinx/kernel_feat.py +@@ -109,7 +109,7 @@ class KernelFeat(Directive): + else: + out_lines += line + "\n" + +- nodeList = self.nestedParse(out_lines, fname) ++ nodeList = self.nestedParse(out_lines, self.arguments[0]) + return nodeList + + def nestedParse(self, lines, fname): +-- +cgit 1.2.3-korg +