Ruby packaging issues

  • Open
  • quality assurance status badge
Details
2 participants
  • Maxime Devos
  • Remco van 't Veer
Owner
unassigned
Submitted by
Maxime Devos
Severity
normal
M
M
Maxime Devos wrote on 30 Jun 2022 13:15
(address . bug-guix@gnu.org)
e0e7e2a1e4c687a426d208e0f745b83eb3b12235.camel@telenet.be
I noticed that:

* Ruby has Autotools ./configure scripts that aren't regenerated.
* Ruby bundles zlib.
* Ruby contains some things generated by bison or such.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYr2FwRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7hzYAQDzU49ZM6dl+ya93Xm5BAcFBkey
ycROg3XvApCIQP7UGQD7B6721P0SD84o9ci33Oxau+iWLzq4AIFqkWReFkXE2AM=
=UFf0
-----END PGP SIGNATURE-----


R
R
Remco van 't Veer wrote on 24 Aug 2022 17:24
87o7w9ll4x.fsf@jomco.nl
Maxime Devos wrote on 30 Jun 13:15 +0200

Toggle quote (4 lines)
> I noticed that:
>
> * Ruby has Autotools ./configure scripts that aren't regenerated.

I'll make a patch for that. I also noticed unbundling of libffi is not
applied to all versions, will fix that too.

Toggle quote (2 lines)
> * Ruby bundles zlib.

Can you point out where it is in the source tree? Looking at the
sources I can only find a (very beefy) wrapper around zlib which seems
to implement all kinds of zlib stuff but also depends on the zlib
library. I dunno how to determine if this is bundling or not.


Toggle quote (2 lines)
> * Ruby contains some things generated by bison or such.

It seems the generated parse.c file (from parse.y) is included in the
tarballs as a service to workaround a bootstrap problem; generating the
parser requires ruby. See also:


I don't know how to deal with this properly. The only thing I can think
of is compiling in two phases: first with the supplied parse.c and after
without. Or try it with mruby as a native-input but that seems to
require ruby to compile too. What's to gain by this?

Cheers,
Remco
R
R
Remco van 't Veer wrote on 24 Aug 2022 17:27
[PATCH 0/2] Ruby packaging issues
(name . Remco van 't Veer)(address . remco@remworks.net)
20220824152747.6752-1-remco@remworks.net
Guix style messed up the formatting and thus the diff a bit. Sorry
about that.

Remco van 't Veer (2):
gnu: ruby: trigger autotools bootstrap
gnu: ruby: fix unbundling of libffi for inheriting rubies

gnu/packages/ruby.scm | 206 ++++++++++++++++++++----------------------
1 file changed, 98 insertions(+), 108 deletions(-)

--
2.37.2
R
R
Remco van 't Veer wrote on 24 Aug 2022 17:27
[PATCH 2/2] gnu: ruby: fix unbundling of libffi for inheriting rubies
(name . Remco van 't Veer)(address . remco@remworks.net)
20220824152747.6752-3-remco@remworks.net
* gnu/packages/ruby.scm (ruby-2.4, ruby-2.5, ruby-3.0, ruby-3.1): Inherit package-source to ensure inclusion of unbundling snippet
---
gnu/packages/ruby.scm | 77 ++++++++++++++++++++-----------------------
1 file changed, 36 insertions(+), 41 deletions(-)

Toggle diff (105 lines)
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index ad8ef3d390..e98814da6d 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -187,62 +187,57 @@ (define-public ruby-3.0
(package
(inherit ruby-2.7)
(version "3.0.2")
- (source
- (origin
- (method url-fetch)
- (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
- (version-major+minor version)
- "/ruby-" version ".tar.xz"))
- (sha256
- (base32
- "0h2w2ms4gx2s96v3lzdr3add94bd2qqkhdjzaycmaqhg21rpf3jp"))))))
+ (source (origin
+ (inherit (package-source ruby-2.7))
+ (method url-fetch)
+ (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
+ (version-major+minor version) "/ruby-"
+ version ".tar.xz"))
+ (sha256
+ (base32
+ "0h2w2ms4gx2s96v3lzdr3add94bd2qqkhdjzaycmaqhg21rpf3jp"))))))
(define-public ruby-3.1
(package
(inherit ruby-2.7)
(version "3.1.1")
- (source
- (origin
- (method url-fetch)
- (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
- (version-major+minor version)
- "/ruby-" version ".tar.xz"))
- (sha256
- (base32
- "1akcl7vhmwfm6ybj7493kzy58ykh2r39ri9f4xfm2xmhg1msmvvs"))))))
+ (source (origin
+ (inherit (package-source ruby-2.7))
+ (method url-fetch)
+ (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
+ (version-major+minor version) "/ruby-"
+ version ".tar.xz"))
+ (sha256
+ (base32
+ "1akcl7vhmwfm6ybj7493kzy58ykh2r39ri9f4xfm2xmhg1msmvvs"))))))
(define-public ruby-2.5
(package
(inherit ruby-2.6)
(version "2.5.9")
- (source
- (origin
- (method url-fetch)
- (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
- (version-major+minor version)
- "/ruby-" version ".tar.xz"))
- (sha256
- (base32
- "1w2qncacm7h3f3il1whghdabwnv9fvwmz9f1a9vcg32006ljyzx8"))))))
+ (source (origin
+ (inherit (package-source ruby-2.6))
+ (method url-fetch)
+ (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
+ (version-major+minor version) "/ruby-"
+ version ".tar.xz"))
+ (sha256
+ (base32
+ "1w2qncacm7h3f3il1whghdabwnv9fvwmz9f1a9vcg32006ljyzx8"))))))
(define-public ruby-2.4
(package
(inherit ruby-2.6)
(version "2.4.10")
- (source
- (origin
- (method url-fetch)
- (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
- (version-major+minor version)
- "/ruby-" version ".tar.xz"))
- (sha256
- (base32
- "1prhqlgik1zmw9lakl6hkriqslspw48pvhxff17h7ns42p8qwrnm"))
- (modules '((guix build utils)))
- (snippet `(begin
- ;; Remove bundled libffi
- (delete-file-recursively "ext/fiddle/libffi-3.2.1")
- #t))))))
+ (source (origin
+ (inherit (package-source ruby-2.6))
+ (method url-fetch)
+ (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
+ (version-major+minor version) "/ruby-"
+ version ".tar.xz"))
+ (sha256
+ (base32
+ "1prhqlgik1zmw9lakl6hkriqslspw48pvhxff17h7ns42p8qwrnm"))))))
(define-public ruby ruby-2.7)
--
2.37.2
R
R
Remco van 't Veer wrote on 24 Aug 2022 17:27
[PATCH 1/2] gnu: ruby: trigger autotools bootstrap
(name . Remco van 't Veer)(address . remco@remworks.net)
20220824152747.6752-2-remco@remworks.net
* gnu/packages/ruby.scm (ruby-2.6, ruby-2.7): Remove autotools artifacts
---
gnu/packages/ruby.scm | 129 ++++++++++++++++++++----------------------
1 file changed, 62 insertions(+), 67 deletions(-)

Toggle diff (161 lines)
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index cc95bd8d6e..ad8ef3d390 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -29,6 +29,7 @@
;;; Copyright © 2020 Tomás Ortín Fernández <tomasortin@mailbox.org>
;;; Copyright © 2021 Giovanni Biscuolo <g@xelera.eu>
;;; Copyright © 2022 Philip McGrath <philip@philipmcgrath.com>
+;;; Copyright © 2022 Remco van 't Veer <remco@remworks.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -101,45 +102,44 @@ (define-public ruby-2.6
(package
(name "ruby")
(version "2.6.5")
- (source
- (origin
- (method url-fetch)
- (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
- (version-major+minor version)
- "/ruby-" version ".tar.xz"))
- (sha256
- (base32
- "0qhsw2mr04f3lqinkh557msr35pb5rdaqy4vdxcj91flgxqxmmnm"))
- (modules '((guix build utils)))
- (snippet `(begin
- ;; Remove bundled libffi
- (delete-file-recursively "ext/fiddle/libffi-3.2.1")
- #t))))
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
+ (version-major+minor version) "/ruby-"
+ version ".tar.xz"))
+ (sha256
+ (base32
+ "0qhsw2mr04f3lqinkh557msr35pb5rdaqy4vdxcj91flgxqxmmnm"))
+ (modules '((guix build utils)))
+ (snippet `(begin
+ ;; Remove bundled libffi
+ (delete-file-recursively "ext/fiddle/libffi-3.2.1")
+ ;; Trigger bootstap
+ (delete-file "configure")
+ (delete-file "aclocal.m4")
+ #t))))
(build-system gnu-build-system)
(arguments
`(#:test-target "test"
- #:configure-flags '("--enable-shared") ; dynamic linking
- #:phases
- (modify-phases %standard-phases
- (add-before 'configure 'replace-bin-sh-and-remove-libffi
- (lambda _
- (substitute* '("Makefile.in"
- "ext/pty/pty.c"
- "io.c"
- "lib/mkmf.rb"
- "process.c"
- "test/rubygems/test_gem_ext_configure_builder.rb"
- "test/rdoc/test_rdoc_parser.rb"
- "test/ruby/test_rubyoptions.rb"
- "test/ruby/test_process.rb"
- "test/ruby/test_system.rb"
- "tool/rbinstall.rb")
- (("/bin/sh") (which "sh")))
- #t)))))
- (inputs
- (list readline openssl libffi gdbm))
- (propagated-inputs
- (list zlib))
+ #:configure-flags '("--enable-shared") ;dynamic linking
+ #:phases (modify-phases %standard-phases
+ (add-before 'configure 'replace-bin-sh-and-remove-libffi
+ (lambda _
+ (substitute* '("Makefile.in" "ext/pty/pty.c"
+ "io.c"
+ "lib/mkmf.rb"
+ "process.c"
+ "test/rubygems/test_gem_ext_configure_builder.rb"
+ "test/rdoc/test_rdoc_parser.rb"
+ "test/ruby/test_rubyoptions.rb"
+ "test/ruby/test_process.rb"
+ "test/ruby/test_system.rb"
+ "tool/rbinstall.rb")
+ (("/bin/sh")
+ (which "sh"))) #t)))))
+ (inputs (list readline openssl libffi gdbm))
+ (propagated-inputs (list zlib))
+ (native-inputs (list autoconf automake))
(native-search-paths
(list (search-path-specification
(variable "GEM_PATH")
@@ -154,39 +154,34 @@ (define-public ruby-2.7
(package
(inherit ruby-2.6)
(version "2.7.4")
- (source
- (origin
- (inherit (package-source ruby-2.6))
- (uri (string-append "https://cache.ruby-lang.org/pub/ruby/"
- (version-major+minor version)
- "/ruby-" version ".tar.gz"))
- (sha256
- (base32
- "0nxwkxh7snmjqf787qsp4i33mxd1rbf9yzyfiky5k230i680jhrh"))))
+ (source (origin
+ (inherit (package-source ruby-2.6))
+ (uri (string-append "https://cache.ruby-lang.org/pub/ruby/"
+ (version-major+minor version) "/ruby-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "0nxwkxh7snmjqf787qsp4i33mxd1rbf9yzyfiky5k230i680jhrh"))))
(arguments
`(#:test-target "test"
- #:configure-flags '("--enable-shared") ; dynamic linking
- #:phases
- (modify-phases %standard-phases
- (add-before 'configure 'replace-bin-sh-and-remove-libffi
- (lambda _
- (substitute* '("configure.ac"
- "template/Makefile.in"
- "lib/rubygems/installer.rb"
- "ext/pty/pty.c"
- "io.c"
- "lib/mkmf.rb"
- "process.c"
- "test/rubygems/test_gem_ext_configure_builder.rb"
- "test/rdoc/test_rdoc_parser.rb"
- "test/ruby/test_rubyoptions.rb"
- "test/ruby/test_process.rb"
- "test/ruby/test_system.rb"
- "tool/rbinstall.rb")
- (("/bin/sh") (which "sh")))
- #t)))))
- (native-inputs
- (list autoconf))))
+ #:configure-flags '("--enable-shared") ;dynamic linking
+ #:phases (modify-phases %standard-phases
+ (add-before 'configure 'replace-bin-sh-and-remove-libffi
+ (lambda _
+ (substitute* '("configure.ac" "template/Makefile.in"
+ "lib/rubygems/installer.rb"
+ "ext/pty/pty.c"
+ "io.c"
+ "lib/mkmf.rb"
+ "process.c"
+ "test/rubygems/test_gem_ext_configure_builder.rb"
+ "test/rdoc/test_rdoc_parser.rb"
+ "test/ruby/test_rubyoptions.rb"
+ "test/ruby/test_process.rb"
+ "test/ruby/test_system.rb"
+ "tool/rbinstall.rb")
+ (("/bin/sh")
+ (which "sh"))) #t)))))))
(define-public ruby-3.0
(package
--
2.37.2
M
M
Maxime Devos wrote on 24 Aug 2022 20:38
Re: Ruby packaging issues
171276f3-bcb2-abfc-b9a9-705059f8605f@telenet.be
On 24-08-2022 17:24, Remco van 't Veer wrote:
Toggle quote (8 lines)
> [...]
>> * Ruby bundles zlib.
> Can you point out where it is in the source tree? Looking at the
> sources I can only find a (very beefy) wrapper around zlib which seems
> to implement all kinds of zlib stuff but also depends on the zlib
> library. I dunno how to determine if this is bundling or not.
>
> https://github.com/ruby/ruby/blob/master/ext/zlib/zlib.c
I probably confused the wrapper for a local copy of zlib, nevermind.
There's a zlib-1.2.11-mswin.patch though, I wonder what's up with that.
Toggle quote (11 lines)
>> * Ruby contains some things generated by bison or such.
> It seems the generated parse.c file (from parse.y) is included in the
> tarballs as a service to workaround a bootstrap problem; generating the
> parser requires ruby. See also:
>
> https://github.com/ruby/ruby/blob/master/common.mk#L910
>
> I don't know how to deal with this properly. The only thing I can think
> of is compiling in two phases: first with the supplied parse.c and after
> without. Or try it with mruby as a native-input but that seems to
> require ruby to compile too.
We have a bunch of old rubies packaged, maybe it can be generated with
one of the old versions? Though possibly the old versions have the same
problem, I haven't checked.
If not: fully properly generating it might not be possible, but
something in-between could be an option:
1. First, use the pre-generated parse.c.
2. Once ruby is built, regenerate the parse.c, and verify that it is
the same as the old parse.c (ignoring the timestamp)
Toggle quote (1 lines)
> What's to gain by this?
(1) I would assume it is much easier to hide malware in a generated file
like parse.c than in the real source code (*) (IIRC, the .c code
generated by bison is much longer than the .y). By generating the
parse.c, the potential issue is side-stepped; any security reviewers
wouldn't even have to look at parse.c because the pre-generated parse.c
isn't used, it's regenerated.
(2) Also: generators like Bison can have bugs, fixed in later versions.
Now imagine that Bison had, say, a buffer overflow bug, and that
distro's just used the pre-generated parse.c. Then once a fixed version
of Bison comes out, we would have to check every package to see if it
has a pre-generated parser. It would be much less stressful to just
always generate parsers from source, then once the version of Bison in
Guix is updated then all packages automatically get the buffer overflow fix.
I don't think my in-between proposal helps much with (1) in case of a
competent attacker (though it could stop some insufficiently
sophisticated attacks where the parse.c malware doesn't try to subvert
the later check), but it still helps with (2) -- it at least detects if
ruby used an old bison (and hence that a patch might be in order)
Greetings,
Maxime.
(*) Caveat: I don't have any statistics on this.
Attachment: file
Attachment: OpenPGP_signature
M
M
Maxime Devos wrote on 24 Aug 2022 20:41
633700ec-bdf9-1ed6-d6ae-ce8587c6b245@telenet.be
On 24-08-2022 17:24, Remco van 't Veer wrote:
Toggle quote (6 lines)
>> * Ruby contains some things generated by bison or such.
> It seems the generated parse.c file (from parse.y) is included in the
> tarballs as a service to workaround a bootstrap problem; generating the
> parser requires ruby. See also:
>
> https://github.com/ruby/ruby/blob/master/common.mk#L910
See my other reply, and also:
Even if generating the .c from the .y from the Ruby code would be ideal,
at least generating the .c from the .y (and using the pre-generated the
.y) is still an improvement, it would at least help with the 'buggy
bison' scenario.
Greetings,
Maxime.
Attachment: file
Attachment: OpenPGP_signature
R
R
Remco van 't Veer wrote on 25 Aug 2022 12:44
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 56322@debbugs.gnu.org)
87sflkk3g5.fsf@remworks.net
2022/08/24 20:38, Maxime Devos:

Toggle quote (4 lines)
> We have a bunch of old rubies packaged, maybe it can be generated with
> one of the old versions? Though possibly the old versions have the
> same problem, I haven't checked.

Older rubies need ruby to compile too, I checked. To totally getting
rid of parse.c is not easy.

Toggle quote (16 lines)
> If not: fully properly generating it might not be possible, but
> something in-between could be an option:
>
> 1. First, use the pre-generated parse.c.
> 2. Once ruby is built, regenerate the parse.c, and verify that it is
> the same as the old parse.c (ignoring the timestamp)
>
>> What's to gain by this?
>
> (1) I would assume it is much easier to hide malware in a generated
> file like parse.c than in the real source code (*) (IIRC, the .c code
> generated by bison is much longer than the .y). By generating the
> parse.c, the potential issue is side-stepped; any security reviewers
> wouldn't even have to look at parse.c because the pre-generated
> parse.c isn't used, it's regenerated.

By using one ruby to support compiling the others said security reviewer
can focus on one particular parse.c. It's big but reviewing it seems
doable but I am no security reviewer.

Toggle quote (15 lines)
> (2) Also: generators like Bison can have bugs, fixed in later
> versions. Now imagine that Bison had, say, a buffer overflow bug, and
> that distro's just used the pre-generated parse.c. Then once a fixed
> version of Bison comes out, we would have to check every package to
> see if it has a pre-generated parser. It would be much less stressful
> to just always generate parsers from source, then once the version of
> Bison in Guix is updated then all packages automatically get the
> buffer overflow fix.
>
> I don't think my in-between proposal helps much with (1) in case of a
> competent attacker (though it could stop some insufficiently
> sophisticated attacks where the parse.c malware doesn't try to subvert
> the later check), but it still helps with (2) -- it at least detects
> if ruby used an old bison (and hence that a patch might be in order)

The two phase build approach (first building with parse.c and then using
that ruby as native-input for a package with parse.c removed) seems to
work but with some notes. Rubies 2.7 and up work fine with bison
current in guix (bison-3.7.6) but ruby-2.6 (and possibly down) don't
because they trigger some incompatibility between bison-3.5.1 (stated as
parse.c generator in ruby-2.6) and bison-3.7.6.

I tried bison-3.0 from gnu/packages/bison for ruby-2.6 and it works but
using that kinda defeats the ".. automatically get the buffer overflow
fix" argument. I'd say, it doesn't really matter for ruby-2.6 and down
since they are EOL anyway and should at some point be removed from guix.

I'll post a patch after this message for feedback. In it a new package
is introduced based on ruby-2.7 named baseruby which is compiled with
the parse.c from the tarball, ruby-2.7 and up will delete parse.c before
build and have extra native-inputs on baseruby and bison to support the
magic.

Cheers,
Remco
R
R
Remco van 't Veer wrote on 25 Aug 2022 12:45
[PATCH] gnu: ruby: regenerate parse.c
(name . Remco van 't Veer)(address . remco@remworks.net)
20220825104510.17727-1-remco@remworks.net
* gnu/packages/ruby.scm (baseruby, ruby-2.7): Use bootstrap baseruby to regenerate parse.c
---
gnu/packages/ruby.scm | 30 ++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)

Toggle diff (50 lines)
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index e98814da6d..8de6cda257 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -161,7 +161,16 @@ (define-public ruby-2.7
version ".tar.gz"))
(sha256
(base32
- "0nxwkxh7snmjqf787qsp4i33mxd1rbf9yzyfiky5k230i680jhrh"))))
+ "0nxwkxh7snmjqf787qsp4i33mxd1rbf9yzyfiky5k230i680jhrh"))
+ (snippet `(begin
+ ;; Remove bundled libffi
+ (delete-file-recursively "ext/fiddle/libffi-3.2.1")
+ ;; Trigger bootstap
+ (delete-file "configure")
+ (delete-file "aclocal.m4")
+ ;; Trigger rebuild of parse.c from parse.y
+ (delete-file "parse.c")
+ #t))))
(arguments
`(#:test-target "test"
#:configure-flags '("--enable-shared") ;dynamic linking
@@ -181,7 +190,24 @@ (define-public ruby-2.7
"test/ruby/test_system.rb"
"tool/rbinstall.rb")
(("/bin/sh")
- (which "sh"))) #t)))))))
+ (which "sh"))) #t)))))
+ (native-inputs (list autoconf automake baseruby bison))))
+
+(define baseruby ;; used to build ruby by parser generator
+ (package
+ (inherit ruby-2.7)
+ (name "baseruby")
+ (source (origin
+ (inherit (package-source ruby-2.7))
+ ;; override snippet to not include deletion of bundled parse.c
+ (snippet `(begin
+ ;; Remove bundled libffi
+ (delete-file-recursively "ext/fiddle/libffi-3.2.1")
+ ;; Trigger bootstap
+ (delete-file "configure")
+ (delete-file "aclocal.m4")
+ #t))))
+ (native-inputs (list autoconf automake))))
(define-public ruby-3.0
(package
--
2.37.2
R
M
M
Maxime Devos wrote on 9 Oct 2022 11:15
07af81e7-520f-45c0-c308-5f97837af673@telenet.be
On 08-10-2022 12:01, Remco van 't Veer wrote:
Toggle quote (5 lines)
> Do the patches[1][2] need more work?
>
>
> [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56322#11
> [2] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56322#29
Trailing #t haven' been necessary since a long time, and ...
> + (define baseruby ;; used to build ruby by parser generator
... I don't think this is quite grammatical, maybe ';; for bootstrapping
ruby's parser generator' or ';; used to build ruby's parser generator'?
Otherwise, not that I know of, these patches appear straightforward.
They might need to be done on core-updates though -- unless this has
changed, IIRC ruby-asciidoctor is deep in the package graph.
Greetings,
Maxime.
Attachment: OpenPGP_signature
R
R
Remco van 't Veer wrote on 10 Oct 2022 07:05
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 56322@debbugs.gnu.org)
87ilksjmka.fsf@remworks.net
Hi Maxime,

Thanks for taking a look again. I'll make a new patchset to correct the
things you mentioned.

2022/10/09 11:15, Maxime Devos:

Toggle quote (5 lines)
> Otherwise, not that I know of, these patches appear
> straightforward. They might need to be done on core-updates though --
> unless this has changed, IIRC ruby-asciidoctor is deep in the package
> graph.

What's the protocol for "doing on core-updates"? I guess I can rebase
on that but who will or should pick up these patches? Is there somebody
I need to ping?

Remco
M
M
Maxime Devos wrote on 10 Oct 2022 12:27
(name . Remco van 't Veer)(address . remco@remworks.net)(address . 56322@debbugs.gnu.org)
712546e9-814d-80dd-3a17-ad3750a4a9ac@telenet.be
On 10-10-2022 07:05, Remco van 't Veer wrote:
Toggle quote (15 lines)
> Hi Maxime,
>
> Thanks for taking a look again. I'll make a new patchset to correct the
> things you mentioned.
>
> 2022/10/09 11:15, Maxime Devos:
>
>> Otherwise, not that I know of, these patches appear
>> straightforward. They might need to be done on core-updates though --
>> unless this has changed, IIRC ruby-asciidoctor is deep in the package
>> graph.
>
> What's the protocol for "doing on core-updates"? I guess I can rebase
> on that but who will or should pick up these patches? Is there somebody
> I need to ping?
It's the same as master (no separate people), but to avoid someone
accidentally applying it to the wrong patch, it is recommended to prefix
the subject with [PATCH core-updates] instead of [PATCH].
The manual has some information on when something should be on
core-updates or master.
Greetings,
Maxime.
Attachment: OpenPGP_signature
R
R
Remco van 't Veer wrote on 12 Oct 2022 15:35
[PATCH core-updates 0/3] Ruby packaging issues
(address . 56322@debbugs.gnu.org)
20221012133529.27859-1-remco@remworks.net
Applied changes from feedback by Maxime Devos and rebased on
core-updates.

Remco van 't Veer (3):
gnu: ruby: trigger autotools bootstrap
gnu: ruby: fix unbundling of libffi for inheriting rubies
gnu: ruby: regenerate parse.c

gnu/packages/ruby.scm | 28 +++++++++++++++++++++++-----
1 file changed, 23 insertions(+), 5 deletions(-)


base-commit: 685110045c04a60bf18163aab1c230f944c871c9
--
2.37.3
R
R
Remco van 't Veer wrote on 12 Oct 2022 15:35
[PATCH core-updates 1/3] gnu: ruby: trigger autotools bootstrap
(address . 56322@debbugs.gnu.org)
20221012133529.27859-2-remco@remworks.net
* gnu/packages/ruby.scm (ruby-2.6, ruby-2.7): Remove autotools artifacts
---
gnu/packages/ruby.scm | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

Toggle diff (37 lines)
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index e1b71a0a1a..25d7aba933 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -116,7 +116,9 @@ (define-public ruby-2.6
(snippet `(begin
;; Remove bundled libffi
(delete-file-recursively "ext/fiddle/libffi-3.2.1")
- #t))))
+ ;; Trigger bootstap
+ (delete-file "configure")
+ (delete-file "aclocal.m4")))))
(build-system gnu-build-system)
(arguments
`(#:test-target "test"
@@ -142,6 +144,7 @@ (define-public ruby-2.6
(list readline openssl-1.1 libffi gdbm))
(propagated-inputs
(list zlib))
+ (native-inputs (list autoconf automake))
(native-search-paths
(list (search-path-specification
(variable "GEM_PATH")
@@ -185,10 +188,7 @@ (define-public ruby-2.7
"test/ruby/test_process.rb"
"test/ruby/test_system.rb"
"tool/rbinstall.rb")
- (("/bin/sh") (which "sh")))
- #t)))))
- (native-inputs
- (list autoconf))))
+ (("/bin/sh") (which "sh"))))))))))
(define-public ruby-3.0
(package
--
2.37.3
R
R
Remco van 't Veer wrote on 12 Oct 2022 15:35
[PATCH core-updates 2/3] gnu: ruby: fix unbundling of libffi for inheriting rubies
(address . 56322@debbugs.gnu.org)
20221012133529.27859-3-remco@remworks.net
* gnu/packages/ruby.scm (ruby-3.0, ruby-3.1): Inherit package-source to ensure inclusion of unbundling snippet
---
gnu/packages/ruby.scm | 2 ++
1 file changed, 2 insertions(+)

Toggle diff (22 lines)
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 25d7aba933..bd55d5ac6d 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -196,6 +196,7 @@ (define-public ruby-3.0
(version "3.0.4")
(source
(origin
+ (inherit (package-source ruby-2.7))
(method url-fetch)
(uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
(version-major+minor version)
@@ -213,6 +214,7 @@ (define-public ruby-3.1
(version "3.1.2")
(source
(origin
+ (inherit (package-source ruby-3.0))
(method url-fetch)
(uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
(version-major+minor version)
--
2.37.3
R
R
Remco van 't Veer wrote on 12 Oct 2022 15:35
[PATCH core-updates 3/3] gnu: ruby: regenerate parse.c
(address . 56322@debbugs.gnu.org)
20221012133529.27859-4-remco@remworks.net
* gnu/packages/ruby.scm (baseruby, ruby-2.7): Use bootstrap baseruby to regenerate parse.c
---
gnu/packages/ruby.scm | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)

Toggle diff (31 lines)
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index bd55d5ac6d..497271f442 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -188,7 +188,23 @@ (define-public ruby-2.7
"test/ruby/test_process.rb"
"test/ruby/test_system.rb"
"tool/rbinstall.rb")
- (("/bin/sh") (which "sh"))))))))))
+ (("/bin/sh") (which "sh"))))))))
+ (native-inputs (list autoconf automake baseruby bison))))
+
+(define baseruby ;; for bootstrapping ruby's parser generator
+ (package
+ (inherit ruby-2.7)
+ (name "baseruby")
+ (source (origin
+ (inherit (package-source ruby-2.7))
+ ;; override snippet to not include deletion of bundled parse.c
+ (snippet `(begin
+ ;; Remove bundled libffi
+ (delete-file-recursively "ext/fiddle/libffi-3.2.1")
+ ;; Trigger bootstap
+ (delete-file "configure")
+ (delete-file "aclocal.m4")))))
+ (native-inputs (list autoconf automake))))
(define-public ruby-3.0
(package
--
2.37.3
?