Fastlane step 3.4.2 failing in Rosetta 2 emulated mode

Hi,
we are exploring new Rosetts 2 emulated stack, but having issue with fastlane step.
Installing google-cloud-storage 1.44.0

Here is the log of bundle install command that is executed by this step.


Install Fastlane with bundler

$ bundle "_2.3.26_" "install" "--jobs" "20" "--retry" "5"

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/unf_ext-0.0.8.2/ext/unf_ext

/Users/vagrant/.rbenv/versions/3.1.3/bin/ruby -I

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0 extconf.rb

checking for -lstdc++... yes

creating Makefile

current directory:

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/unf_ext-0.0.8.2/ext/unf_ext

make DESTDIR\= sitearchdir\=./.gem.20230330-4299-krg2ep

sitelibdir\=./.gem.20230330-4299-krg2ep clean

current directory:

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/unf_ext-0.0.8.2/ext/unf_ext

make DESTDIR\= sitearchdir\=./.gem.20230330-4299-krg2ep

sitelibdir\=./.gem.20230330-4299-krg2ep

compiling unf.cc

linking shared-object unf_ext.bundle

ld: warning: directory not found for option '-L/opt/homebrew/opt/php@7.4/lib'

ld: warning: directory not found for option '-L/opt/homebrew/opt/php@7.4/lib'

ld: can't link with a main executable file

'/Users/vagrant/.rbenv/versions/3.1.3/bin/ruby' for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make: *** [unf_ext.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/unf_ext-0.0.8.2

for inspection.

Results logged to

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/extensions/arm64-darwin-22/3.1.0-static/unf_ext-0.0.8.2/gem_make.out

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/ext/builder.rb:102:in

`run'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/ext/builder.rb:51:in

`block in make'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/ext/builder.rb:43:in

`each'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/ext/builder.rb:43:in

`make'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:42:in

`build'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/ext/builder.rb:171:in

`build_extension'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/ext/builder.rb:205:in

`block in build_extensions'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/ext/builder.rb:202:in

`each'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/ext/builder.rb:202:in

`build_extensions'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/installer.rb:843:in

`build_extensions'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/rubygems_gem_installer.rb:72:in

`build_extensions'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/rubygems_gem_installer.rb:28:in

`install'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/source/rubygems.rb:207:in

`install'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/installer/gem_installer.rb:54:in

`install'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/installer/gem_installer.rb:16:in

`install_from_spec'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/installer/parallel_installer.rb:186:in

`do_install'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/installer/parallel_installer.rb:177:in

`block in worker_pool'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/worker.rb:62:in

`apply_func'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/worker.rb:57:in

`block in process_queue'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/worker.rb:54:in

`loop'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/worker.rb:54:in

`process_queue'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/worker.rb:91:in

`block (2 levels) in create_threads'

An error occurred while installing unf_ext (0.0.8.2), and Bundler cannot

continue.

In Gemfile:

fastlane was resolved to 2.211.0, which depends on

faraday-cookie_jar was resolved to 0.0.7, which depends on

http-cookie was resolved to 1.0.5, which depends on

domain_name was resolved to 0.5.20190701, which depends on

unf was resolved to 0.1.4, which depends on

unf_ext

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/json-2.6.3/ext/json/ext/generator

/Users/vagrant/.rbenv/versions/3.1.3/bin/ruby -I

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0 extconf.rb

creating Makefile

current directory:

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/json-2.6.3/ext/json/ext/generator

make DESTDIR\= sitearchdir\=./.gem.20230330-4299-ewhsrg

sitelibdir\=./.gem.20230330-4299-ewhsrg clean

current directory:

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/json-2.6.3/ext/json/ext/generator

make DESTDIR\= sitearchdir\=./.gem.20230330-4299-ewhsrg

sitelibdir\=./.gem.20230330-4299-ewhsrg

compiling generator.c

linking shared-object json/ext/generator.bundle

ld: warning: directory not found for option '-L/opt/homebrew/opt/php@7.4/lib'

ld: warning: directory not found for option '-L/opt/homebrew/opt/php@7.4/lib'

ld: can't link with a main executable file

'/Users/vagrant/.rbenv/versions/3.1.3/bin/ruby' for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make: *** [generator.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/json-2.6.3 for

inspection.

Results logged to

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/extensions/arm64-darwin-22/3.1.0-static/json-2.6.3/gem_make.out

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/ext/builder.rb:102:in

`run'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/ext/builder.rb:51:in

`block in make'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/ext/builder.rb:43:in

`each'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/ext/builder.rb:43:in

`make'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:42:in

`build'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/ext/builder.rb:171:in

`build_extension'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/ext/builder.rb:205:in

`block in build_extensions'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/ext/builder.rb:202:in

`each'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/ext/builder.rb:202:in

`build_extensions'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/installer.rb:843:in

`build_extensions'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/rubygems_gem_installer.rb:72:in

`build_extensions'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/rubygems_gem_installer.rb:28:in

`install'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/source/rubygems.rb:207:in

`install'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/installer/gem_installer.rb:54:in

`install'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/installer/gem_installer.rb:16:in

`install_from_spec'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/installer/parallel_installer.rb:186:in

`do_install'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/installer/parallel_installer.rb:177:in

`block in worker_pool'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/worker.rb:62:in

`apply_func'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/worker.rb:57:in

`block in process_queue'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/worker.rb:54:in

`loop'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/worker.rb:54:in

`process_queue'

/Users/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/worker.rb:91:in

`block (2 levels) in create_threads'

An error occurred while installing json (2.6.3), and Bundler cannot continue.

In Gemfile:

fastlane was resolved to 2.211.0, which depends on

json

Failed to install Step dependencies:

command failed with exit status 5 (bundle "_2.3.26_" "install" "--jobs" "20" "--retry" "5"):

check the command's output for details

Failed to install Step dependencies:

command failed with exit status 5 (bundle "_2.3.26_" "install" "--jobs" "20" "--retry" "5"):

check the command's output for details
1 Like

im also experiencing this issue now, any updates?

Hello,

As of today, there is only a workaround for this. The native extensions can be built properly, if the command is run with the prefix arch -arm64. This will switch the emulated environment back to its original architecture for the specific command.

1 Like

Hello…
I am also facing the same issue. any solution for this?

@atanas-bitrise could you please elaborate on how to do a workaround? you mentioned

2 Likes

Same issue. It works fine in my McBook Air M1 Machine but fails in Bitrise Stacked with M1 and Rosetta 2. It does not even finishes from installing gems.