wutingcindy / gyp

Automatically exported from code.google.com/p/gyp
0 stars 0 forks source link

The makefile generator doesn't properly escape arguments for regypping #474

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Copy the subfolder test/gyp-defines into a tmp location.
2. gyp --depth=. -f make -Dkey=value -G xcode-ninja-target-patter=^.*$ 
defines.gyp
3. touch defines gyp
4. make

What is the expected output?
  ACTION defines_gyp_test_target_target_test_action action.txt
  TOUCH out/Default/obj.target/test_target.stamp

What do you see instead?
  ACTION Regenerating Makefile
/bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** [Makefile] Error 2

What version of the product are you using? On what operating system?
git-svn-id: http://gyp.googlecode.com/svn/trunk@2012 
78cadc50-ecff-11dd-a971-7dbc132099af
Mac OS X 10.9.5

Please provide any additional information below.
The cause of the error is this: The make generator writes the following rule:

quiet_cmd_regen_makefile = ACTION Regenerating $@
cmd_regen_makefile = cd $(srcdir); 
/Volumes/ssd_mac/toh/build-system-integration/modules/build-system/modules/gyp/g
yp_main.py -fmake --ignore-environment "--toplevel-dir=." "--depth=." 
"-Gxcode-ninja-target-patter=^.*$" "-Dkey=value" defines.gyp
Makefile: defines.gyp
    $(call do_cmd,regen_makefile)

The argument "-Gxcode-ninja-target-patter=^.*$" is quoted using double quotes 
("), but the dollar sign $ inside isn't properly escaped.

Original issue reported on code.google.com by tobias.h...@ableton.com on 8 Dec 2014 at 8:00