Blog

bevkjbvkbdkdxoeoziejdoiehz fiugebfuyegwik

Xcode 6.4, plugins and you

Xcode 6.4 seemingly brings a big change in the handling of third-party plugins. There's a second mechanism now beyond the compatibility UUIDs which determines if a plugin is loaded or not. If you need a quick refresher on Xcode's compatibility UUIDs, check out my previous post from last year.

Screenshot of 'unexpected code bundles' dialog

This dialog will probably be the first thing that greets you when opening Xcode 6.4 and contrary to my tweet when I first saw this dialog, it seems to be an improvement of the third-party plugin situation. If you hit "Load Bundles", those plugins will be loaded automatically without the need to update their compatibility UUIDs.

What this does under the hood is putting the bundle IDs of the plugins in question into either a whitelist ("allowed" key in the Xcode preferences plist) or a blacklist ("skipped"). The key for both lists is called "DVTPlugInManagerNonApplePlugIns-Xcode-6.4", so this list is also version-specific.

You can reset the list by running:

defaults delete com.apple.dt.Xcode DVTPlugInManagerNonApplePlugIns-Xcode-6.4

What does this mean for the future of third party plugins? ¯\_(ツ)_/¯ - but I sure as hell hope no days like this anymore.

UPDATE

Since 6.4 beta 2, plugins need both the correct compatibility UUID and need to be enabled via this new mechanism. The same is true for Xcode 6.3.2.

Building nokogiri on OS X

Update: Since version 1.6.7 includes this PR, it should build out-of-the-box on OS X. If you can, update to that version and skip this guide.

Since I constantly have to build nokogiri for some Gem or another and also always forget how to prevent it from falling over itself, here are my notes. The instructions are for Yosemite and were tested on 10.10.3.

Building older versions

Older versions of Nokogiri need to be told where to find certain system libraries. Use this command as an example (it installs version 1.3.3):

$ gem install nokogiri -v 1.3.3 -- --with-iconv-dir=`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr --with-xml2-include=`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/libxml2

Building versions >= 1.6.4

The newer versions got better and worse at the same time. Under certain circumstances, one will not have a /usr/include on Yosemite, but nokogiri stubbornly checks for that. The fix for this is ugly, simply to this before installation:

$ sudo mkdir /usr/include
$ sudo touch /usr/include/iconv.h

😭

Updated instructions for OS X 10.11

Building older versions

Basically the same, just the version number of the OS X has increased. Make sure you have Xcode 7.x as your active Xcode, otherwise compilation will fail.

$ gem install nokogiri -v 1.6.3.1 -- --with-iconv-dir=`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr --with-xml2-include=`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2

Building versions >= 1.6.4

Allright, this is were the sadness begins, because SIP (System Integrity Protection) prevents us from doing the simple workaround we previously could perform. The solution is building the gem manually from source:

  1. Clone the repo
  2. Checkout the tag of whatever version you want to build (e.g. "v1.6.5")
  3. bundle install to get all dependencies of nokogiri installed
  4. Make sure Xcode 7.x is the active Xcode, otherwise compilation will fail
  5. Apply this patch (this gets rid of the /usr/include dependency in the build process)
  6. rake gem to create the Gem itself
  7. sudo gem install pkg/nokogiri-1.6.5.gem (or whatever version you're currently installing)

😮

Updated instructions for OS X 10.12

Building older versions

Basically the same, just the version number of the OS X has increased. Make sure you have Xcode 8.x as your active Xcode, otherwise compilation will fail.

$ gem install nokogiri -v 1.6.3.1 -- --with-iconv-dir=`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr --with-xml2-include=`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2