From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Wingo Subject: Re: [PATCH v6 01/10] gnu: cross: Use CROSS_*_INCLUDE_PATH for system headers. Date: Fri, 29 Apr 2016 11:36:21 +0200 Message-ID: <877ffgpxii.fsf@igalia.com> References: <87pota7sxv.fsf@drakenvlieg.flower> <87twimqh7x.fsf@igalia.com> <87k2jh5w0o.fsf@drakenvlieg.flower> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aw5Pp-0004VN-QF for guix-devel@gnu.org; Fri, 29 Apr 2016 06:13:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aw5Pd-0007ef-Qb for guix-devel@gnu.org; Fri, 29 Apr 2016 06:12:48 -0400 In-Reply-To: <87k2jh5w0o.fsf@drakenvlieg.flower> (Jan Nieuwenhuizen's message of "Thu, 28 Apr 2016 22:16:39 +0200") 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: Jan Nieuwenhuizen Cc: guix-devel@gnu.org Hi :) On Thu 28 Apr 2016 22:16, Jan Nieuwenhuizen writes: >>> @@ -167,7 +172,11 @@ without requiring the source code to be rewritten.") >>> (let ((bash (assoc-ref inputs "bash"))) >>> (substitute* "module/ice-9/popen.scm" >>> (("/bin/sh") >>> - (string-append bash "/bin/bash"))))) >>> + ,(if (mingw-target?) >>> + "cmd.exe" >>> + `(if bash >>> + (string-append bash "/bin/bash") >>> + "bash")))))) >>> %standard-phases))) Note that this patch has an extra level of quoting for the not-mingw case. >> >> I guess the thing is, cmd.exe is part of the system, so it should be >> linked "dynamically" (i.e. via the PATH); but is cmd.exe really a bash >> replacement? Is this the right way for open-pipe in Guile to work? > > Good question. I don't really know. Probably it's not; but then, even > if we have bash would't you expect some utils like cat/grep/sed? FWIW, > I spent two nights trying to port bash before I decided to give up, err > re-prioritise. I'd love to provide that all, and I'd also love to get > some help with that ;-) > > I can imagine that if I somehow installed a version of bash.exe > (msys/cygwin) in PATH, I would expect open-pipe to use that rather than > cmd. > > I'm not sure if you have a suggestion for change here, or if we should > get more input first? 3 options: 1. Run cmd.exe from path. Disadvantage: incompatible interface. 2. Build bash in mingw for Guix; no special cases. The Right Thing. However I'm OK with accepting a patch that doesn't do this, in the interests of moving things forward. 3. Run bash from path. Disadvantage: bash probably not in the path and the invocation would fail. Arguably an early failure is the right thing, though! I think I'd go with (3) rather than (1). WDYT? From a Guile perspective you can always use `open-pipe*' which doesn't trampoline through a shell at all. > So, most of the difficulties I had should be fixed now; not sure what > difficulties the next person will have. So, what to write exactly? > > Below is a first attempt that I didn't want to send as a proper patch > yet. I could do with some input, especially from Manolis. It's really helpful to me, thank you! Andy