emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patches for elpa-admin


From: Philip Kaludercic
Subject: Re: Patches for elpa-admin
Date: Sat, 21 May 2022 11:38:09 +0000

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I will wait a bit to implement the changes i mentioned.
>
> Looking forward to them, thanks.

I have been experimenting with buffer-env's recent Guix support, and I
think it supersedes everything I had proposed before:

>From 9179865491899b6863967e0265afc50bf35f1f84 Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@posteo.net>
Date: Sat, 21 May 2022 13:31:24 +0200
Subject: [PATCH] Add GNU Guix manifest.scm

---
 manifest.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 manifest.scm

diff --git a/manifest.scm b/manifest.scm
new file mode 100644
index 0000000000..5dfc19941a
--- /dev/null
+++ b/manifest.scm
@@ -0,0 +1,19 @@
+;; GNU Guix manifest for (Non)GNU ELPA
+;;
+;; This file specifies all the packages that are required for the ELPA
+;; build system to function correctly.  You can either use the "guix
+;; shell" command to create an environment with everything prepared.
+
+(specifications->manifest
+ (list "bubblewrap"
+       "coreutils"
+       "emacs-minimal"
+       "git"
+       "grep"
+       "imagemagick"
+       "lzip"
+       "make"
+       "markdown"
+       "tar"
+       "texinfo"))
+
-- 
2.36.1

>From 6ecb36dbb9c2a87501f4411e29f76f694eca452d Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@posteo.net>
Date: Sat, 21 May 2022 13:32:04 +0200
Subject: [PATCH] Add GNU Guix manifest.scm

---
 manifest.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 manifest.scm

diff --git a/manifest.scm b/manifest.scm
new file mode 100644
index 0000000000..5dfc19941a
--- /dev/null
+++ b/manifest.scm
@@ -0,0 +1,19 @@
+;; GNU Guix manifest for (Non)GNU ELPA
+;;
+;; This file specifies all the packages that are required for the ELPA
+;; build system to function correctly.  You can either use the "guix
+;; shell" command to create an environment with everything prepared.
+
+(specifications->manifest
+ (list "bubblewrap"
+       "coreutils"
+       "emacs-minimal"
+       "git"
+       "grep"
+       "imagemagick"
+       "lzip"
+       "make"
+       "markdown"
+       "tar"
+       "texinfo"))
+
-- 
2.36.1

It might also be possible to add this to the elpa-admin branch, and link
it into elpa/nongnu like like the GNUmakefile.

>From b9127e66e956c94ef30b5f3dd2d9a61d9d2c545b Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@posteo.net>
Date: Sat, 21 May 2022 13:29:19 +0200
Subject: [PATCH 1/2] Bind /gnu directory as a read-only mount when sandboxing

This allows for packages installed and made available using GNU Guix
to be used by bubblewrap.
---
 elpa-admin.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elpa-admin.el b/elpa-admin.el
index d570c3c6aa..a546bb63ba 100644
--- a/elpa-admin.el
+++ b/elpa-admin.el
@@ -955,7 +955,7 @@ The INFILE and DISPLAY arguments are fixed as nil."
     "--tmpfs" "/tmp"))
 
 (defvar elpaa--sandbox-ro-binds
-  '("/lib" "/lib64" "/bin" "/usr" "/etc/alternatives" "/etc/emacs"))
+  '("/lib" "/lib64" "/bin" "/usr" "/etc/alternatives" "/etc/emacs" "/gnu"))
 
 (defun elpaa--call-sandboxed (destination &rest args)
   "Like ‘elpaa--call’ but sandboxed.
-- 
2.36.1

With a manifest file, all the packages necessary for the ELPA
build-system to work are provided within the new environment.  All that
has to be changed (see last patch) is to tell bubblewrap that the /gnu
directory should be visible, as "guix shell" adds a profile from within
that directory to the PATH.

I also noticed that there are issues when running "make -B" because
mkdir doesn't want to re-create the "packages" directory.  So this
change should be non-controversial:

>From 05edc183b771611e2e028d00bdb1de437a52b504 Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@posteo.net>
Date: Sat, 21 May 2022 13:29:56 +0200
Subject: [PATCH 2/2] Tolerate if packages/ already exists

---
 GNUmakefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/GNUmakefile b/GNUmakefile
index a7d078a1a8..b3d2228900 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -135,7 +135,7 @@ packages/%.elc: packages/%.el
 # $(extra_elcs):; rm $@
 
 packages:
-       mkdir $@
+       mkdir -p $@
 
 include $(PKG_DESCS_MK)
 $(PKG_DESCS_MK): elpa-packages packages
-- 
2.36.1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]