Skip to content

[SR-12932] Custom toolchain picks up wrong target based on iOS deployment target #4465

Closed
@swift-ci

Description

@swift-ci
Previous ID SR-12932
Radar rdar://problem/63943132
Original Reporter steipete (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Version 11.5 (11E608c)

macOS 10.15.5 (19F96)

Swift trunk toolchain May 26, 2020

Additional Detail from JIRA
Votes 1
Component/s LLDB for Swift
Labels Bug
Assignee @adrian-prantl
Priority Medium

md5: 4a4dc190396d95422e0f647dd8bb548f

is duplicated by:

  • SR-10686 LLDB fails for iOS when using custom Swift toolchains

Issue 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 @weissi 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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions