[PATCH] gnu (hubbub): Fix build

  • Done
  • quality assurance status badge
Details
2 participants
  • Andreas Enge
  • Andy Tai
Owner
unassigned
Submitted by
Andy Tai
Severity
normal

Debbugs page

Andy Tai wrote 2 years ago
(address . guix-patches@gnu.org)(name . Andy Tai)(address . atai@atai.org)
ca6047466544a6f9a52ea0f973ff7ec4e5e29884.1686190884.git.atai@atai.org

* gnu/packages/web.scm (hubbub): [source](patches): Add patch to fix build.
* gnu/packages/patches/hubbub-prevent-Werror-maybe-uninitialized-build-failure-wit.patch: New file
* gnu/local.mk (dist_patch_DATA): Add it.
---
gnu/local.mk | 2 +
...aybe-uninitialized-build-failure-wit.patch | 40 +++++++++++++++++++
gnu/packages/web.scm | 4 +-
3 files changed, 45 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/hubbub-prevent-Werror-maybe-uninitialized-build-failure-wit.patch

Toggle diff (85 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 254037a3af..099e653707 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -58,6 +58,7 @@
# Copyright © 2022 jgart <jgart@dismail.de>
# Copyright © 2023 Zheng Junjie <873216071@qq.com>
# Copyright © 2023 Ivana Drazovic <iv.dra@hotmail.com>
+# Copyright © 2023 Andy Tai <atai@atai.org>
#
# This file is part of GNU Guix.
#
@@ -1353,6 +1354,7 @@ dist_patch_DATA = \
%D%/packages/patches/http-parser-CVE-2020-8287.patch \
%D%/packages/patches/htslib-for-stringtie.patch \
%D%/packages/patches/hubbub-sort-entities.patch \
+ %D%/packages/patches/hubbub-prevent-Werror-maybe-uninitialized-build-failure-wit.patch \
%D%/packages/patches/hueplusplus-mbedtls.patch \
%D%/packages/patches/hurd-add-without-rump-configure-option.patch \
%D%/packages/patches/hurd-fix-types-of-read-write-and-readables-methods-2.patch \
diff --git a/gnu/packages/patches/hubbub-prevent-Werror-maybe-uninitialized-build-failure-wit.patch b/gnu/packages/patches/hubbub-prevent-Werror-maybe-uninitialized-build-failure-wit.patch
new file mode 100644
index 0000000000..6f289a770e
--- /dev/null
+++ b/gnu/packages/patches/hubbub-prevent-Werror-maybe-uninitialized-build-failure-wit.patch
@@ -0,0 +1,40 @@
+From 69d81a8a4d4c223aad67cde0fdf64d64351b9802 Mon Sep 17 00:00:00 2001
+From: Andy Tai <atai@atai.org>
+Date: Sat, 27 May 2023 00:01:34 -0700
+Subject: [PATCH] prevent -Werror=maybe-uninitialized build failure with gcc 11
+ when building tests tokeniser2 and tokeniser3
+
+---
+ test/tokeniser2.c | 2 +-
+ test/tokeniser3.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/test/tokeniser2.c b/test/tokeniser2.c
+index c8ab9c0..4caae38 100644
+--- a/test/tokeniser2.c
++++ b/test/tokeniser2.c
+@@ -438,7 +438,7 @@ hubbub_error token_handler(const hubbub_token *token, void *pw)
+ /* Expected token only contained part of the data
+ * Calculate how much is left, then try again with
+ * the next expected token */
+- hubbub_token t;
++ hubbub_token t = { 0 };
+
+ t.type = HUBBUB_TOKEN_CHARACTER;
+ t.data.character.ptr += len;
+diff --git a/test/tokeniser3.c b/test/tokeniser3.c
+index e33d018..b3be901 100644
+--- a/test/tokeniser3.c
++++ b/test/tokeniser3.c
+@@ -447,7 +447,7 @@ hubbub_error token_handler(const hubbub_token *token, void *pw)
+ /* Expected token only contained part of the data
+ * Calculate how much is left, then try again with
+ * the next expected token */
+- hubbub_token t;
++ hubbub_token t = { 0 };
+
+ t.type = HUBBUB_TOKEN_CHARACTER;
+ t.data.character.ptr += len;
+--
+2.40.1
+
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 3af4aa0b8d..387ceac058 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -5242,7 +5242,9 @@ (define-public hubbub
(sha256
(base32
"1dimfyblmym98qa1b80c5jslv2zk8r44xbdrgrsrw1n9wr9y4yly"))
- (patches (search-patches "hubbub-sort-entities.patch"))))
+ (patches (search-patches
+ "hubbub-sort-entities.patch"
+ "hubbub-prevent-Werror-maybe-uninitialized-build-failure-wit.patch"))))
(build-system gnu-build-system)
(native-inputs
(list netsurf-buildsystem

base-commit: e8f9fb3e03ea8fee0e13f13706a6b16414f74a7b
--
2.40.1
Andy Tai wrote 2 years ago
Re:
(name . GNU bug tracker automated control server)(address . control@debbugs.gnu.org)
CAJsg1E-HnVA3CbAaA+jtsxMG2Gpq0SU8wkej1Fr8fir8QYVoYA@mail.gmail.com
unblock 63526 by 63592
block 63526 by 63952
Andreas Enge wrote 2 years ago
Re: ping on a build fix for a build failure (main branch)
(name . Andy Tai)(address . atai@atai.org)
ZIMH8od9OFbMA4Ur@jurong
Hello Andy,

Am Tue, May 30, 2023 at 10:54:20AM -0700 schrieb Andy Tai:
Toggle quote (6 lines)
> Hi, following previous comments (thanks) I have submitted a patch to
> correctly fix a build failure due to compiler warnings, instead of
> avoiding not building tests, on this Guix bug issue:
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63526
> Please review the patch (which shall be a simple and low risk fix). Thanks!

I have reworked a bit the punctuation of the commit message, shortened
the patch file name and pushed. By this I am closing the two corresponding
bug reports (it would have been enough to send a second version of the
patch to the first bug).

Did you contact upstream? Looking at the test, it looked wrong before and
after your patch...
if (len < token->data.character.len) {
hubbub_token t = { 0 };
t.type = HUBBUB_TOKEN_CHARACTER;
t.data.character.ptr += len;
t.data.character.len -= len;
...
Adding to a previously undefined, now 0 pointer .ptr raised a warning
for a reason, I think; and it looks like the t.data maybe should be
token->data. But it is quite possible that this branch is not even
reached by the test.

Andreas
Closed
Andy Tai wrote 2 years ago
(name . Andreas Enge)(address . andreas@enge.fr)
CAJsg1E-P3vWaokpZpcJnfrJxDtihb_YpooyWaCavmHhSt4=8uA@mail.gmail.com
I did contact upstream, no response

On Fri, Jun 9, 2023 at 4:07 AM Andreas Enge <andreas@enge.fr> wrote:
Toggle quote (32 lines)
>
> Hello Andy,
>
> Am Tue, May 30, 2023 at 10:54:20AM -0700 schrieb Andy Tai:
> > Hi, following previous comments (thanks) I have submitted a patch to
> > correctly fix a build failure due to compiler warnings, instead of
> > avoiding not building tests, on this Guix bug issue:
> > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63526
> > Please review the patch (which shall be a simple and low risk fix). Thanks!
>
> I have reworked a bit the punctuation of the commit message, shortened
> the patch file name and pushed. By this I am closing the two corresponding
> bug reports (it would have been enough to send a second version of the
> patch to the first bug).
>
> Did you contact upstream? Looking at the test, it looked wrong before and
> after your patch...
> if (len < token->data.character.len) {
> hubbub_token t = { 0 };
> t.type = HUBBUB_TOKEN_CHARACTER;
> t.data.character.ptr += len;
> t.data.character.len -= len;
> ...
> Adding to a previously undefined, now 0 pointer .ptr raised a warning
> for a reason, I think; and it looks like the t.data maybe should be
> token->data. But it is quite possible that this branch is not even
> reached by the test.
>
> Andreas
>


--
Andy Tai, atai@atai.org, Skype: licheng.tai, Line: andy_tai, WeChat: andytai1010
Year 2023 民國112年
自動的精神力是信仰與覺悟
自動的行為力是勞動與技能
Closed
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 63952
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