mbox series

[bug#51241,0/1] gnu: ragel: Fix build of knot on aarch64-linux.

Message ID cover.1634402642.git.simon@simonsouth.net
Headers show
Series gnu: ragel: Fix build of knot on aarch64-linux. | expand

Message

Simon South Oct. 16, 2021, 5:04 p.m. UTC
This change fixes the build of Knot on AArch64 by patching Ragel to be
explicit in its use of signed "char" types and ranges rather than assuming
"char" is signed by default on all platforms, as it is not on aarch64-linux.

Presently Knot's test suite is failing on aarch64-linux due to the
src/libknot/ypbody.c file being improperly recreated in the package's
"update-parser" phase.  From Knot's runtests.log:

    ok 139 - set input string
    # wanted: 0
    #   seen: -999
    not ok 140 - parse key with a value in UTF-8
    not ok 141 - compare UTF-8 value
    1..141
    # Looks like you failed 2 tests of 141

With the patch applied, ypbody.c is generated as expected (including now the
explicit use of "signed char" where intended) and the tests pass.

I've tested these changes on AArch64 and x86-64.  On the latter I've
sucessfully re-built the output of "guix refresh --list-dependent ragel" with
the exception of ccextractor, which fails (even without this patch) for an
unrelated reason.  (On AArch64 this rebuild would be an unreasonably large
task, though the immediate dependents all build fine.)

--
Simon South
simon@simonsouth.net


Simon South (1):
  gnu: ragel: Fix build of knot on aarch64-linux.

 gnu/local.mk                                  |  1 +
 .../ragel-specify-char-signedness.patch       | 58 +++++++++++++++++++
 gnu/packages/ragel.scm                        |  4 +-
 3 files changed, 62 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/ragel-specify-char-signedness.patch


base-commit: 34b0aa16e77bdbb5b847267eb0f825a590e3d101

Comments

Tobias Geerinckx-Rice Oct. 16, 2021, 5:42 p.m. UTC | #1
Simon,

Thanks for taking care of Knot.  The changes themselves LGTM.

Simon South 写道:
> With the patch applied

Mmm, that's some very raw diff! :-)

Is this an (applied?) upstream patch?  Or did you write it, and if 
so, have you submitted it for upstream inclusion anywhere its 
progress can be tracked?

Kind regards,

T G-R
Simon South Oct. 16, 2021, 8:09 p.m. UTC | #2
Tobias Geerinckx-Rice <me@tobias.gr> writes:
> Or did you write it, and if so, have you submitted it for upstream
> inclusion anywhere its progress can be tracked?

Yes, the patch is of my own creation (borrowing heavily from the
upstream commit I mention) but I haven't tried submitting it upstream
yet.  I agree that is where it really belongs, though.

I'll give that a shot and see what response I get.
Tobias Geerinckx-Rice Oct. 16, 2021, 9:37 p.m. UTC | #3
Simon South 写道:
> I'll give that a shot and see what response I get.

Thanks!  Let us know how it goes.

We don't have to wait for an upstream response to add it to Guix, 
but it's nice to be able to refer to the issue URL.

Kind regards,

T G-R
Simon South Nov. 12, 2021, 8:44 p.m. UTC | #4
After corresponding with Ragel's author, here's a patch that applies the
solution implemented upstream[0], backported from Ragel's "ragel-6" branch.
I've tested this on AArch64 and x86-64 and with these changes applied, Knot
builds fine again on both platforms.

On x86-64, I've once again rebuilt the output of "guix refresh
--list-dependent ragel" without issue, aside from ccextractor; on AArch64,
Ragel's immediate dependents[1] all build fine.

[0] https://github.com/adrian-thurston/ragel/commit/2e638fccd81e96ce09841adc4b295b5ce694ea73
[1] gpick, knot, rspamd, ruby-json-pure, ruby-parser and ruby-regexp-parser.

--
Simon South
simon@simonsouth.net


Simon South (1):
  gnu: ragel: Fix build of knot on aarch64-linux.

 gnu/local.mk                                  |  1 +
 .../ragel-decide-signedness-of-char.patch     | 42 +++++++++++++++++++
 gnu/packages/ragel.scm                        |  7 +++-
 3 files changed, 49 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/ragel-decide-signedness-of-char.patch