Disable rules swift VFS overlay when rules_ios VFS overlay feature is enabled. #926
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changed?
Not enable vfsoverlay on rules_swift side if VFS overlay feature is enabled on rules_ios side
Why this change?
On our downstream project, We found that the way rules_swift writes the VFS overlay is not compatible with rules_ios. Specifically it has
overlay-relative
being true where rules_ios has it beingfalse
. In rules_ios we there calculate the number of../
needed to associate a file to a rightexternal-content
path. In vfs overlay generated by rules_swift however, it has relative path to the root ofbazel-out
.While I believe this works with bazel build (otherwise CI should have been red), this apparently does not work when building with rules_xcodeproj against a pure swift library. For unknown reason indexing will have
unable to locate module Foo
error without overriding theoverlay-relative
to be false and hardcode../
in front to make it work.Removing this makes rules_swift provide the real path to a swift module. And this makes xcode proj able to jump a swift module interface when cmd click on a swift module inside the source file.
In addition, we found that downstream project's CI still works if we point to rules_swift that has VFS overlay implementation broken, other than one place that depend on a swift_library directly. Which means the VFS generated by it does not participate in compilation for all
apple_framework
targets.Note that this is a broken change but downstream user can still enable swift.vfsoverlay on their side.
Next step:
go to rules_xcodeproj side and figure out if the integration tests with rules_ios is broken also. If so red green and try to find a way to guarantee it works.