cons-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible error in dependency checking a lots of other points


From: Johan Holmberg
Subject: Re: Possible error in dependency checking a lots of other points
Date: Sat, 26 Jan 2002 01:33:44 +0100 (MET)

On Wed, 23 Jan 2002, Nadim Khemir wrote:
>
> $ cons.bat -f construct.cons release project=hugin
> cons.bat: error in file "construct.cons" (project must be specified at
> construct.cons line 4.)
> cons.bat: script errors encountered: construction aborted
>
> After 1 hour in the debugger I finally found out that "cygwin" is faulty!
> Running the same command without using
> the batch file works.
>

I don't think it's Cygwin's fault. You can get the same error in a
"Command Prompt" window (in NT at least).

I think the error comes from the following lines in "cons.bat":

      set ARGS=
      :loop
      if .%1==. goto endloop
      set ARGS=%ARGS% "%1"
      shift
      goto loop
      :endloop

I guess this code is an attempt to write a "portable" BAT-file.
But on NT one could have used %* instead and skipped the silly
looping ...

BUT, I think using BAT-files is asking for trouble ....
I have used Perl extensively on Win32 for several years (NT and
lately Windows 2000). I *never* use BAT-files.

I think I have found a resonably good solution to the fact that
Win32 don't have something like the shebang on UNIX
(#!/usr/bin/perl on the first line).

I have written a generic wrapper-exe that starts perl with the right
arguments. I do like this:

    1) write a new perl-script "foo.pl"
    2) copy my wrapper-exe to "foo.exe"

Now when I issue the command "foo arg1 arg2" the following happens:

    1) foo.exe is started
    2) foo.exe detects that it is called "foo" this time
    3) foo.exe runs the command "perl -S foo.pl arg1 arg2"

This has worked really well, and in all situations:

    - in a "Command Prompt" window
    - in TCSH
    - in BASH (from Cygwin)
    - from inside Visual Studio (the tools menu)
    - ...

Before I found out this solution I had all kinds of trouble when
BAT-files were involved.

/Johan Holmberg





reply via email to

[Prev in Thread] Current Thread [Next in Thread]