Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 366060 - xdc.tools.configuro does not correctly generate file paths containing blank space characters
Summary: xdc.tools.configuro does not correctly generate file paths containing blank s...
Status: ASSIGNED
Alias: None
Product: RTSC
Classification: Technology
Component: Tools (show other bugs)
Version: unspecified   Edit
Hardware: All Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Dave Russo CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-08 11:18 EST by Alain Lee CLA
Modified: 2011-12-13 17:33 EST (History)
2 users (show)

See Also:


Attachments
example with spaces that works on Linux (200.07 KB, application/zip)
2011-12-08 17:27 EST, Dave Russo CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alain Lee CLA 2011-12-08 11:18:58 EST
I created a RTSC project and the project name contains blank space characters (e.g. " rtsc project". When building the project, the following errors were reported.

/opt/test/ccsv5/utils/bin/gmake -k all 
Building file: ../stairstep.cfg
Invoking: XDCtools
"/opt/test/xdctools_3_22_01_21/xs" --xdcpath="/opt/test/bios_6_32_01_38/packages;/opt/test/ipc_1_23_01_26/packages;" xdc.tools.configuro -o configPkg -t ti.targets.C64P -p ti.platforms.evmDM6437 -r debug -c "/opt/test/ccsv5/tools/compiler/c6000" --compileOptions "-g --optimize_with_debug" "../stairstep.cfg"
making package.mak (because of package.bld) ...
generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
configuring stairstep.p64P from package/cfg/stairstep_p64P.cfg ...
generating custom ti.sysbios library makefile ... 
generating custom ti.sdo.io library makefile ... 
Starting build of library sources ...
gmake[1]: /home/torbdsvc/workspace_v5_1/rtsc: No such file or directory
gmake[1]: *** No rule to make target `/home/torbdsvc/workspace_v5_1/rtsc'.  Stop.
Build of libraries failed.
error: xdc.cfg.SourceDir: "/opt/test/xdctools_3_22_01_21/packages/xdc/cfg/SourceDir.xs", line 150: xdc.cfg.SourceDir : Build of generated source libraries failed: exit status = 2:

I found that the following file created by configuro did not generate some of the file paths correctory.

In the file <Project>/Debug/configPkg/package/cfg/stairstep_p64P.cfg, it shows the following lines:

    _runCfg("/home/torbdsvc/workspace_v5_1/rtsc project/stairstep.cfg", spath, "package/cfg/stairstep_p64P",

    var build = {
        profile: "release",
        cfgScript: "/home/torbdsvc/workspace_v5_1/rtsc%20project/stairstep.cfg",

Note that the first line shows the path with the blank space while the second statement shows that the blank space character was replace by %20.
Comment 1 Dave Russo CLA 2011-12-08 17:27:03 EST
Created attachment 208129 [details]
example with spaces that works on Linux
Comment 2 Dave Russo CLA 2011-12-08 17:32:21 EST
Alain,

I can't seem to reproduce the error.  The attached example is my attempt.  It contains a makefile and a physical layout that (as far as I can see) matches the layout assumed by CCS projects.

Is there anything special about how the configuro tool is being executed within CCS?

Is it possible that an absolute path to the .cfg file is being passed to the configuro?
Comment 3 Alain Lee CLA 2011-12-08 17:45:36 EST
(In reply to comment #2)
> Alain,
> I can't seem to reproduce the error.  The attached example is my attempt.  It
> contains a makefile and a physical layout that (as far as I can see) matches
> the layout assumed by CCS projects.
> Is there anything special about how the configuro tool is being executed within
> CCS?
> Is it possible that an absolute path to the .cfg file is being passed to the
> configuro?

Did your project get built without any error? 

The file "space in name/Debug/hello/package/cfg/hello_p64.cfg" contains the following statements where one has %20 and the other has blank spaces

build = {
        profile: "release",
        cfgScript: "/db/ztree/dr/xdcexamples-a00x/src/cfg/configuro/tests/errors/ecl366060/space%20in%20name/hello.cfg",

_runCfg("/db/ztree/dr/xdcexamples-a00x/src/cfg/configuro/tests/errors/ecl366060/space in name/hello.cfg",
Comment 4 Dave Russo CLA 2011-12-08 17:52:15 EST
yep, no error.  The attached zip has the output from the successful command line run on Linux as well as all files necessary to reproduce it on Linux.
Comment 5 Dave Russo CLA 2011-12-08 18:23:14 EST
Alain,

On closer inspection of the error it looks like the error is coming from ti.sysbios or the ti.sdo.io package.  This would explain why my example works and yours doesn't.

    generating custom ti.sysbios library makefile ... 
    generating custom ti.sdo.io library makefile ... 
    Starting build of library sources ...
    gmake[1]: /home/torbdsvc/workspace_v5_1/rtsc: No such file or directory
    gmake[1]: *** No rule to make target `/home/torbdsvc/workspace_v5_1/rtsc'. 
    Stop.
    Build of libraries failed.

I know ti.sysbios generates a makefile that it uses to rebuild the SYS/BIOS sources.  My guess is that it (or ti.sdo.io) does not handle path names with spaces.

I'll forward the problem to the SYS/BIOS team for further analysis.
Comment 6 Dave Russo CLA 2011-12-13 17:33:02 EST
OK, it is possible to reproduce the problem without using SYS/BIOS.  

The problem requires the use of the newly added xdc.cfg.SourceDir module.  This module is responsible for buiding directories of generated sources specified by products like SYS/BIOS.

The following configuration script causes a problem when a project is in a directory that contains spaces in the path:

    var System = xdc.useModule("xdc.runtime.System");
    var SourceDir = xdc.useModule("xdc.cfg.SourceDir");
    SourceDir.create("foo");