From: Giovanni Biscuolo <g@xelera.eu>
To: zimoun <zimon.toutoune@gmail.com>
Cc: help-guix <help-guix@gnu.org>
Subject: emacs byte-compiled packages incompatibilities (was Re: emacs-guix invalid byte opcode: op=183 ptr=25)
Date: Thu, 28 Feb 2019 15:47:45 +0100 [thread overview]
Message-ID: <87o96w2cmm.fsf@roquette.mug.biscuolo.net> (raw)
In-Reply-To: <CAJ3okZ2CC5c__BC6Tbz858wrrWvXXZgHf_DZfK6O=e2AdbWMuw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4409 bytes --]
Hi ziomun,
I'm planning to migrate from my "foreign distro managed" emacs (Debian)
to a "guix managed one" (on Debian), so I'm very interested in this
thread and related hints and solutions
since I wanted a declarative approach to package management, I'm using
"use-package" [1] to install and configure emacs packages; simple
example for my magit installation:
--8<---------------cut here---------------start------------->8---
(use-package magit
:ensure t
:pin "MELPA_Stable"
:bind ("C-x g" . magit-status))
--8<---------------cut here---------------end--------------->8---
(MEPLA_Stable repository is defined in my init.el)
in a near future I'd like to let guix manage _all_ my emacs packages, so
I'm planning to remove all the ":ensure t" declarations (and pin): this
way my "guix installed emacs" will never try to install a package via
MELPA_Stable when loading my init.el (am I wrong?)
there could be a better option: use a conditional [2] so that ":ensure"
and ":pin" are evaluated _only_ when "not in guix"; this way I could
continue using my "stable emacs environment" without worklow
interruptions (in this case I should also find a way to completely
ignore ~/.emacs.d/elpa installed packages: how?) until I manage to
complete my "guix emacs environment"
I'd even be able to use my dotfolder on all my other machines, even
those still not "emacs-migrated" to guix: this is a plud I'd really
appreciate
John Wiegley gives us an example [3] of conditional loading that will
stop :ensure (AFAIU the whole use-package) evaluation from happening on
Mac systems:
--8<---------------cut here---------------start------------->8---
(when (memq window-system '(mac ns))
(use-package exec-path-from-shell
:ensure t
:config
(exec-path-from-shell-initialize)))
--8<---------------cut here---------------end--------------->8---
I've still not experimented moving the conditional _only_ around
:ensure, like this
--8<---------------cut here---------------start------------->8---
(use-package exec-path-from-shell
(when (memq window-system '(mac ns))
:ensure t
:pin "MELPA_Stable")
:config
(exec-path-from-shell-initialize))
--8<---------------cut here---------------end--------------->8---
so don't know if the conditional can be *just* for :ensure (and :pin)
anyway, first and foremost: is there a way to check if I'm running a
"guix emacs" or the foreign distro one?
(memq packaging-system '(gnu guix)) ? :-)
any hint wellcome since this could potentially save me a lot of downtime
with emacs (I almost digitally live in emacs and a little bit of
browser)
zimoun <zimon.toutoune@gmail.com> writes:
[...]
> Therefore, if one runs Emacs version 24 (the one coming with `apt-get
> install emacs` on Debian 9) and `guix package -i emacs-stuff`, then it
> leads to incompatibilities. Right?
AFAIU incompatibilies will arise only if you try to load the "Debian
emacs" compiled packages in the guix installed emacs; vice versa does
not apply since guix emacs packages are well isolated in the /gnu/store
and "debian emacs" doen even know they exists (unless you explicitly add
a load path in your init.el)
as I sayd above, I still don't know how to skip loading packages from
~/.emacs.d/elpa when in "guix emacs"
[...]
> My "advice" about Emacs and its packages on foreign distro is:
> - install Emacs from Guix (guix package -i emacs) because the version
> is more up to date (than Debian for example)
> - adapt the PATH or add `source ~/.guix-profile/etc/profile` to
> enable the correct Emacs (from Guix)
> - choose only one way to install emacs packages: from ELPA/MELPA *or*
> from Guix *and* it is not recommanded to mix the both.
when using the "native" one, emacs could be started using a different
user-emacs-directory: this way emacs installed packages (from
ELPA/MELPA or manually) will be available only in that environment
but this solution is not good for me, since I should maintain two
different config trees: one for each emacs... no no no :-O
comments wellcome!
[...]
Thanks
Giovanni
[1] https://jwiegley.github.io/use-package/
[2] https://jwiegley.github.io/use-package/keywords/#if-when-unless
[3] https://github.com/jwiegley/use-package#conditional-loading
--
Giovanni Biscuolo
Xelera IT Infrastructures
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2019-02-28 14:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-28 10:28 emacs-guix invalid byte opcode: op=183 ptr=25 Yoshinori Arai
2019-02-28 10:37 ` Pierre Neidhardt
2019-02-28 12:26 ` zimoun
2019-02-28 13:28 ` Pierre Neidhardt
2019-02-28 14:47 ` Giovanni Biscuolo [this message]
2019-02-28 15:11 ` emacs byte-compiled packages incompatibilities (was Re: emacs-guix invalid byte opcode: op=183 ptr=25) Pierre Neidhardt
2019-02-28 19:03 ` emacs-guix invalid byte opcode: op=183 ptr=25 Ricardo Wurmus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87o96w2cmm.fsf@roquette.mug.biscuolo.net \
--to=g@xelera.eu \
--cc=help-guix@gnu.org \
--cc=zimon.toutoune@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).