Page 1 of 1

Sbcl 1.0.28: Couldn't fork process error using asd

PostPosted: Thu Jul 02, 2009 9:56 am
by Harnon
I am trying to get asdf:run-shell-command to work on sbcl 1.0.28 in windows vista 32 bit.
Looking at the asdf code, this is effectively what it calls and the error produced:
Code: Select all
(sb-ext:run-program "sh" (list "-c" "notepad.exe") :input nil :output nil) --> Couldn't fork process: No such file or directory
(sb-ext:run-program "sh" (list "-c" "notepad.exe") :input nil :output nil :search t) --> Couldn't fork child process: invalid argument.


On the other hand, if I simply do
Code: Select all
(sb-ext:run-program "notepad.exe" '())

Everything works fine.

I'm guessing that sbcl simply can't find the sh command. However, sh -c "notepad.exe" works fine when I go to the command prompt. How do I get it to work?
Sbcl, in this case, is located under C:\Program Files\Steel Bank Common Lisp\1.0.28\, in case it matters.
Thx!

Re: Sbcl 1.0.28: Couldn't fork process error using asd

PostPosted: Thu Jul 02, 2009 11:14 am
by smithzv
Windows has `sh' now? Or did you just install Cygwin or something?

Maybe I am being too simple here, but the first thing I would do is check the PATH environment variable (well that is what I would do under Cygwin). See what (sb-posix:getenv "PATH") returns and make sure that the directory containing sh is in the list.

A quick check for your hypothesis is to specify the full path to sh on in the RUN-PROGRAM command.

Hope something helps,
Zach

Re: Sbcl 1.0.28: Couldn't fork process error using asd

PostPosted: Sun Jul 05, 2009 7:32 pm
by Harnon
Yes, sbcl isn't finding the sh.exe. If i give it the path, it works.
This is interesting. Why is asdf, a common, portable library, assuming the use of sh.exe on windows when in fact it is not
available unless one downloads it?

Re: Sbcl 1.0.28: Couldn't fork process error using asd

PostPosted: Sun Jul 05, 2009 8:31 pm
by gugamilare
Harnon wrote:Yes, sbcl isn't finding the sh.exe. If i give it the path, it works.
This is interesting. Why is asdf, a common, portable library, assuming the use of sh.exe on windows when in fact it is not
available unless one downloads it?


Well, actually, ASDF puts windows a bit aside. Consider the case of *asdf-central-registry* variable, which was created to point to a directory where you put symlinks to the .asd files.

Re: Sbcl 1.0.28: Couldn't fork process error using asd

PostPosted: Sun Jul 05, 2009 11:17 pm
by smithzv
Harnon wrote:Why is asdf, a common, portable library, assuming the use of sh.exe on windows when in fact it is not
available unless one downloads it?


Yeah, I guess when I think "run shell command" I instinctively think *nix, but shell doesn't just refer to sh and family. It is probably the case that something platform independent should be offered here. Maybe just a RUN-PROGRAM command.

gugamilare wrote:Consider the case of *asdf-central-registry* variable, which was created to point to a directory where you put symlinks to the .asd files.


Out of curiosity, how does one use ASDF on Windows without using Cygwin's fake symlinks or something? Is ASDF is smart enough to follow shortcuts?

Re: Sbcl 1.0.28: Couldn't fork process error using asd

PostPosted: Mon Jul 06, 2009 12:28 am
by Ramarren
smithzv wrote:Out of curiosity, how does one use ASDF on Windows without using Cygwin's fake symlinks or something? Is ASDF is smart enough to follow shortcuts?


ASDF doesn't strictly require symlinks. You can either just put directories with asd files themselves in *central-registry* (presumably using some function to recursively scan directories locating those with *.asd files), or override asdf:*system-definition-search-functions* with whatever you want (either directory scanning or following shortcuts).

Re: Sbcl 1.0.28: Couldn't fork process error using asd

PostPosted: Mon Jul 06, 2009 1:05 am
by smithzv
Ramarren wrote:You can either just put directories with asd files themselves in *central-registry* (


Right, I knew that... :oops:

Ramarren wrote:or override asdf:*system-definition-search-functions* with whatever you want


I didn't know about that. That is pretty neat. Thanks

Re: Sbcl 1.0.28: Couldn't fork process error using asd

PostPosted: Mon Jul 06, 2009 8:07 am
by nuntius
smithzv wrote:Out of curiosity, how does one use ASDF on Windows without using Cygwin's fake symlinks or something? Is ASDF is smart enough to follow shortcuts?


Clisp handles MS shortcuts transparently just like unix symlinks, but most other lisps don't. Dave Lichteblau wrote a patch to ASDF that contains a little lisp code for portably reading MS shortcuts, but this hasn't (yet) been released as an official part of ASDF.

Adding dozens of directories to *central-registry* or writing a function that recurses into directories to *sys-d-s-f* both work but are IMO suboptimal.