unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: guix-devel@gnu.org
Subject: Re: “guix pack -RR” and ignored environment variables
Date: Mon, 22 Feb 2021 22:34:23 +0100	[thread overview]
Message-ID: <87wnuz9480.fsf@gnu.org> (raw)
In-Reply-To: <87tuq4ku6n.fsf@elephly.net> (Ricardo Wurmus's message of "Mon, 22 Feb 2021 16:18:08 +0100")

Hey ho!

Ricardo Wurmus <rekado@elephly.net> skribis:

> today I wanted to offer a pack of Guile Studio, which provides a wrapper
> script “guile-studio” that sets EMACSLOADPATH and then spawns Emacs:
>
> #!/gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/sh
> EMACSLOADPATH=/gnu/store/7z33lhy9m8xqgym9w3hj30y1w290c8hn-emacs-27.1/share/emacs/site-lisp:/gnu/store/22qrgczgs13r81vh0assi44g65352jsb-emacs-f-0.20.0/share/emacs/site-lisp:/gnu/store/02wl4g5r2jcw3xa50wlvxrzgnbvfl4j9-emacs-memoize-1.1/share/emacs/site-lisp:/gnu/store/5ypb61cywf1jcxb2p85a85a2m19yvbgd-emacs-all-the-icons-4.0.1/share/emacs/site-lisp:/gnu/store/hf1gv2fn3ksnmswmqs2iqpi6762l3vw8-emacs-all-the-icons-dired-1.0-1.980b774/share/emacs/site-lisp:/gnu/store/253a5n1ss5j7q1bn21nxlm468csmnnys-emacs-dired-sidebar-0.1.0-2.da77919/share/emacs/site-lisp:/gnu/store/kfmh5kngrh2911nlwp5wsrjmpwfj7kj4-emacs-doom-modeline-3.0.0/share/emacs/site-lisp:/gnu/store/khrdrw2b06jnf632l886y0ayk2vb62il-emacs-modus-themes-1.1.1/share/emacs/site-lisp:/gnu/store/p7igyy5yfkc1fvnvx19h2g49f6qaajs5-emacs-geiser-0.12/share/emacs/site-lisp:/gnu/store/zf82m64bp66v3sh0rr4p6c26z996dmix-emacs-company-0.9.13/share/emacs/site-lisp:/gnu/store/syrgm56fbk0722rnr59wpircv9n73r2n-emacs-ivy-0.13.1/share/emacs/site-lisp:/gnu/store/425l8kf2rpk9c418vi8i42mw365b4a18-emacs-flycheck-31-2.9bcf6b6/share/emacs/site-lisp:/gnu/store/5z9jjvcfj8qka4ly8iysyrgvyzksj6ig-emacs-flycheck-guile-0.2/share/emacs/site-lisp:/gnu/store/43bpv64d0a6x8bmqcdp4fsawhmspd5mk-emacs-paren-face-1.0.7/share/emacs/site-lisp:/gnu/store/gpwzl1nsis1s3q48sl8qn0hm4g41qgyz-emacs-dash-2.18.0/share/emacs/site-lisp:/gnu/store/gcw8lz0xvansb4dpfiq9m3kzqx0qc12n-emacs-s-1.12.0/share/emacs/site-lisp:/gnu/store/0iwc19qcn2ylrnpsqrfmg8jsij0q6yz7-emacs-dired-hacks-0.0.1-3.d1a2bda/share/emacs/site-lisp:/gnu/store/1a6aqvylh3qym2n3npp9gbvcfpzyglgg-emacs-shrink-path-0.3.1/share/emacs/site-lisp:/gnu/store/60qfm0v7v3h9bl3x5q6iw1kb1phy0w2z-emacs-hydra-0.15.0/share/emacs/site-lisp:/gnu/store/jvdh3zi4fc28ipk2g1na1i6vfa8xismi-emacs-eimp-1.4.0-1.2e7536f/share/emacs/site-lisp:
> exec /gnu/store/7z33lhy9m8xqgym9w3hj30y1w290c8hn-emacs-27.1/bin/emacs -mm --no-site-file --no-site-lisp --no-x-resources --no-init-file --load /gnu/store/z2wix8r2gqs4lwwnq744qpj54051y8cy-guile-studio-0.1.0-1.93622e7/share/guile-studio.el
>
> Unfortunately, Emacs fails to find ivy when I launch it from a
> relocatable pack in a container (to ensure that the contents of the pack
> are sufficient).  Here’s what I did:
>
>     $ guix pack -RR -S /bin=bin glibc-locales guile-studio guile
>     $ cp the-pack.tar.gz /tmp/test
>     $ cd /tmp/test
>     $ xhost +local:
>     $ guix environment --container -E ^DISPLAY$ --share=/tmp/.X11-unix --ad-hoc tar gzip bash coreutils
>     [env] $ tar xf the-pack.tar.gz
>     [env] $ ./bin/guile-studio
>
> I look at the value of “load-path” in Emacs and I don’t see any of the
> items that are mentioned on the EMACSLOADPATH environment variable, only
> things provided by Emacs itself.  “(getenv "EMACSLOADPATH")’ returns
> nil.
>
> Are shell wrappers not working when using the binary wrapper produced by
> ‘guix pack -RR’?

Hmm I did this test:

--8<---------------cut here---------------start------------->8---
$ guix pack -RR grep -S /bin=bin
/gnu/store/ghi97dm2wap95vhzm03m7rfff4fmd9rh-tarball-pack.tar.gz
--8<---------------cut here---------------end--------------->8---

and then:

--8<---------------cut here---------------start------------->8---
$ unshare -mrf
# cd /tmp
# mkdir pack
# cd pack
# tar xf /gnu/store/ghi97dm2wap95vhzm03m7rfff4fmd9rh-tarball-pack.tar.gz
# mount -t tmpfs none /gnu/store
# ./bin/egrep --version
grep (GNU grep) 3.4
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others; see
<https://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
# echo /gnu/store/*
/gnu/store/*
--8<---------------cut here---------------end--------------->8---

where ‘egrep’ is a script.  So it looks alright.

My guess is that the container you created contains some store items,
such as the bash that appears in shebang.  Relocatable wrappers don’t do
the namespace/proot/fakechroot dance when the original binary in the
store exists, and instead they executed it directly.  But in your case,
since you have an incomplete store, you’re maybe running bash from the
store (thus without store mappings), and somehow things go wrong
somewhere down the road?…

Thanks,
Ludo’.


  reply	other threads:[~2021-02-22 21:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-22 15:18 “guix pack -RR” and ignored environment variables Ricardo Wurmus
2021-02-22 21:34 ` Ludovic Courtès [this message]
2021-02-24 14:18   ` 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=87wnuz9480.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=rekado@elephly.net \
    /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).