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

Correctly add .swiftmodule directories to the search path. #1245

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion swift/toolchains/config/compile_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,14 @@ def _swift_module_search_path_map_fn(module):
The dirname of the module's `.swiftmodule` file.
"""
if module.swift:
return module.swift.swiftmodule.dirname
search_path = module.swift.swiftmodule.dirname

# If the dirname also ends in .swiftmodule, remove it as well so that
# the compiler finds the module *directory*.
if search_path.endswith(".swiftmodule"):
search_path = paths.dirname(search_path)

return search_path
else:
return None

Expand Down