From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: avoid wrapper scripts when possible Date: Thu, 02 Nov 2017 22:31:16 +0100 Message-ID: <87mv44gyfv.fsf@elephly.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eAbsU-0004YI-AM for guix-devel@gnu.org; Fri, 03 Nov 2017 09:19:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eAbsR-00012S-0y for guix-devel@gnu.org; Fri, 03 Nov 2017 09:19:18 -0400 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21008) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eAbsQ-00011P-QM for guix-devel@gnu.org; Fri, 03 Nov 2017 09:19:14 -0400 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org 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