Subject: bug#61255: closed (Re: [bug#61255] [PATCH v2 8/8] news: Add entry for the new 'rpm' guix pack format.)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 20 Feb 2023 02:26:02 +0000

Your bug report

#61255: [PATCH 0/5] Add support for the RPM format to "guix pack"

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
61255: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61255
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#61255] [PATCH v2 8/8] news: Add entry for the new 'rpm' guix pack format.
From: Maxim Cournoyer <[email-masked]>
To: "pelzflorian (Florian Pelz)" <[email-masked]>
Cc: [email-masked]
Date: Sun, 19 Feb 2023 21:25:05 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

"pelzflorian (Florian Pelz)" <[email-masked]> writes:

> This message was not accepted by Gmail, it reports SPF/DKIM error, so I
> resend.

Well received!

> Hi Maxim!  Two things.  First, could you include this German
> translation?
>
>> (title
>>  (en "New @samp{rpm} format for the @command{guix pack} command"))
>
> (de "Neues Format @samp{rpm} für den Befehl @command{guix pack}")
>
>
>> (body
>>  (en "RPM archives (with the .rpm file extension) can now be produced
>
> (de "Sie können jetzt auch RPM-Archive (mit der Dateinamenserweiterung
> .rpm) erzeugen mit dem Befehl @command{guix pack --format=rpm}.  Damit
> haben Sie einen alternativen Distributionsweg für mit Guix erstellte
> Software.  Hier sehen Sie ein einfaches Beispiel, wie Sie ein
> RPM-Archiv für das Paket @code{hello} erzeugen:
>
> @example
> guix pack --format=rpm --symlink=/usr/bin/hello=bin/hello hello
> @end example
>
> Siehe @command{info \"(guix.de) Aufruf von guix pack\"} für mehr
> Informationen.")

Done, thank you!

> —Other than that, I just tried using your patch to make hello.rpm as in
> the news example and to make another advent.rpm with open-adventure.  To
> my surprise, I could install both (on a fresh install of Fedora Server
> x86_64 without Guix installed), even though hello and open-adventure
> both reference /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33.
>
> From reading your documentation, I had not expected this.  Perhaps you
> should mention that it is possible to both run `sudo rpm -i hello.rpm`
> and `sudo rpm -i advent.rpm` and it does not conflict?

Thanks for sharing your feedback!  I could reproduce the experiment in
an old RHEL VM, and indeed, identical files do not seem to cause
conflicts, which is awesome for our use case!  I've modified the doc as
follow:

--8<---------------cut here---------------start------------->8---
modified   doc/guix.texi
@@ -6940,8 +6940,7 @@ RPM archive, for example.
 
 The RPM format supports relocatable packages via the @option{--prefix}
 option of the @command{rpm} command, which can be handy to install an
-RPM package to a specific prefix, making installing multiple
-Guix-produced RPM packages side by side possible.
+RPM package to a specific prefix.
 
 @example
 guix pack -f rpm -R -C xz -S /usr/bin/hello=bin/hello hello
@@ -6952,11 +6951,10 @@ sudo rpm --install --prefix=/opt /gnu/store/...-hello.rpm
 @end example
 
 @quotation Note
-Similarly to Debian packages, two RPM packages with conflicting files
-cannot be installed simultaneously.  Contrary to Debian packages, RPM
-supports relocatable packages, so file conflicts can be avoided by
-installing the RPM packages under different installation prefixes, as
-shown in the above example.
+Contrary to Debian packages, conflicting but @emph{identical} files in
+RPM packages can be installed simultaneously, which means multiple
+@command{guix pack}-produced RPM packages can usually be installed side
+by side without any problem.
 @end quotation
 
 @quotation Warning
--8<---------------cut here---------------end--------------->8---
 
With this, I've now pushed the series to master, after running 'make
check TESTS="tests/rpm.scm tests/pack.scm"' one last time.

Enjoy!

Closing.

-- 
Thanks,
Maxim

Subject: [PATCH 0/5] Add support for the RPM format to "guix pack"
From: Maxim Cournoyer <[email-masked]>
To: [email-masked]
Cc: Maxim Cournoyer <[email-masked]>
Date: Fri, 3 Feb 2023 11:19:26 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello Guix!

This series adds support for the RPM format to "guix pack", so that one can
generate an RPM archive via e.g. "guix pack -f rpm hello", and install it on
their favorite RPM-based GNU/Linux distribution.  With the exception of the
payload compression, the generation of the archive is fully handled in Scheme,
which ended up being tricky, with the documentation about the RPM binary
format being scarce.  Most of the problems encountered were figured out
stepping an 'rpm' command invocation in GDB, which felt a bit like reverse
engineering!

Anyway, the end result appears to work well and has few dependencies (compared
to using 'rpmbuild', as most other projects do), so I think it was worth the
effort.

Thanks!

Maxim Cournoyer (5):
  pack: Extract keyword-ref procedure from debian-archive.
  gexp: computed-file: Honor %guile-for-build.
  pack: Extract populate-profile-root from
    self-contained-tarball/builder.
  tests: pack: Fix indentation.
  pack: Add RPM format.

 Makefile.am           |   2 +
 doc/guix.texi         |  45 +++-
 guix/gexp.scm         |   3 +-
 guix/rpm.scm          | 577 ++++++++++++++++++++++++++++++++++++++++++
 guix/scripts/pack.scm | 478 +++++++++++++++++++++++++---------
 tests/pack.scm        | 331 ++++++++++++++----------
 tests/rpm.scm         |  86 +++++++
 7 files changed, 1258 insertions(+), 264 deletions(-)
 create mode 100644 guix/rpm.scm
 create mode 100644 tests/rpm.scm

base-commit: a60c750eec73a2030b08b32af3b9f435c7ecca54
-- 
2.39.1