* bug#56322: Ruby packaging issues
@ 2022-06-30 11:15 Maxime Devos
2022-08-24 15:24 ` Remco van 't Veer
` (3 more replies)
0 siblings, 4 replies; 17+ messages in thread
From: Maxime Devos @ 2022-06-30 11:15 UTC (permalink / raw)
To: 56322
[-- Attachment #1: Type: text/plain, Size: 194 bytes --]
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.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* bug#56322: Ruby packaging issues
2022-06-30 11:15 bug#56322: Ruby packaging issues Maxime Devos
@ 2022-08-24 15:24 ` Remco van 't Veer
2022-08-24 18:38 ` Maxime Devos
2022-08-24 18:41 ` Maxime Devos
2022-08-24 15:27 ` bug#56322: [PATCH 0/2] " Remco van 't Veer
` (2 subsequent siblings)
3 siblings, 2 replies; 17+ messages in thread
From: Remco van 't Veer @ 2022-08-24 15:24 UTC (permalink / raw)
To: 56322, Maxime Devos
Maxime Devos wrote on 30 Jun 13:15 +0200
> 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.
> * 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
> * 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. What's to gain by this?
Cheers,
Remco
^ permalink raw reply [flat|nested] 17+ messages in thread
* bug#56322: [PATCH 0/2] Ruby packaging issues
2022-06-30 11:15 bug#56322: Ruby packaging issues Maxime Devos
2022-08-24 15:24 ` Remco van 't Veer
@ 2022-08-24 15:27 ` Remco van 't Veer
2022-08-24 15:27 ` bug#56322: [PATCH 1/2] gnu: ruby: trigger autotools bootstrap Remco van 't Veer
2022-08-24 15:27 ` bug#56322: [PATCH 2/2] gnu: ruby: fix unbundling of libffi for inheriting rubies Remco van 't Veer
2022-08-25 10:45 ` bug#56322: [PATCH] gnu: ruby: regenerate parse.c Remco van 't Veer
2022-10-08 10:01 ` bug#56322: Debbug 56322, Ruby packaging issues, ping? Remco van 't Veer
3 siblings, 2 replies; 17+ messages in thread
From: Remco van 't Veer @ 2022-08-24 15:27 UTC (permalink / raw)
To: 56322, Maxime Devos; +Cc: Remco van 't Veer
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
^ permalink raw reply [flat|nested] 17+ messages in thread
* bug#56322: [PATCH 1/2] gnu: ruby: trigger autotools bootstrap
2022-08-24 15:27 ` bug#56322: [PATCH 0/2] " Remco van 't Veer
@ 2022-08-24 15:27 ` Remco van 't Veer
2022-08-24 15:27 ` bug#56322: [PATCH 2/2] gnu: ruby: fix unbundling of libffi for inheriting rubies Remco van 't Veer
1 sibling, 0 replies; 17+ messages in thread
From: Remco van 't Veer @ 2022-08-24 15:27 UTC (permalink / raw)
To: 56322, Maxime Devos; +Cc: Remco van 't Veer
* 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(-)
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
^ permalink raw reply related [flat|nested] 17+ messages in thread
* bug#56322: [PATCH 2/2] gnu: ruby: fix unbundling of libffi for inheriting rubies
2022-08-24 15:27 ` bug#56322: [PATCH 0/2] " Remco van 't Veer
2022-08-24 15:27 ` bug#56322: [PATCH 1/2] gnu: ruby: trigger autotools bootstrap Remco van 't Veer
@ 2022-08-24 15:27 ` Remco van 't Veer
1 sibling, 0 replies; 17+ messages in thread
From: Remco van 't Veer @ 2022-08-24 15:27 UTC (permalink / raw)
To: 56322, Maxime Devos; +Cc: Remco van 't Veer
* 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(-)
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
^ permalink raw reply related [flat|nested] 17+ messages in thread
* bug#56322: Ruby packaging issues
2022-08-24 15:24 ` Remco van 't Veer
@ 2022-08-24 18:38 ` Maxime Devos
2022-08-25 10:44 ` Remco van 't Veer
2022-08-24 18:41 ` Maxime Devos
1 sibling, 1 reply; 17+ messages in thread
From: Maxime Devos @ 2022-08-24 18:38 UTC (permalink / raw)
To: Remco van 't Veer, 56322
[-- Attachment #1.1.1.1: Type: text/plain, Size: 2965 bytes --]
On 24-08-2022 17:24, Remco van 't Veer wrote:
> [...]
>> * 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.
>> * 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)
> 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 #1.1.1.2: Type: text/html, Size: 4289 bytes --]
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* bug#56322: Ruby packaging issues
2022-08-24 15:24 ` Remco van 't Veer
2022-08-24 18:38 ` Maxime Devos
@ 2022-08-24 18:41 ` Maxime Devos
1 sibling, 0 replies; 17+ messages in thread
From: Maxime Devos @ 2022-08-24 18:41 UTC (permalink / raw)
To: Remco van 't Veer, 56322
[-- Attachment #1.1.1.1: Type: text/plain, Size: 658 bytes --]
On 24-08-2022 17:24, Remco van 't Veer wrote:
>> * 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 #1.1.1.2: Type: text/html, Size: 1295 bytes --]
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* bug#56322: Ruby packaging issues
2022-08-24 18:38 ` Maxime Devos
@ 2022-08-25 10:44 ` Remco van 't Veer
0 siblings, 0 replies; 17+ messages in thread
From: Remco van 't Veer @ 2022-08-25 10:44 UTC (permalink / raw)
To: Maxime Devos; +Cc: 56322
2022/08/24 20:38, Maxime Devos:
> 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.
> 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.
> (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
^ permalink raw reply [flat|nested] 17+ messages in thread
* bug#56322: [PATCH] gnu: ruby: regenerate parse.c
2022-06-30 11:15 bug#56322: Ruby packaging issues Maxime Devos
2022-08-24 15:24 ` Remco van 't Veer
2022-08-24 15:27 ` bug#56322: [PATCH 0/2] " Remco van 't Veer
@ 2022-08-25 10:45 ` Remco van 't Veer
2022-10-08 10:01 ` bug#56322: Debbug 56322, Ruby packaging issues, ping? Remco van 't Veer
3 siblings, 0 replies; 17+ messages in thread
From: Remco van 't Veer @ 2022-08-25 10:45 UTC (permalink / raw)
To: 56322, Maxime Devos; +Cc: Remco van 't Veer
* 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(-)
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
^ permalink raw reply related [flat|nested] 17+ messages in thread
* bug#56322: Debbug 56322, Ruby packaging issues, ping?
2022-06-30 11:15 bug#56322: Ruby packaging issues Maxime Devos
` (2 preceding siblings ...)
2022-08-25 10:45 ` bug#56322: [PATCH] gnu: ruby: regenerate parse.c Remco van 't Veer
@ 2022-10-08 10:01 ` Remco van 't Veer
2022-10-09 9:15 ` Maxime Devos
3 siblings, 1 reply; 17+ messages in thread
From: Remco van 't Veer @ 2022-10-08 10:01 UTC (permalink / raw)
To: 56322, Maxime Devos
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
^ permalink raw reply [flat|nested] 17+ messages in thread
* bug#56322: Debbug 56322, Ruby packaging issues, ping?
2022-10-08 10:01 ` bug#56322: Debbug 56322, Ruby packaging issues, ping? Remco van 't Veer
@ 2022-10-09 9:15 ` Maxime Devos
2022-10-10 5:05 ` Remco van 't Veer
0 siblings, 1 reply; 17+ messages in thread
From: Maxime Devos @ 2022-10-09 9:15 UTC (permalink / raw)
To: Remco van 't Veer, 56322
[-- Attachment #1.1.1: Type: text/plain, Size: 734 bytes --]
On 08-10-2022 12:01, Remco van 't Veer wrote:
> 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 #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* bug#56322: Debbug 56322, Ruby packaging issues, ping?
2022-10-09 9:15 ` Maxime Devos
@ 2022-10-10 5:05 ` Remco van 't Veer
2022-10-10 10:27 ` Maxime Devos
0 siblings, 1 reply; 17+ messages in thread
From: Remco van 't Veer @ 2022-10-10 5:05 UTC (permalink / raw)
To: Maxime Devos; +Cc: 56322
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?
Remco
^ permalink raw reply [flat|nested] 17+ messages in thread
* bug#56322: Debbug 56322, Ruby packaging issues, ping?
2022-10-10 5:05 ` Remco van 't Veer
@ 2022-10-10 10:27 ` Maxime Devos
2022-10-12 13:35 ` bug#56322: [PATCH core-updates 0/3] Ruby packaging issues Remco van 't Veer
0 siblings, 1 reply; 17+ messages in thread
From: Maxime Devos @ 2022-10-10 10:27 UTC (permalink / raw)
To: Remco van 't Veer; +Cc: 56322
[-- Attachment #1.1.1: Type: text/plain, Size: 917 bytes --]
On 10-10-2022 07:05, Remco van 't Veer wrote:
> 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 #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* bug#56322: [PATCH core-updates 0/3] Ruby packaging issues
2022-10-10 10:27 ` Maxime Devos
@ 2022-10-12 13:35 ` Remco van 't Veer
2022-10-12 13:35 ` bug#56322: [PATCH core-updates 1/3] gnu: ruby: trigger autotools bootstrap Remco van 't Veer
` (2 more replies)
0 siblings, 3 replies; 17+ messages in thread
From: Remco van 't Veer @ 2022-10-12 13:35 UTC (permalink / raw)
To: 56322; +Cc: Maxime Devos, Remco van 't Veer
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
^ permalink raw reply [flat|nested] 17+ messages in thread
* bug#56322: [PATCH core-updates 1/3] gnu: ruby: trigger autotools bootstrap
2022-10-12 13:35 ` bug#56322: [PATCH core-updates 0/3] Ruby packaging issues Remco van 't Veer
@ 2022-10-12 13:35 ` Remco van 't Veer
2022-10-12 13:35 ` bug#56322: [PATCH core-updates 2/3] gnu: ruby: fix unbundling of libffi for inheriting rubies Remco van 't Veer
2022-10-12 13:35 ` bug#56322: [PATCH core-updates 3/3] gnu: ruby: regenerate parse.c Remco van 't Veer
2 siblings, 0 replies; 17+ messages in thread
From: Remco van 't Veer @ 2022-10-12 13:35 UTC (permalink / raw)
To: 56322; +Cc: Maxime Devos, Remco van 't Veer
* 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(-)
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
^ permalink raw reply related [flat|nested] 17+ messages in thread
* bug#56322: [PATCH core-updates 2/3] gnu: ruby: fix unbundling of libffi for inheriting rubies
2022-10-12 13:35 ` bug#56322: [PATCH core-updates 0/3] Ruby packaging issues Remco van 't Veer
2022-10-12 13:35 ` bug#56322: [PATCH core-updates 1/3] gnu: ruby: trigger autotools bootstrap Remco van 't Veer
@ 2022-10-12 13:35 ` Remco van 't Veer
2022-10-12 13:35 ` bug#56322: [PATCH core-updates 3/3] gnu: ruby: regenerate parse.c Remco van 't Veer
2 siblings, 0 replies; 17+ messages in thread
From: Remco van 't Veer @ 2022-10-12 13:35 UTC (permalink / raw)
To: 56322; +Cc: Maxime Devos, Remco van 't Veer
* 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(+)
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
^ permalink raw reply related [flat|nested] 17+ messages in thread
* bug#56322: [PATCH core-updates 3/3] gnu: ruby: regenerate parse.c
2022-10-12 13:35 ` bug#56322: [PATCH core-updates 0/3] Ruby packaging issues Remco van 't Veer
2022-10-12 13:35 ` bug#56322: [PATCH core-updates 1/3] gnu: ruby: trigger autotools bootstrap Remco van 't Veer
2022-10-12 13:35 ` bug#56322: [PATCH core-updates 2/3] gnu: ruby: fix unbundling of libffi for inheriting rubies Remco van 't Veer
@ 2022-10-12 13:35 ` Remco van 't Veer
2 siblings, 0 replies; 17+ messages in thread
From: Remco van 't Veer @ 2022-10-12 13:35 UTC (permalink / raw)
To: 56322; +Cc: Maxime Devos, Remco van 't Veer
* 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(-)
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
^ permalink raw reply related [flat|nested] 17+ messages in thread
end of thread, other threads:[~2022-10-12 13:42 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-30 11:15 bug#56322: Ruby packaging issues Maxime Devos
2022-08-24 15:24 ` Remco van 't Veer
2022-08-24 18:38 ` Maxime Devos
2022-08-25 10:44 ` Remco van 't Veer
2022-08-24 18:41 ` Maxime Devos
2022-08-24 15:27 ` bug#56322: [PATCH 0/2] " Remco van 't Veer
2022-08-24 15:27 ` bug#56322: [PATCH 1/2] gnu: ruby: trigger autotools bootstrap Remco van 't Veer
2022-08-24 15:27 ` bug#56322: [PATCH 2/2] gnu: ruby: fix unbundling of libffi for inheriting rubies Remco van 't Veer
2022-08-25 10:45 ` bug#56322: [PATCH] gnu: ruby: regenerate parse.c Remco van 't Veer
2022-10-08 10:01 ` bug#56322: Debbug 56322, Ruby packaging issues, ping? Remco van 't Veer
2022-10-09 9:15 ` Maxime Devos
2022-10-10 5:05 ` Remco van 't Veer
2022-10-10 10:27 ` Maxime Devos
2022-10-12 13:35 ` bug#56322: [PATCH core-updates 0/3] Ruby packaging issues Remco van 't Veer
2022-10-12 13:35 ` bug#56322: [PATCH core-updates 1/3] gnu: ruby: trigger autotools bootstrap Remco van 't Veer
2022-10-12 13:35 ` bug#56322: [PATCH core-updates 2/3] gnu: ruby: fix unbundling of libffi for inheriting rubies Remco van 't Veer
2022-10-12 13:35 ` bug#56322: [PATCH core-updates 3/3] gnu: ruby: regenerate parse.c Remco van 't Veer
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.