bugmake - Bugs: bug #7606, shell builtin "test" not...

 
 

bug #7606: shell builtin "test" not invoked if appears alone

Submitted by:  None
Submitted on:  Fri 06 Feb 2004 02:21:48 PM UTC  
 
Severity: 2 - MinorItem Group: Enhancement
Status: FixedPrivacy: Public
Assigned to: Paul D. Smith <psmith>Open/Closed: Closed
Component Version: NoneOperating System: POSIX-Based
Fixed Release: 3.81Triage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 21 Feb 2004 05:22:30 PM UTC, comment #1:

Technically POSIX requires that a system have a standalone test program, so in a POSIX environment make's current behavior will be correct. Nevertheless I've added "test" to the list of "slow-path" commands; 99% of the time it would have been taken anyway since most of the time test appears in a script rather than by itself.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Fri 06 Feb 2004 02:21:48 PM UTC, original submission:

(Platform: QNX 6.2.0)

  • When a "test" command is a shell builtin, and
  • no /bin/test as a file is provided in the system,

all:
test

will fail with "make: test: Command not found" .
You could easily reproduce this by setting PATH to bogus path, as
$ PATH=/nosuchdir /usr/gnu/bin/make

POSIX says the line should be processed like system("test")
which will be execvp("/bin/sh","-c","test") which will succeed,

but GNU make tries to optimize avoiding /bin/sh,
which tries execvp("test") and fails.

GNU automake uses this bare "test" in several testsuite.

Suggested patch:

Just add "test" to the shell builtin table in job.c .
This shouldn't hurt platforms which has/needs explicit /bin/test.

================================================
--- job.c.dist Sat Aug 10 01:27:17 2002
+++ job.c Fri Feb 6 14:04:54 2004
@@ -2484,7 +2484,7 @@
"logout", "set", "umask", "wait", "while", "for",
"case", "if", ":", ".", "break", "continue",
"export", "read", "readonly", "shift", "times",
- "trap", "switch", 0 };
+ "trap", "switch", "test", 0 };
#endif /* WINDOWS32 */
#endif /* Amiga */
#endif /* _MSDOS_ */
================================================

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 8 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sat 01 Apr 2006 07:10:14 AM UTCpsmithFixed Release4.0=>3.81
Sat 21 Feb 2004 05:22:30 PM UTCpsmithSeverity3 - Normal=>2 - Minor
  Item GroupNone=>Enhancement
  StatusNone=>Fixed
  Assigned toNone=>psmith
  Open/ClosedOpen=>Closed
  Operating SystemAny=>POSIX-Based
  Fixed ReleaseNone=>4.0

Back to the top


Powered by Savane 3.1-cleanup1