iOS Fastlane build fails on bundle install `digest-crc` dependency on Xcode 12 beta 3 image

I am trying to adopt an already working pipeline to make builds using Xcode12 beta 3 image.
One of the first steps I have is installing fastlane on the image which I run with bundle install --path .bundle. I have only Fastlane in my bundle.
This fails on the installation of dependencies phase:

#!/bin/bash --login -eo pipefail
bundle install --path .bundle
[DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set path '.bundle'`, and stop using this flag
Fetching gem metadata from
Fetching rake 13.0.1
Installing rake 13.0.1
Fetching CFPropertyList 3.0.2
Installing CFPropertyList 3.0.2
Fetching public_suffix 4.0.5
Installing public_suffix 4.0.5
Fetching addressable 2.7.0
Installing addressable 2.7.0
Fetching atomos 0.1.3
Installing atomos 0.1.3
Fetching aws-eventstream 1.1.0
Installing aws-eventstream 1.1.0
Fetching aws-partitions 1.351.0
Installing aws-partitions 1.351.0
Fetching aws-sigv4 1.2.1
Installing aws-sigv4 1.2.1
Fetching jmespath 1.4.0
Installing jmespath 1.4.0
Fetching aws-sdk-core 3.104.3
Installing aws-sdk-core 3.104.3
Fetching aws-sdk-kms 1.36.0
Installing aws-sdk-kms 1.36.0
Fetching aws-sdk-s3 1.75.0
Installing aws-sdk-s3 1.75.0
Fetching babosa 1.0.3
Installing babosa 1.0.3
Using bundler 2.1.4
Fetching claide 1.0.3
Installing claide 1.0.3
Fetching colored 1.2
Installing colored 1.2
Fetching colored2 3.1.2
Installing colored2 3.1.2
Fetching highline 1.7.10
Installing highline 1.7.10
Fetching commander-fastlane 4.4.6
Installing commander-fastlane 4.4.6
Fetching declarative 0.0.20
Installing declarative 0.0.20
Fetching declarative-option 0.1.0
Installing declarative-option 0.1.0
Fetching digest-crc 0.6.1
Installing digest-crc 0.6.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -rrubygems
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -S
checking for stdint.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
`try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
`block in try_compile'
`block in have_header'
`block in checking_for'
`block (2 levels) in postpone'
`block in postpone'
	from extconf.rb:3:in `<main>'
rake aborted!
Command failed with status (1): [/System/Library/Frameworks/Ruby.framework/...]
`block (3 levels) in <top (required)>'
`block (2 levels) in <top (required)>'
Tasks: TOP => default => crc16_genibus/crc16_genibus_ext.bundle =>
(See full trace by running task with --trace)

rake failed, exit code 1

Gem files will remain installed in
/Users/distiller/project/.bundle/ruby/2.6.0/gems/digest-crc-0.6.1 for
Results logged to

An error occurred while installing digest-crc (0.6.1), and Bundler
cannot continue.
Make sure that `gem install digest-crc -v '0.6.1' --source
''` succeeds before bundling.

In Gemfile:
  fastlane was resolved to 2.154.0, which depends on
    google-cloud-storage was resolved to 1.27.0, which depends on

Exited with code exit status 5

I have already seen this but it seems that it was resolved already for that specific case.

It seems that the same pipeline works fine if the image is Xcode 11.6.0. I’d appreciate any thoughts on this.

P.S. my Gemfile

source ""

gem "fastlane"

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)

I am having the same issue, it’s strange to me because I can get it to work fine on 10.5.6 on my local machine, ruby version is the same across 11.6.0 and 12.0.0 as well.

That error is consistent with not having the Xcode command-line tools install. The ordinary solution is to run: xcode-select --install before the build.

I do not know if this has something to do with Xcode 12 or with CircleCI’s image. Maybe try inserting that command towards the beginning of your pipeline.

@klsetzer :wave: The Beta command line tools are installed in the image. Since beta 3 these issues have started cropping up and I believe it is due to changes in Clang to do with the universal tools (with beta 3 Apple merged Xcode for Universal Apps into Xcode proper).

Most gems that build with native extensions seem affected and this is particularly the case if you are using the System Ruby. In some cases this can be resolved by switching to Ruby 2.7, however your mileage may vary right now due to the nature of the tooling being in beta still: