KageKirin / gyp

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

gyp fails on MacOS without XCode #477

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Uninstall XCode on MacOS
2. Use Command Line Tools
$ xcode-select --print-path
/Library/Developer/CommandLineTools
3. do a test for example,
$ python gyptest.py test/actions-bare

What is the expected output? What do you see instead?

Test is failed with the following error.

Traceback (most recent call last):
  File "/Users/ohtsu/tmp/gyp/gyp_main.py", line 18, in <module>
    sys.exit(gyp.script_main())
  File "/Users/ohtsu/tmp/gyp/pylib/gyp/__init__.py", line 532, in script_main
    return main(sys.argv[1:])
  File "/Users/ohtsu/tmp/gyp/pylib/gyp/__init__.py", line 525, in main
    return gyp_main(args)
  File "/Users/ohtsu/tmp/gyp/pylib/gyp/__init__.py", line 510, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/Users/ohtsu/tmp/gyp/pylib/gyp/generator/make.py", line 2162, in GenerateOutput
    part_of_all=qualified_target in needed_targets)
  File "/Users/ohtsu/tmp/gyp/pylib/gyp/generator/make.py", line 766, in Write
    extra_mac_bundle_resources, part_of_all)
  File "/Users/ohtsu/tmp/gyp/pylib/gyp/generator/make.py", line 872, in WriteActions
    env = self.GetSortedXcodeEnv()
  File "/Users/ohtsu/tmp/gyp/pylib/gyp/generator/make.py", line 1854, in GetSortedXcodeEnv
    additional_settings)
  File "/Users/ohtsu/tmp/gyp/pylib/gyp/xcode_emulation.py", line 1551, in GetSortedXcodeEnv
    additional_settings)
  File "/Users/ohtsu/tmp/gyp/pylib/gyp/xcode_emulation.py", line 1480, in _GetXcodeEnv
    additional_settings[k] = _NormalizeEnvVarReferences(additional_settings[k])
  File "/Users/ohtsu/tmp/gyp/pylib/gyp/xcode_emulation.py", line 1490, in _NormalizeEnvVarReferences
    str = re.sub(r'\$([a-zA-Z_][a-zA-Z0-9_]*)', r'${\1}', str)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 151, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or buffer

Attached is the full error log outputs.

What version of the product are you using? On what operating system?

$ git log --decorate
commit 67000714d51ea081a2661d4c40d7034d42341472 (HEAD, origin/master, 
origin/HEAD, master)
Author: sbaig1@bloomberg.net <sbaig1@bloomberg.net>
Date:   Mon Feb 2 23:31:40 2015 +0000

$ uname -v
Darwin Kernel Version 14.1.0: Mon Dec 22 23:10:38 PST 2014; 
root:xnu-2782.10.72~2/RELEASE_X86_64

Please provide any additional information below.

Through bisecting commits, I found that 
8bdc26b00f12dc11ade0be8cff81fa5ff0ec2bd3 causes this error.
sdk_root = xcode_settings._XcodeSdkPath('') in pylib/gyp/xcode_emulation.py 
puts None into sdk_root then leads TypeError. 

Original issue reported on code.google.com by shigeki....@gmail.com on 6 Feb 2015 at 5:21

Attachments: