Skip to content

Conversation

@benlangmuir
Copy link

  • Explanation: When using local submodule visibility (on by default for c++, off for c/objc), macros from some transitive imports could fail to be made visible depending on whether the submodule was written in the modulemap file or discovered from an umbrella directory. When using caching this applies to all submodules.
  • Scope: Affects modules in C++ modes, or if local submodule visibility is manually enabled in other language modes. Can affect non-caching builds depending on how the modulemap is written, but will primarily impact caching builds in practice.
  • Issue/Radar: rdar://136524433
  • Original PR: [clang][modules] Fix local submodule visibility of macros from transitive import llvm/llvm-project#122955
  • Risk: Low. Any submodule we stop marking visible immediately after this change will be made visible when it is actually imported, so this should only fix broken cases not change working ones.
  • Testing: Added regression test.
  • Reviewer: @Bigcheese

…tive import (llvm#122955)

When we mark a module visible, we normally mark all of its non-explicit
submodules and other exports as visible. However, when we first enter a
submodule we should not make them visible to the submodule itself until
they are actually imported. Marking exports visible before import would
cause bizarre behaviour with local submodule visibility, because it
happened before we discovered the submodule's transitive imports and
could fail to make them visible in the parent module depending on
whether the submodules involved were explicitly defined (module X) or
implicitly defined from an umbrella (module *).

rdar://136524433
(cherry picked from commit 4bb04d4)
@benlangmuir benlangmuir requested a review from a team as a code owner February 21, 2025 18:47
@benlangmuir
Copy link
Author

@swift-ci please test

@benlangmuir
Copy link
Author

@swift-ci please test llvm

@akyrtzi akyrtzi merged commit c5c47b4 into swiftlang:stable/20240723 Feb 22, 2025
5 checks passed
@benlangmuir benlangmuir deleted the eng/blangmuir/local-submodule-visibility-transitive-import branch February 24, 2025 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants