MobileNativeFoundation / MobileNativeFoundation/rules_xcodeproj

Bug: same indexstore is imported two times with different targetPathOverride

Open
#3,059 5 comments 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

I find two different units in Datastore for one source file after Indexing ends.
image
The two units are both imported from bazel generated indexstore because Xcode does not index the file 'ContentView.swift'
I think the reason may be that one indexstore is recorded two times with diffrent targetPathOverride in bi.filelist.
image

Reproduction steps

we can reproduce the behavior in examples/rules_ios.

  1. bazel run //:xcodeproj-incremental
  2. open rules_ios.xcodeproj
  3. wait for indexing finish
  4. check if there are two units for ContentView.swift in Index.noindex/DataStore/v5/units
Expected behavior

one indexstore should not be imported with different targetPathOverride

rules_xcodeproj version

2.5.2

Xcode version

15.0

Bazel version

7.1.1

rules_apple version

No response

rules_swift version

No response

Additional information

No response

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

Reproduce the issue from examples/rules_ios with bazel run //:xcodeproj-incremental, then inspect the generated bi.filelist and Index.noindex/DataStore/v5/units after indexing. Trace how the same indexstore is recorded with different targetPathOverride values. Done means ContentView.swift has one imported unit rather than two.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.