bugmake - Bugs: bug #8083, Spaces in PATH environment...

 
 

bug #8083: Spaces in PATH environment variable result in PWD.EXE not found

Submitted by:  Bob Marietta <IgD>
Submitted on:  Wed 10 Mar 2004 02:30:47 AM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: Not A BugPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.79.1Operating System: MS Windows
Fixed Release: NoneTriage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 29 Nov 2004 02:50:22 AM UTC, comment #1:

This is not a bug in GNU make, at least not directly. GNU make is not looking for PWD.EXE; their makefile contains this code to look for it:

PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))

The addsuffix function is quite clear that it splits words on whitespace, so it is not an appropriate function to use for this purpose if there is whitespace that you do NOT want to be split.

To do what they want they will have to be much more creative; probably by replacing any whitespace in the SEARCHPATH with some other character to hide it; maybe something like this:

E = #empty var
S = $E $E
_XSEARCHPATH := $(subst ;, ,$(subst $S,%,$(SEARCHPATH)))
PWD := $(strip $(foreach D,$(_XSEARCHPATH),$(wildcard $(subst %, ,$(D))/pwd.exe)))

Note this is untested, but basically it replaces all the whitespace in SEARCHPATH with a token (here '%') which can't be a legal token to appear in a filename; then it replaces all ";" with a space, then for each word (space-separated value) in the resulting path it changes the token ('%') back to space and uses wildcard on that plus '/pwd.exe' to see if it exists.

Note I wrote this from scratch and have not tested it, but it should work. If you don't think '%' is a good token (because it might be used in a filename) then you can pick another one.

It's a known fact that make does not handle spaced in pathnames very well at all so perhaps an argument could be made that this is another facet of that problem.

Paul D. Smith <psmith>
Project Administrator
Wed 10 Mar 2004 02:30:47 AM UTC, original submission:

Please refer to http://www.lazarus.freepascal.org/modules.php?op=modload&name=BugTracker&file=index&sAction=detail&bugID=199 for a detailed explanation of this problem.

In short, Make looks for PWD.EXE to proceed with compilation but fails if there are spaces in the Windows environmental path variable. I originally submitted this bug report to the authors of Lazarus (http://lazarus.freepascal.org) however they stated this was a problem with MAKE.

Thanks!

Bob Marietta <IgD>

 

(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 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Mon 29 Nov 2004 02:50:22 AM UTCpsmithStatusNone=>Not A Bug
  Open/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1