Uploaded image for project: 'Swift'
  1. Swift
  2. SR-12932

Custom toolchain picks up wrong target based on iOS deployment target

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: LLDB for Swift
    • Labels:
      None
    • Environment:

      Version 11.5 (11E608c)

      macOS 10.15.5 (19F96)

      Swift trunk toolchain May 26, 2020

      Description

      When using a custom Swift toolchain (here: trunk snapshot May 26, 2020), lldb fails with an incompatible target error on a normal iOS project:

      ::GetInstanceVariableOffset_Metadata() – ivar_name = _url, type = Foundation.URL

      warning: Swift error in fallback scratch context: error: module 'Swift' was created for incompatible target x86_64-apple-ios13.0-simulator: /Users/steipete/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Swift-3K8REJ00QGV2U.swiftmodule

      note: This error message is displayed only once. If the error displayed above is due to conflicting search paths to Clang modules in different images of the debugged executable, this can slow down debugging of Swift code significantly, since a fresh Swift context has to be created every time a conflict is encountered.

      SwiftASTContextForExpressions::SetTriple("x86_64-apple-ios12.0.0") setting to "x86_64-apple-ios12.0.0"

      Full log with lldb type logging enabled:

      https://gist.github.com/steipete/257f7ddbf365a1e07cb323f51444ecc4

      This is unexpected and only with bumping ideas back with Johannes Weiss I found out that I can fix this by changing the iOS Deployment Target to 13. It was set to 12 before, since our project still supports iOS 12. A barebones example with the issue is attached.

      I would expect that using a Swift toolchain works like the integrated toolchain that comes with Xcode. Debugging works fine If I move the toolchain back to the Xcode 11.5 default.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              aprantl Adrian Prantl
              Reporter:
              steipete Peter Steinberger
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: