From: "Danny Milosavljevic" <dannym@scratchpost.org>
To: ludo@gnu.org, liliana.prikler@gmail.com
Cc: cox.katherine.e+guix@gmail.com, 72994@debbugs.gnu.org,
dannym@friendly-machines.com, andrew@trop.in
Subject: [bug#72994] manifest.scm and emacs-specific things
Date: Sat, 21 Dec 2024 23:58:04 +0100 (CET) [thread overview]
Message-ID: <20241221225804.96AA91121508@dd30410.kasserver.com> (raw)
In-Reply-To: <6913205399a12a20587ef1826a7fa44cc01d8b2a.camel@gmail.com>
Hi Liliana
> I don't think referring to a manifest as necessarily "manifest.scm"
> helps us here.
It's the one that guix shell and emacs-buffer-env pick up by default.
> If you only have one "guix.scm" and one "manifest.scm"
> at most, then yes, whatever you need for your hacking setup to work
> will have to bleed into the latter. But it wouldn't be too weird
> putting emacs, emacs-snail, julia, julia-cstparser and julia-tokenize
> into one "snail-manifest.scm", that you can reuse for multiple
> projects.
Tomorrow, emacs-julia-snail could drop cstparser for xyzparser.
And "snail-manifest.scm" is not what buffer-env uses. We'd have to
patch buffer-env so it tries 10 different names in priority order or
something.
Or every programmer would have to manually set up init.el to do:
(setq buffer-env-script-name
'("julia-snail-manifest.scm"
"python-lsp-manifest.scm"
"python-repl-manifest.scm"
"c-manifest.scm"
...
"xyz-manifest.scm"
"manifest.scm"
".envrc"))
I think that's a cop out.
Instead of fixing it, make the user fiddle with it manually. It's the unix way.
Let's not do that if possible.
> If you want to look at a comparable situation, look at emacs-geiser and
> its implementations like emacs-geiser-guile. Here, the reference to
> guile in geiser is patched to point at the correct guile – load paths
> pose no issue.
I had a look at it now. Not sure it's the same situation. Is it?
I think in the guile situation it's not that bad because parsing guile is not
exactly difficult enough to need a library (or two :) ).
In the case of julia the situation is:
emacs-julia-snail launches the executable "julia" and uses
julia's "cstparser" and "tokenize"--both of which are non-standard
julia modules--to figure out what of the communication buffer to use.
(It has to do that because the julia grammar is complicated)
Note: The julia REPL SHOULD load any other user modules from
the guix environment of the manifest! That is, the current guix
environment is the correct environment for the REPL for almost
every module (except two--and even those maybe it should pick
up in all non-automatic-emacs situations).
-----------------
In my earlier attempts using julia-snail on guix master was even worse:
If "julia" is not in the manifest but "julia-cstparser" is in the manifest,
then the search path for julia modules will not be set up and
consequently cstparser will not be found.
That is the case even if "julia" would be in the guix profile anyway (!!).
I fixed it by installing "don't do that then" into my head.
But my goal is not fixing it just for myself (I did work around this
stuff already) but to make the experience of guix users better.
Do you agree that this specific situation is terrible? I mean I know
why it is like that technically--but it's still bad. Can't we have nested
guix environments somehow pick up search paths even in that
situation?
Or warn about the situation?
Anything but what it does currently.
-----------------
> If we can do something similar for julia, that'd be
> great, but… I think leaking cstparser might be a no-no, would it?
What do you mean, exactly?
If you mean this:
If the user has to explicitly specify the word "cstparser" it will become an official
interface and will break if emacs-julia-snail ever uses xyzparser instead of cstparser
in the future. Therefore, emacs-julia-snail must not switch those out in the next
10 years or so.
I mean we can do that but in my opinion it's not the best solution.
If you mean that:
The only problem with bundling cstparser is that you can't load another
cstparser as the end user in the same (snail) repl. You will just get the
first one if you try.
That's it.
Maybe there's even something like (@ (cstparser) x) that wouldn't even
keep the module loaded. If so, would also be a possibility to use that.
Would it be so bad? For me, it's important that guix doesn't silently
do nothing when I put another cstparser in the same environment.
I have no problem even with an error message and failure that says
that there's already a cstparser and why am I trying to add another
cstparser.
For that matter, we could rename the emacs julia cstparser module to
some random string and use it like that. That's ... actually my
favorite solution now!
It's all nice and good to have all those possibilities but which one do
we take, or at least recommend? The situation in guix master surely is
not acceptable--see my older mail where I described just how bad it
is in vivid detail.
> I mean, you could start pure guix shells as emacs subprocesses.
Good idea! This is an excellent observation and I can think of
multiple other bad guix situations (end user programs pick the
wrong gtk up etc) that can (and probably should) be fixed like
that for everyone!
(For using a supposedly purely functional package manager I'm
using a surprising amount of my lifetime to prevent
environmental leakage from breaking my stuff.
I *should* do "guix shell --pure" right after login so the gdm
env var leakage into my desktop session is gone, for example)
For building projects I use
guix build -f guix.scm
(yes, from within emacs) and those are isolated anyway.
So I guess if emacs did some extra weird stuff when the user
is not building the project yet it would not be that bad anyway.
next prev parent reply other threads:[~2024-12-21 22:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-03 0:02 [bug#72994] [PATCH] gnu: emacs-julia-snail: Vendor julia libraries Danny Milosavljevic
2024-09-16 8:24 ` Ludovic Courtès
2024-09-16 18:01 ` dannym
2024-09-17 17:19 ` Liliana Marie Prikler
2024-10-17 7:42 ` Ludovic Courtès
2024-12-21 18:33 ` [bug#72994] manifest.scm and emacs-specific things Danny Milosavljevic
2024-12-21 20:20 ` Liliana Marie Prikler
2024-12-21 22:58 ` Danny Milosavljevic [this message]
2024-12-22 8:49 ` Liliana Marie Prikler
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=20241221225804.96AA91121508@dd30410.kasserver.com \
--to=dannym@scratchpost.org \
--cc=72994@debbugs.gnu.org \
--cc=andrew@trop.in \
--cc=cox.katherine.e+guix@gmail.com \
--cc=dannym@friendly-machines.com \
--cc=liliana.prikler@gmail.com \
--cc=ludo@gnu.org \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
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).