Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 321158

Summary: Config crash when XDCBUILDCFG assigned a file with a space in its path
Product: [Technology] RTSC Reporter: Chris Ring <cring>
Component: CoreAssignee: Sasha Slijepcevic <sascha>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: amitm, d-russo
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: target:3.21

Description Chris Ring CLA 2010-07-28 13:41:55 EDT
When assigning XDCBUILDCFG to a file, XDC internally converts that file name to a fully qualified file name (with path).  When this is done on Windows, and the file name contains a space, the fully qualified file name contains a space, and the following error can be encountered during the config step:

------------------------
...
making all: Tue Jul 27 18:26:02 PDT 2010 ...
======== .interfaces [.] ========
c:/Progra~1/TexasI~1/xdctools_3_20_01_51/packages/xdc/bld/xdc_rules.mak:308: *** Error: 'C:/Program' is not a valid build configuration file
.  Stop.
xdctools_3_20_01_51\gmake.exe: *** [.,.interfaces] Error 2
gmake: *** [all] Error 2
-------------------------

On Windows, XDC should probably convert this fully qualified name to a [no-spaces-allowed] 8.3 name.

This can be a common occurrence as CCS defaults its installation to "C:/Program Files/Texas Instruments" directory, and other products (e.g. XDC, Codec Engine, BIOS, etc) are often installed there as well.
Comment 1 Sasha Slijepcevic CLA 2010-08-16 14:43:35 EDT
I could replicate the error message as written in the first comment only if XDCBUILDCFG is supplied on the command line without quotes as:
C:\rtsc>"C:/Program Files/Texas Instruments/xdctools_3_21_00_10_eng/xdc" XDCBUILDCFG=C:/Program Files/Texas Instruments/config.bld

Chris, if the actual use case is different please let me know.

However, even if XDCBUILDCFG is quoted, the build still fails with a similar error message.
Comment 2 Chris Ring CLA 2010-08-16 14:49:06 EDT
(In reply to comment #1)
> I could replicate the error message as written in the first comment only if
> XDCBUILDCFG is supplied on the command line without quotes as:
> C:\rtsc>"C:/Program Files/Texas Instruments/xdctools_3_21_00_10_eng/xdc"
> XDCBUILDCFG=C:/Program Files/Texas Instruments/config.bld
> 
> Chris, if the actual use case is different please let me know.
> 
> However, even if XDCBUILDCFG is quoted, the build still fails with a similar
> error message.

I believe the customer's use case was when XDCBUILDCFG was assigned to a relative build script when run from a directory that contains a space.  For example:

C:\Program Files\foo> xdc XDCBUILDCFG=./_config.bld
Comment 3 Sasha Slijepcevic CLA 2010-08-17 18:16:07 EDT
I detected three cases in which a space in XDCBUILDCFG breaks the build. If config.bld is in C:/Program Files/Texas Instruments, and the package being built is in C:/Program Files/Texas Instruments/myRepo/myPkg, these are the cases:
1. cd myRepo; xdc XDCBUILDCFG=../config.bld -PR .
   That was the most likely the use case reported by the customer.
2. cd myRepo; xdc XDCBUILDCFG="../../Texas Instruments/config.bld" -PR .
3. cd myRepo/myPkg; xdc XDCBUILDCFG="../../../Texas Instruments/config.bld"

The testcases for all three use cases will be available in xdctest-b02, in
src/gmaketests/xdcbuildcfg/windows.
Comment 4 Sasha Slijepcevic CLA 2010-08-25 13:21:51 EDT
The fix that solves all three cases described in Comment 3 is available in xdc-w07. The changes are in xdc_top.mak and xdc_rules.mak, and they mainly consist of calling path2dos executable on $XDCBUILDCFG whenever a space in XDCBUILDCFG may be important. The fix is therefore limited to Windows.
Comment 5 Amit Mookerjee CLA 2011-04-08 18:46:55 EDT
Reproduced problem with XDCtools 3.20.07.86. Tried to build an application with a relative path to the "config.bld" script kept in a folder with spaces. Got the error has described in the bug report.

Build worked fine with XDCtools 3.21.00.48-eng.
Reviewed code to confirm the fix.
Comment 6 Dave Russo CLA 2011-06-20 14:03:06 EDT
Shipped in XDCtools 3.21.
Comment 7 Dave Russo CLA 2011-06-20 14:05:08 EDT
Shipped in XDCtools 3.21