From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Thompson Subject: Using 'system*' instead of 'system' in 'guix environment' Date: Wed, 07 Oct 2015 21:28:38 -0400 Message-ID: <87io6iqhbt.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zk00f-000128-VJ for guix-devel@gnu.org; Wed, 07 Oct 2015 21:28:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zk00f-0007rR-0b for guix-devel@gnu.org; Wed, 07 Oct 2015 21:28:41 -0400 Received: from mail.fsf.org ([208.118.235.13]:52701) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zk00e-0007rN-Tc for guix-devel@gnu.org; Wed, 07 Oct 2015 21:28:40 -0400 Received: from 209-6-40-86.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.40.86]:44910 helo=izanagi) by mail.fsf.org with esmtpsa (TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1Zk00d-00020b-TX for guix-devel@gnu.org; Wed, 07 Oct 2015 21:28:40 -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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org Hello Guix hackers, In an effort to finish up a patch to add a --container flag to 'guix environment', I've encountered a serious problem. The --exec flag allows the user to pass an arbitrary command to be run using 'system'. Unlike 'system*', 'system' spawns a command interpreter first and passes the command string in. This is very problematic when using a container, because there's a very good chance that the command interpreter of the running Guile process is not mounted inside the container. So, I think we should switch to using 'system*' instead which will avoid this hairy issue. However, it's unclear to me how to make this happen. I wanted to use 'system*' since I first wrote 'guix environment', but I couldn't figure out how to make the command line syntax work since each argument needs to be processed separately instead of being bunched up into a string. If the above explanation is confusing, the 'sudo' program provides a good example of the UI I'm after: sudo guile -c '(do-root-things)' But for now we're stuck with this: guix environment --ad-hoc guile -E "guile -c '(do-root-things)'" Now, we can't actually do exactly what 'sudo' does because 'guix environment' already recognizes operands as package names, not program arguments. Perhaps we can use '--' to separate the package list from the command to run: guix environment --ad-hoc guile -- guile -c '(do-root-things)' Does that look okay? Any other ideas? Thanks, - Dave