Skip to content

[cxx-interop] Correctly generate the list of transitive dependencies for CxxStdlib overlay #71813

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

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

egorzhdan
Copy link
Contributor

This fixes a compiler error that occurred while building CxxStdlib.swiftmodule and other projects that use C++ interop: error: cannot find type 'std' in scope.

The compiler was creating two distinct swift::ModuleDecl instances for the CxxStdlib module while building the CxxStdlib overlay: one as a main module (the module that is currently being compiled), one as a dependency of the main module. This confused the Swift name lookup logic down the road.

This only happened with recent libc++.

See the inline comment for more details.

rdar://122815523

…for CxxStdlib overlay

This fixes a compiler error that occurred while building `CxxStdlib.swiftmodule` and other projects that use C++ interop: `error: cannot find type 'std' in scope`.

The compiler was creating two distinct `swift::ModuleDecl` instances for the CxxStdlib module while building the CxxStdlib overlay: one as a main module (the module that is currently being compiled), one as a dependency of the main module. This confused the Swift name lookup logic down the road.

This only happened with recent libc++.

See the inline comment for more details.

rdar://122815523
@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Feb 22, 2024
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan
Copy link
Contributor Author

@swift-ci please test

@egorzhdan
Copy link
Contributor Author

@swift-ci please test source compatibility

@egorzhdan
Copy link
Contributor Author

@swift-ci please test macOS

@egorzhdan
Copy link
Contributor Author

The source compat CI failures are unrelated:

/Users/ec2-user/jenkins/workspace-private/swift-PR-source-compat-suite-debug-macos/swift/stdlib/public/core/ObjectIdentifier+DebugDescription.swift:16:7: error: external macro implementation type 'SwiftMacros.DebugDescriptionMacro' could not be found for macro '_DebugDescription()'; '/Users/ec2-user/jenkins/workspace-private/swift-PR-source-compat-suite-debug-macos/build/compat_macos/swift-macosx-arm64/bin/swift-plugin-server' produced malformed response

@egorzhdan egorzhdan merged commit 98fc9fd into main Feb 26, 2024
@egorzhdan egorzhdan deleted the egorzhdan/std-not-found branch February 26, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant