Bug 149153

Summary: Path to make tools cannot contain spaces
Product: cnd Reporter: habbit <habbit>
Component: ProjectAssignee: Alexander Simon <alexvsimon>
Status: RESOLVED FIXED QA Contact: issues <issues.netbeans.org>
Priority: P3 CC:
Version: 6.x   
Target Milestone: 6.x   
Hardware: All   
OS: All   
Whiteboard:
Issue Type: DEFECT Exception Report:

Description habbit 2008-10-04 13:53:20 UTC
NetBeans 6.1 w/CND pack mishandles paths with spaces in Windows (at least) because it either fails to escape them or
quote the whole path. In particular, I have GFortran installed into C:\Program Files\gfortran, so all my tools are in
the bin subdirectory of that folder. Trying to build the project reports:

------ Output - FTest (Build)

Running "C:\Program Files\gfortran\bin\make.exe -f Makefile CONF=debug" in "C:\Users\javier\Documents\NetBeansProjects\FTest

"C:\ProgramÂȘ is not recognized as an internal or external
command, application or batch file

Build failed. Exit value 1

------

Clearly NetBeans is running the make.exe without noticing that it should either quote it or escape the space in "Program
Files" - I don't know cmd.exe very well so escaping might not be possible, but the command line would have failed under
MSys, so quoting would be the most sensible approach.
Comment 1 _ gordonp 2008-10-05 05:36:01 UTC
I'll look at this next week. Bear in mind that Unixish tools like GNU make, gcc, and g++
do have limitations with respect to spaces in paths. This one might be OK, but no guarantees.

Although I'll look at it next week, its not critical enough to consider for NB 6.5 (which is
very close to code freeze for FCS).
Comment 2 Leonid Lenyashin 2008-10-07 21:49:49 UTC
This issue filed after code freeze for P3s.
Comment 3 habbit 2008-10-08 12:51:10 UTC
I don't really know how strict the freeze policies are in the NetBeans project, but this change might consist of just
looking for the line of code that invokes external commands and make it quote them. If it works, then life is beautiful;
if it doesn't, then it is reverted and the issue set for re-examination after the release. Would that be acceptable? I
could even propose the patch myself if it's OK and people here are too busy with the release...
Comment 4 Leonid Lenyashin 2008-10-08 13:06:13 UTC
NO65 Keyword has been misused.
Comment 5 Thomas Preisler 2009-02-13 21:29:20 UTC
*** Issue 152365 has been marked as a duplicate of this issue. ***
Comment 6 Egor Ushakov 2009-05-22 14:32:02 UTC
i can see that MakeArtifacts' getBuildCommand and getCleanCommand prevented us from having spaces in tool path,
but now makeFlags are always empty (see usages of the above methods), so we can provide tool path to the execution.
Comment 7 Alexander Simon 2009-11-11 07:25:57 UTC
Bug can be reproduced on any platform.
Comment 8 Alexander Simon 2009-11-11 07:33:17 UTC
Make can be fixed if IDE provides environment variable.
For example: this is work right on unix:

#/opt/SUNWspro\ old/prod/bin/dmake MAKE="/opt/SUNWspro\ old/prod/bin/dmake"

But exist a couple other places with bad escaping.
Comment 9 Thomas Preisler 2010-04-12 21:15:49 UTC
A lot has changed since this bug was filed, but the bug is still there. I made a fix in make project how it setups the make command and it should be correct now. The ProjectAction now ends up in RemoteBuildAction Handler and I think it is not handling the space correctly in the exe command. Will reassign to Vladimir K. for further evaluation. I think the fix is somewhere in RemoteBuildAction where it needs to either escape the space or quote the path.
Comment 10 Quality Engineering 2010-04-13 17:38:11 UTC
Integrated into 'main-golden', will be available in build *201004131450* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/13f27bb3eab9
User: Thomas Preisler <thp@netbeans.org>
Log: #149153 Path to make tool cannot contain spaces
Comment 11 Alexander Simon 2010-04-16 16:02:38 UTC
no remote issues, only project bugs.
Comment 12 Alexander Simon 2010-04-16 16:15:55 UTC
fixed, change set:
http://hg.netbeans.org/cnd-main/rev/b7ec219c95ea
Comment 13 Quality Engineering 2010-04-17 08:18:03 UTC
Integrated into 'main-golden', will be available in build *201004170515* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/b7ec219c95ea
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed BZ#149153 Path to make tools cannot contain spaces
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo