Sbcl 1.0.28: Couldn't fork process error using asd

Discussion of Common Lisp
Post Reply
Harnon
Posts: 78
Joined: Wed Jul 30, 2008 9:59 am

Sbcl 1.0.28: Couldn't fork process error using asd

Post by Harnon » Thu Jul 02, 2009 9:56 am

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!

smithzv
Posts: 94
Joined: Wed Jul 23, 2008 11:36 am

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

Post by smithzv » Thu Jul 02, 2009 11:14 am

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

Harnon
Posts: 78
Joined: Wed Jul 30, 2008 9:59 am

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

Post by Harnon » Sun Jul 05, 2009 7:32 pm

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?

gugamilare
Posts: 406
Joined: Sat Mar 07, 2009 6:17 pm
Location: Brazil
Contact:

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

Post by gugamilare » Sun Jul 05, 2009 8:31 pm

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.

smithzv
Posts: 94
Joined: Wed Jul 23, 2008 11:36 am

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

Post by smithzv » Sun Jul 05, 2009 11:17 pm

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?

ramarren
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland
Contact:

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

Post by ramarren » Mon Jul 06, 2009 12:28 am

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).

smithzv
Posts: 94
Joined: Wed Jul 23, 2008 11:36 am

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

Post by smithzv » Mon Jul 06, 2009 1:05 am

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

nuntius
Posts: 538
Joined: Sat Aug 09, 2008 10:44 am
Location: Newton, MA

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

Post by nuntius » Mon Jul 06, 2009 8:07 am

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.

Post Reply