fastlane: Can't build after upgrade to Xcode 8.3

New Issue Checklist

Issue Description

Can’t build after upgrade to Xcode 8.3

Complete output when running fastlane, including the stack trace and command used
2017-03-29 01:44:50.671 xcodebuild[48767:2742807]  DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-12169/IDEFoundation/Playgrounds/IDEPlaygroundAuxiliarySourceCompilerOperation.m:394
Details:  Unable to read diagnostics from file "/Users/mliberato/Library/Developer/Xcode/DerivedData/App_Name-gtrtqtcffulrlebitlpvailvkkec/Build/Intermediates/ArchiveIntermediates/App_Name/IntermediateBuildFilesPath/App_Name.build/Release-iphoneos/App_Name.build/Objects-normal/arm64/BaseViewController.dia" (Invalid File): Invalid diagnostics signature
Function: void XCGenerateDiagnosticsFromFile(NSString *__strong, NSString *__strong, NSDictionary *__strong, NSDictionary *__strong, IDEActivityLogSectionRecorder *__strong, BOOL (^__strong)(IDEActivityLogMessage *__strong))
Thread:   <NSThread: 0x7fc83ec06c00>{number = 90, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.

** ARCHIVE FAILED **


The following build commands failed:
CompileSwift normal arm64
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)
ERROR [2017-03-29 01:44:50.91]: Exit status: 65

Log file

PHI node operands are not the same type as the result!
  %359 = phi %CSo8NSNumber* [ %3093, %3091 ], [ %348, %350 ], !dbg !1091
PHI node operands are not the same type as the result!
  %387 = phi %CSo8NSNumber* [ %3090, %3088 ], [ %375, %378 ], !dbg !1127
LLVM ERROR: Broken function found, compilation aborted!

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

Environment

🚫 fastlane environment 🚫

Stack

Key Value
OS 10.12.3
Ruby 2.3.0
Bundler? false
Git git version 2.11.0 (Apple Git-81)
Installation Source ~/.rvm/gems/ruby-2.3.0/bin/fastlane
Host Mac OS X 10.12.3 (16D32)
Ruby Lib Dir ~/.rvm/rubies/ruby-2.3.0/lib
OpenSSL Version OpenSSL 1.0.2f 28 Jan 2016
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 8.3

System Locale

Error
No Locale with UTF8 found 🚫

fastlane files:

`./fastlane/Fastfile`
update_fastlane

fastlane_version "1.81.0"

default_platform :ios

# Configurations
application_name = "App Name"

platform :ios do
  before_all do |lane, options|
    if (lane.to_s.eql? "distributeWithFabric")
      cocoapods
    end
  end

  desc "Build release with specific scheme and upload to Fabric"
  lane :distributeWithFabric do |options|
    if "#{options[:scheme]}".empty?
      raise Exception.new("Which scheme will build?")
    end

    configuration = options[:configuration]

    if "#{configuration}".empty?
      # raise Exception.new("Need a configuration set: Debug or Release")
      configuration = "Release"
    end

    scheme = options[:scheme].split(",")

    baseBuildWithFabric(
          workspace: "#{application_name}.xcworkspace",
          scheme: scheme,
          configuration: options[:configuration],
          app_name:"#{application_name}",
        )
  end

  desc "Base build release with specific configurations and upload to Fabric"
  private_lane :baseBuildWithFabric do |options|
    options[:scheme].each { |scheme|

      match(force_for_new_devices: true)

      gym(
        workspace: options[:workspace],
        configuration: options[:configuration],
        scheme: scheme.strip,
        silent: false,
        clean: true
      )

    }

  end

end

fastlane gems

Gem Version Update-Status
fastlane 2.23.0 ✅ Up-To-Date

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
slack-notifier 1.5.1
rouge 1.11.1
xcpretty 0.2.4
terminal-notifier 1.6.3
terminal-table 1.4.5
plist 3.1.0
addressable 2.4.0
multipart-post 2.0.0
word_wrap 1.0.0
tty-screen 0.5.0
babosa 1.0.2
colored 1.2
highline 1.7.8
commander-fastlane 4.4.4
excon 0.45.4
faraday 0.9.2
unf_ext 0.0.7.2
unf 0.1.4
domain_name 0.5.20160615
http-cookie 1.0.2
faraday-cookie_jar 0.0.6
fastimage 1.6.8
gh_inspector 1.0.1
uber 0.0.15
representable 2.3.0
retriable 2.1.0
mime-types-data 3.2016.0521
mime-types 3.1
hurley 0.2
little-plugger 1.1.4
multi_json 1.12.1
logging 2.1.0
jwt 1.5.4
memoist 0.14.0
os 0.9.6
signet 0.7.2
googleauth 0.5.1
thor 0.19.1
httpclient 2.8.0
google-api-client 0.9.9
mini_magick 4.5.1
multi_xml 0.5.5
rubyzip 1.1.7
security 0.1.3
xcpretty-travis-formatter 0.0.4
dotenv 2.1.1
bundler 1.12.5
faraday_middleware 0.10.0
i18n 0.7.0
thread_safe 0.3.5
tzinfo 1.2.2
minitest 5.9.0
activesupport 4.2.6
json 1.8.3
CFPropertyList 2.3.5
claide 1.0.1
nanaimo 0.2.3
xcodeproj 1.4.2

generated on: 2017-03-29

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 4
  • Comments: 20 (7 by maintainers)

Most upvoted comments

I encountered the same problem, and searching for a solution brought me here (I can build for debug, but I cannot build for release / archive). I am not using Fastlane. Rather, this seems to be a Swift 3.1 issue. Possibly the same root cause as https://bugs.swift.org/browse/SR-4220

I first tried the workaround or changing the optimization level but that didn’t fix my issue. I did eventually find a line of code to change to fix the problem. I’m sharing here to perhaps help someone else that comes here trying to solve the same problem, à la https://xkcd.com/979/ .

My issue dealt with NSDecimalNumber:

PHI node operands are not the same type as the result!
  %3622 = phi %CSo15NSDecimalNumber* [ %3636, %3635 ], [ %3615, %3617 ], !dbg !951
PHI node operands are not the same type as the result!
  %3636 = phi %CSo15NSDecimalNumber* [ %3588, %3585 ], [ %3615, %3616 ], !dbg !951
LLVM ERROR: Broken function found, compilation aborted!

I searched my project for all NSDecimalNumber references, and concentrated my search on constructors, inspired by this comment: https://github.com/fastlane/fastlane/issues/8698#issuecomment-290231313

The problem, I think, was that I was constructing an NSDecimalNumber from a dictionary value that was being cast to an optional string, e.g.: NSDecimalNumber( string: dict["key"] as? String ).

Replacing this code with a check to see if the key exists first, and then constructing the NSDecimalNumber with a force cast to String via as!, solved my build for release / archive issue.

Further, by making that change, I was able to keep whole-module-optimization turned on.

I wanted to just add a comment to thank @darronschall as well as others that led me to a workaround. I had the exact same problem and the optimization level did not help me either. My error message seemed to be with NSDecimalNumber and finding the one constructor that was using an optional even though the API indicates this should be valid. Once corrected, I was also able to keep whole-module-optimization. So, someone did come here trying to solve the same problem…and even thought this is not a fastlane issue, it seems to be the only place that has provided some constructive workarounds. Cheers!

It worked by changing the optimization level from “Fast, Whole Module Optimization [-O -whole-module-optimization]” to “Fast, Single-File Optimization [-O]”.

@mliberato I think you build debug configuration. And you are have no optimization enabled for this. Try to archive your project from Xcode. I think you will get the same issue.