Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-7160] Error if Foo.swiftmodule/ exists but not with the correct architecture #49708

Closed
belkadan opened this issue Mar 9, 2018 · 4 comments
Labels
compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers improvement serialization Area → compiler: Serialization & deserialization

Comments

@belkadan
Copy link
Contributor

belkadan commented Mar 9, 2018

Previous ID SR-7160
Radar None
Original Reporter @belkadan
Type Improvement
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, DiagnosticsQoI, Serialization, StarterBug
Assignee tt (JIRA)
Priority Medium

md5: 2d5c5e875fe850040a0a32b9cb23999c

Issue Description:

The structure of a framework Foo that has Swift parts looks like this:

Foo.framework/
  Foo  # the executable
  Modules/
    Foo.swiftmodule/
      x86_64.swiftmodule

(Bare Swift libraries use just the "Foo.swiftmodule" directory, but this applies to them too.)

If I try to import that into an app that's targeting iOS using arm64, I'll get a "no such module" error. Worse, if it's a mixed Swift/Objective-C framework, I'll just get the Objective-C parts, without the Swift, with no diagnostic. We should notice that Foo.swiftmodule exists but that the right architecture doesn't.

@belkadan
Copy link
Contributor Author

belkadan commented Mar 9, 2018

The code that handles this is in the findModule function in SerializedModuleLoader.cpp. When you go to write a test for this, I suggest making a Foo.swiftmodule that contains an empty "bogus.swiftmodule" file, rather than trying to use any real arch.

@belkadan
Copy link
Contributor Author

belkadan commented Mar 9, 2018

@bob-wilson, this is the one we were talking about yesterday.

@swift-ci
Copy link
Collaborator

swift-ci commented Jun 8, 2018

Comment by Tapan Thaker (JIRA)

Taking this up for the TrySwift San Jose

@swift-ci
Copy link
Collaborator

Comment by Tapan Thaker (JIRA)

Resolved in #17092

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers improvement serialization Area → compiler: Serialization & deserialization
Projects
None yet
Development

No branches or pull requests

2 participants