unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* avoid wrapper scripts when possible
@ 2017-11-02 21:31 Ricardo Wurmus
  2017-11-03 18:54 ` Christopher Baines
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Ricardo Wurmus @ 2017-11-02 21:31 UTC (permalink / raw)
  To: guix-devel

Hi Guix,

the environment activation feature of our “conda” package currently
fails.  This is because the “deactivate” shell script is wrapped in
another shell script.  This leads to the actual shell script to be
called “.deactivate-real”.  The script compares the value of “$0” with
the expected name “deactivate”.  This fails so conda misbehaves.

Since “deactivate” is really just a shell script I think we could avoid
the renaming and the external wrapper by setting the environment
variables in the “deactivate” script itself.

This made me wonder if we could avoid shell wrappers in more cases.  If
the target script is a Python script we could set the environment
variables right after the Python shebang with Python code.  If the
target script is a shell script we can set environment variables right
there after the shebang.

For binaries (like emacs) we’d still create shell wrappers where needed,
because it’s harder to do this natively.

What do you think?

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

^ permalink raw reply	[flat|nested] 16+ messages in thread
* Re: avoid wrapper scripts when possible
@ 2021-09-07 18:52 Attila Lendvai
  2021-09-07 20:41 ` Maxime Devos
  0 siblings, 1 reply; 16+ messages in thread
From: Attila Lendvai @ 2021-09-07 18:52 UTC (permalink / raw)
  To: guix-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 729 bytes --]

pardon me for reviving a years old discussion, but i'm facing the same problem once again.

i have updated trezor support, and i wanted to test generating a new gpg key:

$ trezor-gpg init "foobar <foo@bar.com>"

leading to: OSError: Cannot find '.trezor-gpg-gpg-agent' in $PATH

upstream relies on sys.argv[0] in a non-trivial way:

https://github.com/romanz/trezor-agent/blob/338a075ed500f210a707cb3adf90104602e35c48/libagent/gpg/__init__.py#L124

is there any chance to revive this effort?

original discussion: https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00017.html

shall i open an issue? for this specific problem, or the wider situation discussed in the mailing list thread?

- attila
PGP: 5D5F 45C7 DFCD 0A39

[-- Attachment #2: Type: text/html, Size: 1349 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread
* Re: avoid wrapper scripts when possible
@ 2021-09-24 21:38 John Kehayias
  0 siblings, 0 replies; 16+ messages in thread
From: John Kehayias @ 2021-09-24 21:38 UTC (permalink / raw)
  To: guix-devel@gnu.org; +Cc: maximedevos@telenet.be

Related is #50798 which I just filed https://debbugs.gnu.org/cgi/bugreport.cgi?bug=50789 This is a similar issue in the executable path picked up by a program (finding the -real one) and using that for writing a .desktop file.

Not sure if there is anything more general to do here, other than having to find these cases and patch manually? Is there a preferred way of making these patches?

Thanks,
John


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2021-09-24 21:38 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-02 21:31 avoid wrapper scripts when possible Ricardo Wurmus
2017-11-03 18:54 ` Christopher Baines
2017-11-03 19:22   ` Jan Nieuwenhuizen
2017-11-03 21:17   ` Ricardo Wurmus
     [not found]     ` <874lqbghlz.fsf@elephly.net>
2017-11-03 22:41       ` Ricardo Wurmus
2017-11-05 11:10     ` Hartmut Goebel
2017-11-04 21:42   ` Eric Bavier
2017-11-04 10:12 ` Hartmut Goebel
     [not found]   ` <87tvy9ptge.fsf@elephly.net>
2017-11-05 11:00     ` Hartmut Goebel
2017-11-05 17:06       ` Ludovic Courtès
2017-11-06 15:53 ` Dave Love
  -- strict thread matches above, loose matches on Subject: below --
2021-09-07 18:52 Attila Lendvai
2021-09-07 20:41 ` Maxime Devos
2021-09-08  9:20   ` Attila Lendvai
2021-09-08 10:39     ` Maxime Devos
2021-09-24 21:38 John Kehayias

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).