~abcdw/rde-discuss

3 3

Is `use-package` against reproducibility?

Guu, Jin-Cheng
Details
Message ID
<CAErjG5cyD-Z54eEJFDq0Nibej8fV_bcZEDEzHafKEnQhCCpigg@mail.gmail.com>
DKIM signature
pass
Download raw message
Hi,

Does using `use-package` ([e.g.
org-roam](https://github.com/abcdw/rde/blob/master/rde/emacs/rde-org-roam.el))
in emacs configuration go against the **reproducible** and
**stateless** principle, as it will fetch packages from other repos in
a non-declarative manner? Or there are some magics that guix
performs?!

Best,
Jin
Details
Message ID
<CABrWRW2STqgX-+w6jNo=BYCTaQYseEdAxotjN0EqcSNKhY5PMQ@mail.gmail.com>
In-Reply-To
<CAErjG5cyD-Z54eEJFDq0Nibej8fV_bcZEDEzHafKEnQhCCpigg@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
> Does using `use-package` ([e.g.
> org-roam](https://github.com/abcdw/rde/blob/master/rde/emacs/rde-org-roam.el))
> in emacs configuration go against the **reproducible** and
> **stateless** principle, as it will fetch packages from other repos in
> a non-declarative manner? Or there are some magics that guix
> performs?!

Good questions! use-package on it's own is not a package manager, it's
just a macro, which simplifies package configuration routine. It has
capabilities to interact with package managers like package.el,
straight.el or others:
https://github.com/jwiegley/use-package#package-installation

`:ensure t` is responsible for that, but we don't use those capabilities
intentionally and install all the packages using guix:
https://git.sr.ht/~abcdw/rde/tree/master/item/rde/emacs/packages.scm#L88

In such a way our package configuration depends on the actual guix
package and we can be sure that we can reproduce such configuration with
exact versions of dependencies for it.

I had a talk at EmacsConf 2020 called Building reproducible Emacs and
more detailed talk on my video channel, the solution is based on Nix and
NixOS module system, but you can get a deeper understanding of general
ideas.

-- 
Best regards,
Andrew Tropin
Guu, Jin-Cheng
Details
Message ID
<CAErjG5dozLX7bN9oY+duMS0EgYvOnbUO_kKd8p0yefoOE+iwag@mail.gmail.com>
In-Reply-To
<CABrWRW2STqgX-+w6jNo=BYCTaQYseEdAxotjN0EqcSNKhY5PMQ@mail.gmail.com> (view parent)
DKIM signature
pass
Download raw message
Thank you for your reply!

> In such a way our package configuration depends on the actual guix
package [..]

Oh great! Thanks for clarifying the method.

> https://git.sr.ht/~abcdw/rde/tree/master/item/rde/emacs/packages.scm#L88

In #L88, it seems to pull the *guix package* emacs-org-roam, without
specifying the version. Would that be an issue, as then
emacs-rde-org-roam-0.20 depends on something which seems have not been
pinned?
https://git.sr.ht/~abcdw/rde/tree/dbb5c2b11e52156f2b3cdb060eec62a30a5706e5/item/rde/emacs/packages.scm#L81

My third concern is, really how long is it going to take to package an
emacs package? And how much time do you expect it to take to maintain
emacs packages? Afaik there are emacs package managers (straight.el?)
that claims to be fully reproducible. Wouldn't we use that directly?

Ps. The current discussion is based master=dbb5.., as shown in the
second link in this letter.

Best,
Jin
Details
Message ID
<CABrWRW1FTwxitD3QLjeJY0Lmo7G-oQBWuHDSc-4k7Se3BdUMsg@mail.gmail.com>
In-Reply-To
<CAErjG5dozLX7bN9oY+duMS0EgYvOnbUO_kKd8p0yefoOE+iwag@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
> In #L88, it seems to pull the *guix package* emacs-org-roam, without
> specifying the version. Would that be an issue, as then
> emacs-rde-org-roam-0.20 depends on something which seems have not been
> pinned?
> https://git.sr.ht/~abcdw/rde/tree/dbb5c2b11e52156f2b3cdb060eec62a30a5706e5/item/rde/emacs/packages.scm#L81

It just seems like not a pinned, but in reality, when you do:

`guix time-machine -C channels-lock -- SOME-GUIX-SUBCOMMAND`
or `guix pull -C channels-lock && guix SOME-GUIX-SUBCOMMAND`

Code get evaluated in the context of a specific commit for each channel:
https://git.sr.ht/~abcdw/rde/tree/master/item/rde/channels-lock

Here we 'pin' exact version of guix repository, which contains an exact
version of org-roam package:
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/emacs-xyz.scm?id=67497e20890348ebbd41612e2582b1745a80fec5#n25586

> My third concern is, really how long is it going to take to package an
> emacs package? And how much time do you expect it to take to maintain
> emacs packages?

You can take a look at emacs-xyz.scm to see how simple most of the
package definitions are. Maintenance of such packages is also relatively
simple. It is even possible to create a separate channel with
auto-generated package definitions for *ELPA packages. Here is an
example for nix: https://github.com/nix-community/emacs-overlay

The same approach can be used for Guix as well, but I don't see any
reasons to do that right now, because all the emacs packages I need are
already available.

> Afaik there are emacs package managers (straight.el?) that claim to be
> fully reproducible. Wouldn't we use that directly?

Guix is more capable and generic solution, in addition to
reproducibility, it can manage not only emacs packages, but also system
dependencies (for example provide sqlite binary for org-roam package)
and packages for other languages as well. There are few other
interesting aspects about guix and its ecosystem in the context of
emacs, but even points mentioned above are enough reason to stay with
only one tool for package management.

-- 
Best regards,
Andrew Tropin
Reply to thread Export thread (mbox)