How to keep YouCompleteMe functional and updated after breaking system updates (of course, if YCM is itself stable).

Two annoyances may happen with compact YouCompleteMe deployment when a system gets updated:

  • ycmd incompatibility with libclang, boost or anything else
  • system include paths change (mind libstdc++).

In the first case the plugin wouldn’t load at all, it’s easily noticeable. But in the second case some functions are completed, but not standard C++. I’ve just realized that YCM could be updated with the system too as soon as incompatibility is detected.

Two commits (first, second) implement the following:

  • The script ycm-check.sh to check whether all the system include directories are still accessible in the file system, and to check whether ycm_core.so links properly.
  • The script ycm-update.sh to update the plugin and include directories for ycm_extra_conf.py.
  • The script yaourt to hook into system update request.

Now every time I type yaourt -Syua, the system checks whether YouCompleteMe needs be updated, and does the update automatically.