MobileNativeFoundation / MobileNativeFoundation/rules_xcodeproj

Bug: Incorrect error on swift imports "module xxx not found"

Open
#2,237 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Swift
Stars
626
Forks
124
PR merge metrics
No merged PRs in 30d

Description

Description

In Xcode editor, opening a swift source file shows a red error on import lines complaining "module XXX is not found"
This is not a true error in that the build would succeed regardlessly.

Reproduction steps
  1. Have a swift_library A which depends on swift_library B.
  2. Generate Xcode project and open swift source file in A which has line import B
  3. Xcode will mark the line import B with message "module A not found"
Expected behavior

Xcode doesn't mark the line import B with message "module A not found"

rules_xcodeproj version

1.6.0

Xcode version

14.1

Bazel version

6.1

rules_apple version

No response

rules_swift version

No response

Additional information

This is expected to resolve once the Xcode's Index build for target B is completed, however, more intuitive experience would be if source file in A is open, then the Index build for target B is scheduled with high priority.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the stated Swift libraries, Bazel 6.1, rules_xcodeproj 1.6.0, and Xcode 14.1. Trace Xcode project generation and the Index build scheduling for the dependent target B. Done means opening A no longer shows a false missing-module error for import B while the build still succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
build-system, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.