DynamoRIO / DynamoRIO/dynamorio

build: nmake adds space before 1st / in 1st arg to a command invoked with quotes

Open
#84 5 comments 0 reactions 0 assignees View on GitHub
Component-Build Migrated OpSys-Windows Priority-Medium
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 15h
Merged PRs (30d)
31

Description

_From [derek.br...@gmail.com](https://code.google.com/u/117968039472581148324/) on March 09, 2009 14:27:25_

when invoked through nmake with a path to cmake that is quoted, if the
1st parameter to cmake is -Dvar=val and val contains a /, all chars
from the / onward are deleted from val: tracked it down to an nmake bug.
workaround is to have 1st parameter not contain any forward slashes, or,
alternatively, to put a space after -D.

for me, from clean slate if I invoke as
e:/PROGRA~2/CMAKE2~1.6/bin/cmake.exe then 1st build.make runs fine b/c no
quotes around cmake.exe command:
% grep -r proj_src api/
api/docs/CMakeFiles/htmldocs.dir/build.make:
e:\PROGRA~2\CMAKE2~1.6\bin\cmake.exe
-Dsrcdir=D:/derek/opensource/dynamorio/api/docs
-Doutfile=D:/derek/opensource/bb/api/docs/Doxyfile
-Dproj_srcdir=D:/derek/opensource/dynamorio -Dversion_number=1.3.2
-Dheader_dir=D:/derek/opensource/bb/include
-DDOXYGEN_EXECUTABLE=E:/cygwin/bin/doxygen.exe -P
D:/derek/opensource/dynamorio/api/docs/CMake_doxyfile.cmake

but if I touch a cmake file and it re-gens on "nmake" it now uses:
api/docs/CMakeFiles/htmldocs.dir/build.make: "E:\Program Files
(x86)\CMake 2.6\bin\cmake.exe"
-Dsrcdir=D:/derek/opensource/dynamorio/api/docs
-Doutfile=D:/derek/opensource/bb/api/docs/Doxyfile
-Dproj_srcdir=D:/derek/opensource/dynamorio -Dversion_number=1.3.2
-Dheader_dir=D:/derek/opensource/bb/include
-DDOXYGEN_EXECUTABLE=E:/cygwin/bin/doxygen.exe -P
D:/derek/opensource/dynamorio/api/docs/CMake_doxyfile.cmake
=> we get error on 1st arg:
[ 80%] Generating Doxyfile
CMake Error at
D:/derek/opensource/dynamorio/api/docs/CMake_doxyfile.cmake:41 (file):
file Internal CMake error when trying to open file: D:/API.doxy for
reading.

if I invoke from clean slate w/ backslashes then get error right away.
cd D:\derek\opensource\bb\api\docs
"E:\Program Files (x86)\CMake 2.6\bin\cmake.exe"
-Dsrcdir=D:/derek/opens

have script print out args:
srcdir="D:" outfile="D:/derek/opensource/bb/api/docs/Doxyfile"
proj_srcdir="D:/d
but if I directly invoke in same way, from cmd, works fine:
D:\derek\opensource\bb\api\docs>"E:\Program Files (x86)\CMake
2.6\bin\cmake.exe" -Dsrcdir=D:/derek/opensource/dynamorio/api/docs
-Doutfile=D:/derek/opensource/bb/api/docs/Doxyfile
-Dproj_srcdir=D:/derek/opensource/dynamorio -Dversion_number=1.3.2
-Dheader_dir=D:/derek/opensource/bb/include
-DDOXYGEN_EXECUTABLE=E:/cygwin/bin/doxygen.exe -P
D:/derek/opensource/dynamorio/api/docs/CMake_doxyfile.cmake
srcdir="D:/derek/opensource/dynamorio/api/docs"
outfile="D:/derek/opensource/bb/api/docs/Doxyfile"
proj_srcdir="D:/derek/opensource/dynamorio"

add bogus 1st arg => 2nd arg is fine:
"E:\Program Files (x86)\CMake 2.6\bin\cmake.exe" -Dfoo=x
-Dsrcdir=D:/derek/opensource/dynamorio/api/docs
-Doutfile=D:/derek/opensource/bb/api/docs/Doxyfile
-Dproj_srcdir=D:/derek/opensource/dynamorio -Dversion_number=1.3.2
-Dheader_dir=D:/derek/opensource/bb/include
-DDOXYGEN_EXECUTABLE=E:/cygwin/bin/doxygen.exe -P
D:/derek/opensource/dynamorio/api/docs/CMake_doxyfile.cmake

tweak 1st arg => it's deleting everything after the 1st forward slash
backward slash works fine: only forward slash
add :PATH => no difference
if put space after -D => works fine

have cmake pause (ran "cat") and attach to debugger so I can see real
cmdline (here I had replaced 1st / with \ on srcdir):
% ~/trees/64bit/tools/DRview.exe -cmdline -pid 3496
PID 3496, Process cmake.exe, running native
Cmdline: e:\PROGRA~2\CMAKE2~1.6\bin\cmake.exe -Dsrcdir=D:\derek
/opensource/dynamorio/api/docs
-Doutfile=D:/derek/opensource/bb/api/docs/Doxyfile
-Dproj_srcdir=D:/derek/opensource/dynamorio -Dversion_number=1.3.2
-Dheader_dir=D:/derek/opensource/bb/include
-DDOXYGEN_EXECUTABLE=E:/cygwin/bin/doxygen.exe -P
D:/derek/opensource/dynamorio/api/docs/CMake_doxyfile.cmake
=> it's an nmake bug

_Original issue: http://code.google.com/p/dynamorio/issues/detail?id=84_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.