[PATCH] gnu: linux-libre-documentation: Fix compilation.

  • Done
  • quality assurance status badge
Details
2 participants
  • Leo Famulari
  • Tomas Volf
Owner
unassigned
Submitted by
Tomas Volf
Severity
normal

Debbugs page

Tomas Volf wrote 1 years ago
(address . guix-patches@gnu.org)(name . Tomas Volf)(address . ~@wolfsden.cz)
25150d8343cac5ca79e4d1c7d40c538605529ba2.1707841329.git.~@wolfsden.cz
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.


* gnu/packages/linux.scm (linux-libre-documentation): Apply patch fixing
compilation.

Change-Id: Ic96f14aa25df09f38e029ca70d2647cbf37c2365
---
gnu/packages/linux.scm | 11 +++++++++++
1 file changed, 11 insertions(+)

Toggle diff (26 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index b8b119e474..49b9e01167 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -2003,6 +2003,17 @@ (define-public linux-libre-documentation
(package
(inherit linux-libre)
(name "linux-libre-documentation")
+ (source
+ (origin
+ (inherit linux-libre-source)
+ (patches
+ (list
+ (origin
+ (method url-fetch)
+ (uri "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/Documentation/sphinx/kernel_feat.py?id=c23de7ceae59e4ca5894c3ecf4f785c50c0fa428")
+ (sha256
+ (base32
+ "0inw2pl7nh82sw8bhvvzqa61552bisl78yc1nyl2x6dmpyppzrld")))))))
(arguments
(list
#:tests? #f

base-commit: e9a6c7094822bc859d0694eeaf8f434317219367
--
2.41.0
Leo Famulari wrote 1 years ago
(name . Tomas Volf)(address . ~@wolfsden.cz)
ZdKIzoOsoa6eX4HD@jasmine.lan
On Tue, Feb 13, 2024 at 05:22:09PM +0100, Tomas Volf wrote:
Toggle quote (15 lines)
> 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/linux.scm (linux-libre-documentation): Apply patch fixing
> compilation.

Thanks! Pushed to the 'kernel-updates' branch for testing:

Leo Famulari wrote 1 years ago
(name . Tomas Volf)(address . ~@wolfsden.cz)
ZdTZpM85anRnzZjq@jasmine.lan
On Sun, Feb 18, 2024 at 05:46:38PM -0500, Leo Famulari wrote:
Toggle quote (4 lines)
> Thanks! Pushed to the 'kernel-updates' branch for testing:
>
> https://ci.guix.gnu.org/eval/1128579

It failed to build due to a hash mismatch:

------
building path(s) `/gnu/store/1ps7177pmj9f4h8jf4dvrsq1ng6y5wxj-kernel_feat.py?id=c23de7ceae59e4ca5894c3ecf4f785c50c0fa428'
| @ build-started /gnu/store/cnjyqmajcv79w9xjbrxrmsq950kfs0c9-kernel_feat.py?id=c23de7ceae59e4ca5894c3ecf4f785c50c0fa428.drv - x86_64-linux /var/log/guix/drvs/cn//jyqmajcv79w9xjbrxrmsq950kfs0c9-kernel_feat.py?id=c23de7ceae59e4ca5894c3ecf4f785c50c0fa428.drv.gz 14230

Starting download of /gnu/store/1ps7177pmj9f4h8jf4dvrsq1ng6y5wxj-kernel_feat.py?id=c23de7ceae59e4ca5894c3ecf4f785c50c0fa428

 kernel_feat.py 14.0MiB/s 00:00 | 2KiB transferred
 kernel_feat.py 5.6MiB/s 00:00 | 2KiB transferred
@ hash-mismatch /gnu/store/1ps7177pmj9f4h8jf4dvrsq1ng6y5wxj-kernel_feat.py?id=c23de7ceae59e4ca5894c3ecf4f785c50c0fa428 sha256 0inw2pl7nh82sw8bhvvzqa61552bisl78yc1nyl2x6dmpyppzrld 0zzs7xfq7mhw30lqssz1ypkf35f3sw1zivz8abd8g8qwfbb6h2aa
hash mismatch for store item '/gnu/store/1ps7177pmj9f4h8jf4dvrsq1ng6y5wxj-kernel_feat.py?id=c23de7ceae59e4ca5894c3ecf4f785c50c0fa428'
@ build-failed /gnu/store/cnjyqmajcv79w9xjbrxrmsq950kfs0c9-kernel_feat.py?id=c23de7ceae59e4ca5894c3ecf4f785c50c0fa428.drv - 1 hash mismatch for store item '/gnu/store/1ps7177pmj9f4h8jf4dvrsq1ng6y5wxj-kernel_feat.py?id=c23de7ceae59e4ca5894c3ecf4f785c50c0fa428'
building path(s) `/gnu/store/6wvmyhb2fz08jgbnfpny2iqrlz4cp1mi-linux-6.6.17.tar.xz'
------

Tomas Volf wrote 1 years ago
[PATCH v2] gnu: linux-libre-documentation: Fix compilation.
(address . 69105@debbugs.gnu.org)
c8b84010194e489181067c52d67436b866292154.1708453575.git.~@wolfsden.cz
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.


* 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

Toggle diff (88 lines)
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 <vegard.nossum@oracle.com>
+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 <jforbes@fedoraproject.org>
+Cc: Salvatore Bonaccorso <carnil@debian.org>
+Cc: Jani Nikula <jani.nikula@intel.com>
+Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
+Cc: stable@vger.kernel.org
+Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
+Link: https://lore.kernel.org/r/20240205175133.774271-2-vegard.nossum@oracle.com
+Signed-off-by: Jonathan Corbet <corbet@lwn.net>
+---
+ 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
+

base-commit: e9a6c7094822bc859d0694eeaf8f434317219367
--
2.41.0
Tomas Volf wrote 1 years ago
Re: [bug#69105] [PATCH] gnu: linux-libre-documentation: Fix compilation.
(name . Leo Famulari)(address . leo@famulari.name)
ZdTvfJi0eN6nS1Nc@ws
On 2024-02-20 11:56:04 -0500, Leo Famulari wrote:
Toggle quote (24 lines)
> On Sun, Feb 18, 2024 at 05:46:38PM -0500, Leo Famulari wrote:
> > Thanks! Pushed to the 'kernel-updates' branch for testing:
> >
> > https://ci.guix.gnu.org/eval/1128579
>
> It failed to build due to a hash mismatch:
>
> ------
> building path(s) `/gnu/store/1ps7177pmj9f4h8jf4dvrsq1ng6y5wxj-kernel_feat.py?id=c23de7ceae59e4ca5894c3ecf4f785c50c0fa428'
> | @ build-started /gnu/store/cnjyqmajcv79w9xjbrxrmsq950kfs0c9-kernel_feat.py?id=c23de7ceae59e4ca5894c3ecf4f785c50c0fa428.drv - x86_64-linux /var/log/guix/drvs/cn//jyqmajcv79w9xjbrxrmsq950kfs0c9-kernel_feat.py?id=c23de7ceae59e4ca5894c3ecf4f785c50c0fa428.drv.gz 14230
>
> Starting download of /gnu/store/1ps7177pmj9f4h8jf4dvrsq1ng6y5wxj-kernel_feat.py?id=c23de7ceae59e4ca5894c3ecf4f785c50c0fa428
> From https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/Documentation/sphinx/kernel_feat.py?id=c23de7ceae59e4ca5894c3ecf4f785c50c0fa428...
>
>  kernel_feat.py 14.0MiB/s 00:00 | 2KiB transferred
>  kernel_feat.py 5.6MiB/s 00:00 | 2KiB transferred
> @ hash-mismatch /gnu/store/1ps7177pmj9f4h8jf4dvrsq1ng6y5wxj-kernel_feat.py?id=c23de7ceae59e4ca5894c3ecf4f785c50c0fa428 sha256 0inw2pl7nh82sw8bhvvzqa61552bisl78yc1nyl2x6dmpyppzrld 0zzs7xfq7mhw30lqssz1ypkf35f3sw1zivz8abd8g8qwfbb6h2aa
> hash mismatch for store item '/gnu/store/1ps7177pmj9f4h8jf4dvrsq1ng6y5wxj-kernel_feat.py?id=c23de7ceae59e4ca5894c3ecf4f785c50c0fa428'
> @ build-failed /gnu/store/cnjyqmajcv79w9xjbrxrmsq950kfs0c9-kernel_feat.py?id=c23de7ceae59e4ca5894c3ecf4f785c50c0fa428.drv - 1 hash mismatch for store item '/gnu/store/1ps7177pmj9f4h8jf4dvrsq1ng6y5wxj-kernel_feat.py?id=c23de7ceae59e4ca5894c3ecf4f785c50c0fa428'
> building path(s) `/gnu/store/6wvmyhb2fz08jgbnfpny2iqrlz4cp1mi-linux-6.6.17.tar.xz'
> ------
>
> https://ci.guix.gnu.org/build/3508584/details

I see, I guess it was a mistake trying to fetch the patch in this way. I've
sent a v2 that just adds it into the patches/ directory. I hope that will work
fine.

Have a nice day,
Tomas Volf

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmXU73wACgkQL7/ufbZ/
wamjmRAAqcJ55MWikoKFpH8thWJiAv/Yi1Y9NGu1NBXx7q+pnTeeX9njwvBih1sO
0NMKL59IQlf4xMkslRk8cpiMXf2KA9K1uayw7R1SBDV21zJYukswxZG9z8x357Ji
PIF3GoMkB0s3xsH3vCnSuDvLxLIUKfrjJIclbBcSL41t/vGKLARmS/OtJixlI2Fg
TMiAOyBR/LJju47PNJw0e2g0UWezQiivknNqJvP7FZy1OJ+H47AnyB4muWKi5hUJ
lga+UhypasnJr5LszvJfoV7nqXENvBdl0jsgOl9y1vM79iUWhmQJNbZFTGOhq8tU
JieF++iNZf4wKMVi8pbnOw+IXRQhstk4dB0M9EZutmb7UH+KQaRjT59R64At91q/
jRv5+Utqs+AOgLUsHSJSQhrlbrMNrrfoT6DQO67yQWeEPinye+HK8oXNAkWWW69N
kY7oyj4EmUhLAqk8HoMJYDlVnNHUbPmBCYO7UwGr6g8As2tEnlSyw7/cP/Qm5vLL
6R80dqEA6u3qX68XEqfq0s7o0FDWpjyGEewAKRjLVFqDa7RRWOEU3s1TdJHrQ6io
dUADxoczZswjP6+g9LVqIPDfVE0+1+VTh2pM8cH8HoOSmP1+DPSwJQTY9+jPPxkq
E78IbxgSEzwLmNg6aeLe8KnN5zw41egZArL4rn4oVOJahMVGWEs=
=Ovau
-----END PGP SIGNATURE-----


Leo Famulari wrote 1 years ago
(name . Tomas Volf)(address . ~@wolfsden.cz)
ZdVTNQmSL3UQhIfG@jasmine.lan
On Tue, Feb 20, 2024 at 07:29:16PM +0100, Tomas Volf wrote:
Toggle quote (4 lines)
> I see, I guess it was a mistake trying to fetch the patch in this way. I've
> sent a v2 that just adds it into the patches/ directory. I hope that will work
> fine.

I double-checked the hash and your original patch had the correct value.

For some reason, when the build farm tried to download the patch file
from the kernel infrastructure, the wrong data was received and the hash
did not match.

But when I downloaded the patch file "by hand" with `curl`, I received
the expected data.

Then, I applied your patch to a checkout of guix.git and successfully
built linux-libre-documentation with `./pre-inst-env [...]`.

So, I think your original patch is good.

Sometimes these transient errors occur. Including the patch directly in
our repo would be more reliable than fetching it, but there is the minor
negative effect of increasing the size of our codebase. I chose to fetch
the data in this case.

Thank you very much for working on this bug!

Patch version 1 pushed as b6f82b9ef1a3d51a39995598eab9f793656e9123
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEaEByLu7k06ZO5T6saqwZY3V/R/8FAmXVUzUACgkQaqwZY3V/
R/+Y6Q/9E+ZHqGXjZduLHGm89OTq4Letkpc5P2WJjf31MEXF87cTbLu8AV/sO6RW
4PCmHH1TopkchO3k+GAFP2vPESj35+xE4/pJ/i160riYZSVu5P0R/O3wK/2GxTv8
0lzXo5qexWPVAjzLMJzhzoRZnAhHxjeBWtiMAHmRgMRYpRLP9wCyfuje32oFyBMK
LbopuOYAgac81o8GL4hAia59ckskXC6BR+fsezcih6fdvFkMSI9gx3KFkaIVzrI8
d9sp9KGI/6XHl3mFiG07LzSIWrQfWOrtIqCc/hIElaLBFrNToN1WlEFYUGLqyEd1
KE1/MRHBfyAHJYcT7ExGiPxvsedVmWn0MOXkz7uJYTYn2AV1EGO0vFZNVuCMVza1
MzbSWfT/QdLiNXMHhTJ++NgbrTsAc9X7DXDypRnnPxV+yqv6BU1fxUsk9QMkNy5f
h5dDvtKpSfb4ldvuzg9x45FzjPYJ37cJ5x4GlXWtRG3w/y+y3TSd4uAhb6Ehs7cr
rGXhhzLMJoEntUweP0tVNicDYEjmXj6tEjaPruMWXStqOEti3aJkE2eqb1g+CZrU
hkMrA4l5dhA7vDpbt+8QCddq7yCd5BJbk6pL6STCd6V8tubzLPq2vt8ZuJ+zjqmZ
I+JoKETpmktuCSwbWsF+VMf2hcoZ9ETqABM5MxfBdoqaIvegBlA=
=TkEG
-----END PGP SIGNATURE-----


Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 69105@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 69105
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help