frerich/clcache — Issue #14: clcache does not work if /Fo argument contain a directory
Author: Popovich
Created: 2012-02-19 13:52:09+00:00
State: open

When /Fo argument contain a directory I have this error:

1>------ Build started: Project: test_clcache, Configuration: Debug Win32 ------
1>Compiling...
1>test_clcache.cpp
1>C:\clcache\clcache.py Found real compiler binary at 'C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\cl.exe'
1>C:\clcache\clcache.py Parsing given commandline '['@d:\\my_projects\\test_clcache\\Debug\\RSP00000D27521588.rsp', '/nologo', '/errorReport:prompt']'
1>C:\clcache\clcache.py Expanded commandline '[u'/Od', u'/D', u'"WIN32"', u'/D', u'"_DEBUG"', u'/D', u'"_CONSOLE"', u'/D', u'"_UNICODE"', u'/D', u'"UNICODE"', u'/FD', u'/EHsc', u'/RTC1', u'/MDd', u'/Fo"Debug\\\\"', u'/Fd"Debug\\a.pdb"', u'/W3', u'/c', u'/ZI', u'/TP', u'.\\test_clcache.cpp', '/nologo', '/errorReport:prompt']'
1>C:\clcache\clcache.py Compiler output file: 'Debug\\'
1>C:\clcache\clcache.py Reusing cached object for key ad9deaeb7eeabaebdcda4b719b9b57bbbd76e9d1 for output file Debug\\
1>c:\python27\lib\shutil.py:63: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
1> os.path.normcase(os.path.abspath(dst)))
1>Traceback (most recent call last):
1> File "C:\clcache\clcache.py", line 469, in
1> copyfile(cache.cachedObjectName(cachekey), outputFile)
1> File "c:\python27\lib\shutil.py", line 82, in copyfile
1> with open(dst, 'wb') as fdst:
1>IOError: [Errno 2] No such file or directory: u'Debug\\\\'
1>Project : error PRJ0002 : Error result 1 returned from 'C:\clcache\cl.exe'.

It seems that we must strip quotes around file names before starting work with the passed directory.