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 272430 5b146d08b2c59b69bd7349b1a1e79355886b29a2
parent 272429 c92c76073e9cb2294cdac7dfc80431b2224c4c93
child 272431 819c760b572fa8d2a00a3d50102a264232e35fb6
push id4830
push userjlund@mozilla.com
push dateMon, 29 Jun 2015 20:18:48 +0000
treeherdermozilla-beta@4c2175bb0420 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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.
--- 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