Bug 1160897 - Fixing .ycm_extra_conf for Fennec. r=ehsan
authorDanilo Cesar Lemes de Paula <danilo.cesar@collabora.co.uk>
Mon, 04 May 2015 07:15:00 +0200
changeset 242611 5b146d08b2c59b69bd7349b1a1e79355886b29a2
parent 242610 c92c76073e9cb2294cdac7dfc80431b2224c4c93
child 242612 819c760b572fa8d2a00a3d50102a264232e35fb6
push id12775
push userryanvm@gmail.com
push dateWed, 06 May 2015 20:29:54 +0000
treeherderfx-team@feefdfa526a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1160897
milestone40.0a1
Bug 1160897 - Fixing .ycm_extra_conf for Fennec. r=ehsan Looks like ycmd fails to parse the file if the -march=arm* option is given Removing it doesn't solve all YCM problems for Fennec, but it allows us to use JumpToDefinition, GetType and semantic auto-completion.
.ycm_extra_conf.py
--- a/.ycm_extra_conf.py
+++ b/.ycm_extra_conf.py
@@ -16,12 +16,19 @@ if not os.path.exists(path):
 mach_module = imp.load_module('_mach', open(path), path, ('', 'r', imp.PY_SOURCE))
 
 def FlagsForFile(filename):
     mach = mach_module.get_mach()
     out = StringIO()
     out.encoding = None
     mach.run(['compileflags', filename], stdout=out, stderr=out)
 
+    flag_list = shlex.split(out.getvalue())
+
+    # This flag is added by Fennec for android build and causes ycmd to fail to parse the file.
+    # Removing this flag is a workaround until ycmd starts to handle this flag properly.
+    # https://github.com/Valloric/YouCompleteMe/issues/1490
+    final_flags = [x for x in flag_list if not x.startswith('-march=armv')]
+
     return {
-        'flags': shlex.split(out.getvalue()),
+        'flags': final_flags,
         'do_cache': True
     }