gzip cannot be patched

  • Open
  • quality assurance status badge
Details
4 participants
  • Efraim Flashner
  • Ludovic Courtès
  • Maxim Cournoyer
  • Marius Bakke
Owner
unassigned
Submitted by
Marius Bakke
Severity
normal
M
M
Marius Bakke wrote on 2 Aug 2018 13:32
(address . bug-guix@gnu.org)
87muu56m31.fsf@fastmail.com
Hello!

I'm trying to add a patch to 'gzip', but it causes an infinite loop and
eventually the system runs out of memory.

It can be reproduced by adding this hunk:
modified gnu/packages/compression.scm
@@ -215,6 +215,7 @@ adding and extracting files to/from a tar archive.")
(method url-fetch)
(uri (string-append "mirror://gnu/gzip/gzip-"
version ".tar.xz"))
+ (snippet '(#t))
(sha256
(base32
"16h8g4acy7fgfxcjacr3wijjsnixwsfd2jhz3zwdi2qrzi262l5f"))))

[back]
I guess this is because gzip itself is a patch input. Is this something
that can be fixed, or do we have to use "patching phases" in these cases?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlti67IACgkQoqBt8qM6
VPoZKwf/Z/2deICu/5W43JduiNfJEzz8z0kRQAXZ9atOjCiNOKoFZExRO0XhOmA4
8jQ2rfamykN+RHDyJHGpuQXlPRforvdXiDoiCQDB+n0JZ2aHU0Bk4N47Z0cpjIm1
Y6GHyEzEiF62d9RisvXnZ8r6FYLhacsrbtk10+TzvsxPuMHP1phTZ412GpSj/d5b
tgrINnrrlpd9LzsaG3yA7FpjKUpEhGHtRUX6BvLPLCV7Lnb9wjXHy2cuCVf92xj9
euNkXnTPcnf1tcQM3oX1jnJPRezRvx4fcUfM2d9hXJElCBDv4aaCftUNe56H0CPg
F/8jc/GboWb24oZdpCb8HMSK3j6IKw==
=KX9c
-----END PGP SIGNATURE-----

E
E
Efraim Flashner wrote on 2 Aug 2018 13:57
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 32347@debbugs.gnu.org)
20180802115718.GD13776@macbook41
On Thu, Aug 02, 2018 at 01:32:02PM +0200, Marius Bakke wrote:
Toggle quote (23 lines)
> Hello!
>
> I'm trying to add a patch to 'gzip', but it causes an infinite loop and
> eventually the system runs out of memory.
>
> It can be reproduced by adding this hunk:
>

> modified gnu/packages/compression.scm
> @@ -215,6 +215,7 @@ adding and extracting files to/from a tar archive.")
> (method url-fetch)
> (uri (string-append "mirror://gnu/gzip/gzip-"
> version ".tar.xz"))
> + (snippet '(#t))
> (sha256
> (base32
> "16h8g4acy7fgfxcjacr3wijjsnixwsfd2jhz3zwdi2qrzi262l5f"))))
>
> [back]
>
> I guess this is because gzip itself is a patch input. Is this something
> that can be fixed, or do we have to use "patching phases" in these cases?

Its also in commencement.scm, so that might be the loop instead. You
could try "unpatching" it there. It looks like it has a pseudo-package
inside of glibc-utf8-locales-final, with grep-final a few packages lower
being potential inspiration for undoing the modifications in "real
gzip".


--
Efraim Flashner <efraim@flashner.co.il> ????? ?????
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAlti8ZkACgkQQarn3Mo9
g1FoMBAAvYb0JVu/OtB6h/q+z5MBM0/mCVPt/5g99cVyLypygB0Dv8evlCAc1E5c
Dsmkco/hoUiA/qYXmEEDB+td5IL6pfd8RVtMca3AyN1aPv6LLBjQoG80V4+dz359
BDNeGNrhgCVwfHi/zCkZVUg+YSb4XVPtA2kJrhkizVqPbXgVCIAOo976jspzj6cK
fO8Ox2uHJpGsevp3GPpf64nGNw/Ps4Jv/0KJYlN2W6lIZ7QI46MSphSHOHfePPa8
pbbESvYXK9fjY80OE7lkCw3Dj5oGx7gQfcmCNl14kqWx1xnWwZmCwh//7KY5rBR+
3SzcR41hKObpfMhZ+u6j0UMbxGm5vU7sTTRibt1zDr56migixtR7p72TTgoqRLtN
2zKP3V/WwurxfhcW/Ftib9z8IQP1mZ249nJkwLLgxFCFxSGkC0yxXwlLkmuLqNtE
t6SsLpltf60ELdimvDqT+oZ4maHfHN6EIx8oRtS6eZ5eqyfEFlvI6q3B8x9ySLnE
/cL7kYIzNyhw8oVxnYndqdIEza1eTPoibiG3gqXLe3IthVGA8H9q11LegGKMcqkY
YXAAS8staqk7wTeCFSGOLk/s4rlEn/6cbi4ewKZEqJzjAeWgGjt1M6CXaMvdGMti
LZI81XAkMu4QLt0pt7+h0CEqMPc1rC6qijUHqbci3/NKRgw99jQ=
=jNMn
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 19 Aug 2018 15:48
(name . Efraim Flashner)(address . efraim@flashner.co.il)
87a7piii22.fsf@gnu.org
Hello,

Efraim Flashner <efraim@flashner.co.il> skribis:

Toggle quote (30 lines)
> On Thu, Aug 02, 2018 at 01:32:02PM +0200, Marius Bakke wrote:
>> Hello!
>>
>> I'm trying to add a patch to 'gzip', but it causes an infinite loop and
>> eventually the system runs out of memory.
>>
>> It can be reproduced by adding this hunk:
>>
>
>> modified gnu/packages/compression.scm
>> @@ -215,6 +215,7 @@ adding and extracting files to/from a tar archive.")
>> (method url-fetch)
>> (uri (string-append "mirror://gnu/gzip/gzip-"
>> version ".tar.xz"))
>> + (snippet '(#t))
>> (sha256
>> (base32
>> "16h8g4acy7fgfxcjacr3wijjsnixwsfd2jhz3zwdi2qrzi262l5f"))))
>>
>> [back]
>>
>> I guess this is because gzip itself is a patch input. Is this something
>> that can be fixed, or do we have to use "patching phases" in these cases?
>
> Its also in commencement.scm, so that might be the loop instead. You
> could try "unpatching" it there. It looks like it has a pseudo-package
> inside of glibc-utf8-locales-final, with grep-final a few packages lower
> being potential inspiration for undoing the modifications in "real
> gzip".

Indeed. The ‘bootstrap-origin’ procedure, defined in (gnu packages
bootstrap), arranges to use the bootstrap binaries of gzip, patch,
guile, etc. when patching origins.

Perhaps we’re missing a use of ‘bootstrap-origin’ somewhere in (gnu
packages commencement)?

HTH,
Ludo’.
E
E
Efraim Flashner wrote on 3 Oct 2018 10:01
(name . Ludovic Courtès)(address . ludo@gnu.org)
20181003080141.GA11380@macbook41
On Sun, Aug 19, 2018 at 03:48:05PM +0200, Ludovic Courtès wrote:
Toggle quote (42 lines)
> Hello,
>
> Efraim Flashner <efraim@flashner.co.il> skribis:
>
> > On Thu, Aug 02, 2018 at 01:32:02PM +0200, Marius Bakke wrote:
> >> Hello!
> >>
> >> I'm trying to add a patch to 'gzip', but it causes an infinite loop and
> >> eventually the system runs out of memory.
> >>
> >> It can be reproduced by adding this hunk:
> >>
> >
> >> modified gnu/packages/compression.scm
> >> @@ -215,6 +215,7 @@ adding and extracting files to/from a tar archive.")
> >> (method url-fetch)
> >> (uri (string-append "mirror://gnu/gzip/gzip-"
> >> version ".tar.xz"))
> >> + (snippet '(#t))
> >> (sha256
> >> (base32
> >> "16h8g4acy7fgfxcjacr3wijjsnixwsfd2jhz3zwdi2qrzi262l5f"))))
> >>
> >> [back]
> >>
> >> I guess this is because gzip itself is a patch input. Is this something
> >> that can be fixed, or do we have to use "patching phases" in these cases?
> >
> > Its also in commencement.scm, so that might be the loop instead. You
> > could try "unpatching" it there. It looks like it has a pseudo-package
> > inside of glibc-utf8-locales-final, with grep-final a few packages lower
> > being potential inspiration for undoing the modifications in "real
> > gzip".
>
> Indeed. The ‘bootstrap-origin’ procedure, defined in (gnu packages
> bootstrap), arranges to use the bootstrap binaries of gzip, patch,
> guile, etc. when patching origins.
>
> Perhaps we’re missing a use of ‘bootstrap-origin’ somewhere in (gnu
> packages commencement)?
>

Looks like it in the end. the gzip for glibc-utf8-locales-final uses the
bootstrap guile for its building, but doesn't get the input rewriting
that comes from package-with-bootstrap-guile. With this patch adding the
trivial snippet to gzip doesn't cause an infinite loop anymore. Since
the patch doesn't change the hash of glibc-utf8-locales-final it should
be OK for master.

--
Efraim Flashner <efraim@flashner.co.il> ????? ?????
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
From a3b7f9851e121fd3eb5f52ff4197923553032ec7 Mon Sep 17 00:00:00 2001
From: Efraim Flashner <efraim@flashner.co.il>
Date: Wed, 3 Oct 2018 10:33:23 +0300
Subject: [PATCH] gnu: glibc-utf8-locales-final: Wrap inputs with
'package-with-bootstrap-guile'.

* gnu/packages/commencement.scm (glibc-utf8-locales-final)[inputs]: Wrap
gzip with 'package-with-bootstrap-guile'.
---
gnu/packages/commencement.scm | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

Toggle diff (20 lines)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 30a0ffcec..6c0f4e310 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -870,9 +870,10 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
(inherit glibc-utf8-locales)
(inputs `(("glibc" ,glibc-final)
("gzip"
- ,(package-with-explicit-inputs gzip %boot4-inputs
- (current-source-location)
- #:guile %bootstrap-guile))))))
+ ,(package-with-bootstrap-guile
+ (package-with-explicit-inputs gzip %boot4-inputs
+ (current-source-location)
+ #:guile %bootstrap-guile)))))))
(define-public ld-wrapper
;; The final 'ld' wrapper, which uses the final Guile and Binutils.
--
2.19.0
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAlu0d2EACgkQQarn3Mo9
g1GO8xAAp2dxPPLrPUbNO9PnbZ8qFU5QWLF3V3kezAxVxcfPXkcbPGdZmC0nlqZg
rbWU2vSh/aP/EAAHujCbUdQuMSsIio438Mc82BV0xpm2pirxSxz+p434GYRO6ojn
BE75XIKYcnxMFQZbjYMgNwSgtvoqYdoPVOu9iZtXMIpZmMtImQu3672hmc4aXp8f
MJedD306XmWww9P1+hi3OHWunJoUkgpSJkplazCLKNxMWXsp93068/1lF19jTafA
xUAfn5VNn3xvnRAtIVqm8tP7uUqnd2fiZssnlzhZuAKviXJtVregYjB6eM097xK4
MbccIxFqEjFwC97mpyXS3mRYIQA7umvZQMz++CmSaV23Jli0li0A2sQ7H8WrEHv7
QJY7jtBmdt+MwrBoUEWZR3lT34/LlEjP/u1kSv35QoKffnW6Abk/daxfwUuxh5Bx
g5qY4kHIx57mkLhWrlUBC+DvFYAx+wwutP4G+H/q+of9CwMOi3Kx2cgjO2UNyK0S
b0++9G0KNy0/q9FkXTJcMtU0jVpZIkUascLFs8RKiXuevrVjcnGsb6CNT8BbREyw
4Os3Jase7yoqJpwbNmUrfb5nsutDgC4pXqE6drWGWQFYpX9AxMET9H4IrQobz1Wu
fW8+mz73deUB442JxfbMyXx1jstFCHFtsLpgOK53p7i1/WKoixE=
=JGhu
-----END PGP SIGNATURE-----


M
M
Maxim Cournoyer wrote on 29 Aug 2023 14:44
(name . Efraim Flashner)(address . efraim@flashner.co.il)
87h6oic91s.fsf@gmail.com
Hi Efraim,

Efraim Flashner <efraim@flashner.co.il> writes:

Toggle quote (50 lines)
> On Sun, Aug 19, 2018 at 03:48:05PM +0200, Ludovic Courtès wrote:
>> Hello,
>>
>> Efraim Flashner <efraim@flashner.co.il> skribis:
>>
>> > On Thu, Aug 02, 2018 at 01:32:02PM +0200, Marius Bakke wrote:
>> >> Hello!
>> >>
>> >> I'm trying to add a patch to 'gzip', but it causes an infinite loop and
>> >> eventually the system runs out of memory.
>> >>
>> >> It can be reproduced by adding this hunk:
>> >>
>> >
>> >> modified gnu/packages/compression.scm
>> >> @@ -215,6 +215,7 @@ adding and extracting files to/from a tar archive.")
>> >> (method url-fetch)
>> >> (uri (string-append "mirror://gnu/gzip/gzip-"
>> >> version ".tar.xz"))
>> >> + (snippet '(#t))
>> >> (sha256
>> >> (base32
>> >> "16h8g4acy7fgfxcjacr3wijjsnixwsfd2jhz3zwdi2qrzi262l5f"))))
>> >>
>> >> [back]
>> >>
>> >> I guess this is because gzip itself is a patch input. Is this something
>> >> that can be fixed, or do we have to use "patching phases" in these cases?
>> >
>> > Its also in commencement.scm, so that might be the loop instead. You
>> > could try "unpatching" it there. It looks like it has a pseudo-package
>> > inside of glibc-utf8-locales-final, with grep-final a few packages lower
>> > being potential inspiration for undoing the modifications in "real
>> > gzip".
>>
>> Indeed. The ‘bootstrap-origin’ procedure, defined in (gnu packages
>> bootstrap), arranges to use the bootstrap binaries of gzip, patch,
>> guile, etc. when patching origins.
>>
>> Perhaps we’re missing a use of ‘bootstrap-origin’ somewhere in (gnu
>> packages commencement)?
>>
>
> Looks like it in the end. the gzip for glibc-utf8-locales-final uses the
> bootstrap guile for its building, but doesn't get the input rewriting
> that comes from package-with-bootstrap-guile. With this patch adding the
> trivial snippet to gzip doesn't cause an infinite loop anymore. Since
> the patch doesn't change the hash of glibc-utf8-locales-final it should
> be OK for master.

If you have verified the patch doesn't cause a world rebuild (guix build
libreoffice), feel free t opush and close this old bug!

--
Thanks,
Maxim
?
Your comment

Commenting via the web interface is currently disabled.

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

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