all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: guix-devel@gnu.org
Subject: avoid wrapper scripts when possible
Date: Thu, 02 Nov 2017 22:31:16 +0100	[thread overview]
Message-ID: <87mv44gyfv.fsf@elephly.net> (raw)

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

             reply	other threads:[~2017-11-03 13:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-02 21:31 Ricardo Wurmus [this message]
2017-11-03 18:54 ` avoid wrapper scripts when possible 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

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mv44gyfv.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=guix-devel@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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.