Xcode 11.4 - Updated Image

We have just pushed an update to the Xcode 11.4 image which changes the following:

  • macOS updated to 10.15.4 from 10.15.3

  • Python 2 has been reinstated - you can call Python 2 with python and pip, while Python 3 can be called with python3 and pip3.

    • Please Note: Python 2 has been officially deprecated by Homebrew. We have re-installed Python 2 in this image by using a custom Tap. This should be a valid workaround for now, but will fully removed from our Xcode images once we move to the next major macOS version.

This image can be selected as follows:

macos:
    xcode: 11.4.0

Minor software changes:

  • NodeJS 13.12.0 (yarn 1.22.4) updated from 13.11.0 (yarn 1.21.1)
  • Included Rubies updated to 2.5.8, 2.6.6, 2.7.1 from 2.5.7, 2.6.5, 2.7.0

The full manifest of installed software can be found here.

1 Like

Some advance warning about removing ruby 2.6.5 would have been greatly appreciated. All my iOS builds are broken now as a result.

1 Like

@TheMetalCode Hey, sorry to hear that, I should have mentioned it in the original post (will update this now).

Generally our builds will automatically include the most up to date minor release of each Ruby version, so I would recommend setting your chosen Ruby to simply “ruby-2.6” as per the documentation here. This will always ensure 2.6 is in use, regardless of which minor version is shipped in the image.

1 Like

A couple things here:

1.) The documentation doesn’t really suggest using “ruby-2.6” as written right now.

run:
  name: Set Ruby Version
  command: echo 'chruby ruby-2.6' >> ~/.bash_profile  # Replace 2.6 with the specific version of Ruby here.

The command after the command actually says to replace 2.6 with a specific version.

2.) More importantly, using ruby-2.6 would break down if you ever wished to cache your bundle install, which we do. It legitimately saves about a minute per build.

save_ruby_cache:
    steps:
      - save_cache:
          key: ruby-gem-cache-v1-{{ checksum "Gemfile" }}
          paths:
            - /Users/distiller/.ruby-version
            - /Users/distiller/.gem/ruby/2.6.6

The issue is, the gems don’t install to a ruby-2.6 path but rather one tied to the specific version. This is the major reason I tend to specify an exact version and will continue to do so. I suppose one could use ruby-2.6 in .ruby-version and create a /Users/distiller/.gem/ruby/2.6 that symlinks but that of course still requires knowing what specific version is installed on the machine.

@TheMetalCode

On the first point, yes you are right here, this should be clarified. What it means is you can swap the version out of the version you require (so ruby-2.5, ruby-2.6 or ruby-2.7). I am in the process of overhauling some areas of the macOS documentation as we speak.

Generally we recommend install gems to vendor/bundle then caching this directory, but as you are wanting to cache a specific Ruby subdirectory, you may be interested in modifying this. The $GEM_HOME env var will point to where the current Ruby is storing gems, so you can use this to your advantage - e.g., /Users/distiller/.gem/ruby/2.6.6. A quick example of this can be found below:

steps:
    - checkout
    - run: echo 'chruby ruby-2.6' >> ~/.bash_profile
    - restore_cache:
        key: ruby-gem-cache-v1-{{ checksum "Gemfile" }}
    - run: cp -rp mygems $GEM_HOME || true
    - run: bundle install
    - run: cp -rp $GEM_HOME mygems
    - save_cache:
        key: ruby-gem-cache-v1-{{ checksum "Gemfile" }}
        paths: mygems

This was just a quick config off the top of my head, so you may want to adjust it to your needs. There are a couple intermediary steps to move the gems around as we cannot yet use environment variables in our cache paths.

The advantage here is you will no longer need to adjust your caching step when switching to a newer version of Xcode - one less thing to worry about!

1 Like

hi bytesguy,

I changed image from 11.1 to 11.4 today.
The firebase.tool installed successfully, but fastlane-plugin-firebase_app_distribution’s version is not found.
(however it works on 11.1)

//code
steps:
      - run:
          name: Set Ruby Version
          command:  echo "ruby-2.6" > ~/.ruby-version
      # Gemfile
      - restore_cache:
          keys:
            - v1-gems-{{ checksum "Gemfile.lock" }}
            - v1-gems-
      - run:
          name: Running bundle install
          command: bundle check || bundle install
          environment:
            BUNDLE_JOBS: 4
            BUNDLE_RETRY: 3
      - save_cache:
          key: v1-gems-{{ checksum "Gemfile.lock" }}
          paths:
            - vendor/bundle
      - run: curl -sL https://firebase.tools | bash

↓result

#!/bin/bash --login -eo pipefail
curl -sL firebase.tools | bash
tr: Illegal byte sequence
-- Checking for existing firebase-tools on PATH...
-- Checking your machine type...
[Binary URL] https://firebase.tools/bin/macos/latest
-- Downloading binary...

######################################################################## 100.0%
-- Setting permissions on binary...
-- firebase-tools@e]0;Firebase CLIa8.0.3 is now installed
-- All Done!
#!/bin/bash --login -eo pipefail
bundle exec fastlane firebase_deploy
[⠋] 🚀 [⠙] 🚀 [⠹] 🚀 [⠸] 🚀 [⠼] 🚀 [⠴] 🚀 [⠦] 🚀 [⠧] 🚀 [⠇] 🚀 [✔] 🚀 
[19:05:13]: Error loading plugin 'fastlane-plugin-firebase_app_distribution': cannot load such file -- fastlane/plugin/firebase_app_distribution
[19:05:13]: It seems like you wanted to load some plugins, however they couldn't be loaded
[19:05:13]: Please follow the troubleshooting guide: https://docs.fastlane.tools/plugins/plugins-troubleshooting/
+-------------------------------------------+-----------+------------------+
|                               Used plugins                               |
+-------------------------------------------+-----------+------------------+
| Plugin                                    | Version   | Action           |
+-------------------------------------------+-----------+------------------+
| fastlane-plugin-firebase_app_distribution | undefined | No actions found |

Please update using `bundle update fastlane`
bundler: failed to load command: fastlane (/usr/local/bin/fastlane)
ArgumentError: Malformed version number string undefined
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/version.rb:212:in `initialize'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/version.rb:203:in `new'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/version.rb:203:in `new'
  /Library/Ruby/Gems/2.6.0/gems/fastlane-2.140.0/fastlane/lib/fastlane/plugins/plugin_update_manager.rb:29:in `block in show_update_status'
  /Library/Ruby/Gems/2.6.0/gems/fastlane-2.140.0/fastlane/lib/fastlane/plugins/plugin_update_manager.rb:26:in `each'
  /Library/Ruby/Gems/2.6.0/gems/fastlane-2.140.0/fastlane/lib/fastlane/plugins/plugin_update_manager.rb:26:in `show_update_status'
  /Library/Ruby/Gems/2.6.0/gems/fastlane-2.140.0/fastlane/lib/fastlane/commands_generator.rb:43:in `ensure in start'
  /Library/Ruby/Gems/2.6.0/gems/fastlane-2.140.0/fastlane/lib/fastlane/commands_generator.rb:53:in `start'
  /Library/Ruby/Gems/2.6.0/gems/fastlane-2.140.0/fastlane/lib/fastlane/cli_tools_distributor.rb:119:in `take_off'
  /Library/Ruby/Gems/2.6.0/gems/fastlane-2.140.0/bin/fastlane:23:in `<top (required)>'
  /usr/local/bin/fastlane:23:in `load'
  /usr/local/bin/fastlane:23:in `<top (required)>'

Exited with code exit status 1

@seki-ne1 Hey :wave:

So as you went from 11.1 to 11.4, the base macOS version changed from Mojave to Catalina (we made this change in 11.2 and up).

There is a change in the way Ruby needs to be set in Catalina and above and it looks like your config is specifying the old method so Ruby is defaulting to the system Ruby - the system Ruby is pretty notorious for having permission issues when installing / working with gems.

Try using the following:

run:
  name: Set Ruby Version
  command: echo 'chruby ruby-2.6' >> ~/.bash_profile

Hope this helps :slight_smile:

1 Like

Hey @bytesguy! Is there a timeline for adding Xcode 11.4.1 support? Xcode 11.4 has a critical bug that prevents us from building our project, so we’re stuck on 11.3.1 until CircleCI has support for 11.4.1.

That seems worth a try - thanks!

1 Like

@rfree18 Hey, welcome to the forum!

We are currently blocked on creating the new 11.4.1 image as Apple has yet to release the direct download version of Xcode 11.4.1 (it’s currently only available on the App Store). Our image build process relies on the direct download version of Xcode to ensure the build environment is as clean, reliable and consistent as possible. Once Apple releases this then we will be building and distributing this image as possible.

Thank you for your patience!

2 Likes

Glad to hear. It looks like the direct download is now available.