bug-make
[Top][All Lists]
Advanced

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

[bug #30714] List of shell commands is outdated/Fallback to shell


From: Krzysztof Malinowski
Subject: [bug #30714] List of shell commands is outdated/Fallback to shell
Date: Tue, 10 Aug 2010 20:18:42 +0000
User-agent: Mozilla/5.0 (Windows; Windows NT 5.1; rv:2.0b2) Gecko/20100720 Firefox/4.0b2 ( .NET CLR 3.5.30729)

Follow-up Comment #7, bug #30714 (project make):

I agree that Savannah is not too well suited for discussion, but I would like
to keep it here in order to track how the discussion develops. And maybe other
people will join us :-)

I know that explicit call to "cmd /c move" will do the trick, but I think
that's ridiculous to set $(SHELL) and then still calling cmd explicitly.
Additionally it's against documentation (and maybe make requirements - I don't
know) since it states that a subshell is called for a recipe line and this
doesn't happen. This way make breaks at perfectly valid recipe shell script.

As for the places where the shell looks for programs: that's true that
CreateProcess looks in additional places, but the question is whether this is
the behavior that make should follow. After all, when creating a recipe one
would assume that (s)he's writing a shell script (as all the documentation
suggests). And the shell lookup should be considered correct: first current
working directory, then through PATH. CreateProcess looks to make's directory
(which is not intuitive for somebody writing a recipe) and then it looks to
system and windows directory before checking PATH - so it's quite different
than shell does.

Now imagine that somebody writes a recipe, thinking that it would be parsed
by shell (as documentation suggests). He creates for example a script named
foo.bat which is being called by the recipe. What he does not know is that
someone else created foo.bat in make's directory and this will be the script
which will be called by CreateProcess. It's a very hard bug to track down for
a Makefile developer, undocumented and non-intuitive. And this is not how the
shell would behave.

The second thing I've seen today is that even when a command is recognized as
a built-in, it still will not honor $(SHELL) variable. This is because a batch
file is created with the recipe line and this batch file is called directly,
without using $(SHELL), so this will be loaded and evaluated by the system,
with the default shell. This is wrong again.

Therefore I still believe that make should follow its own rules and invoke
the shell as it claims to do (and obey $(SHELL) when doing that).

(And as for shell command line length: it appears that cmd.exe prior to
Windows 2000 has 2K limit, while newer have 8K limit. See
http://support.microsoft.com/kb/830473 for reference.)

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?30714>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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