Description of the issue
Execution of ruby script fails with “abort trap: 6” error message.
Environment:
Where did the issue happen?
Bitrise iOS Xcode 8.2.x
Which build Step causes the issue and which version of the step?
Ruby script execution - any version
The script I’m trying to execute is the following (relevant bits):
require 'xcodeproj'
def change_bundle_id(project_name, target_name, project_configuration, project_filepath, new_bundle_ID)
project_directory=File.dirname project_filepath
puts "Parsing project at '#{project_filepath}'"
project = Xcodeproj::Project.open(project_filepath)
target = project.targets.find { |t| t.name == target_name }
exit -12 if target.nil?
configuration = target.build_configurations.find { |c| c.name == project_configuration }
exit -12 if configuration.nil?
puts "Setting Xcode Project's PRODUCT_BUNDLE_IDENTIFIER to '#{new_bundle_ID}'"
configuration.build_settings['PRODUCT_BUNDLE_IDENTIFIER'] = new_bundle_ID
puts "done!"
project.save
puts "done!!"
end
Reproducibility
The issue happens all the time.
Other stacks
The issue doesn’t appear when run locally with CLI
Build log
Relevant bits:
-> Writing Gemfile
$ bundle install
Fetching gem metadata from https://rubygems.org/...............
Fetching version metadata from https://rubygems.org/.
Resolving dependencies...
Installing concurrent-ruby 1.0.5
Installing i18n 0.8.1
Installing minitest 5.10.1
Installing thread_safe 0.3.6
Using claide 1.0.1
Using colored 1.2
Installing plist 3.2.0
Using bundler 1.13.6
Using tzinfo 1.2.2
Installing activesupport 5.0.2
Installing xcodeproj 1.3.3
Bundle complete! 2 Gemfile dependencies, 11 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
Parsing project at 'Harmony/Harmony.xcodeproj'
Setting Xcode Project's PRODUCT_BUNDLE_IDENTIFIER to 'com.harmonyplatform.harmony'
done!
/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise005010995/step_src/step.sh: line 52: 1107 Abort trap: 6 BUNDLE_GEMFILE="${CONFIG_gemfile_path}" bundle exec ruby "${CONFIG_ruby_content_file}"
--- finished ---
| |
+---+---------------------------------------------------------------+----------+
| x | Bundle ID (exit code: 134) | 17 sec |
+---+---------------------------------------------------------------+----------+
| Issue tracker: https://github.com/bitrise-io/steps-ruby-script/issues |
| Source: https://github.com/bitrise-io/steps-ruby-script |
+---+---------------------------------------------------------------+----------+