periphery: Github CI throws error: 'Either the index store is outdated, or you have requested to scan targets that have not been built'

I have a separate job which runs the periphery scan, but it fails with this error:

stdout: "* Inspecting project...\n* Building project-iosUITests...\n* Building project-iosTests...\n* Building project-ios...\n* Indexing...\n",
    stderr: "error: The index store at '/Users/runner/Library/Caches/com.github.peripheryapp/DerivedData-f3bd6041-79ffde3d/Index/DataStore' does not contain data for the following targets: project-ios, project-iosTests, project-iosUITests. Either the index store is outdated, or you have requested to scan targets that have not been built.\n",

This is my command:

periphery scan --strict --clean-build

I just clone my project, brew install periphery and run that command in a github ci job. Am I missing something?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 17 (4 by maintainers)

Most upvoted comments

Same here, Periphery doesn’t work any more with Xcode 14.2 when I run BuildTools/periphery scan --report-exclude "**/R.generated.swift" --verbose I get:

The index store at ‘/Users/…/Library/Caches/com.github.peripheryapp/DerivedData-cdc2f99d-beef84d0/Index/DataStore’ does not contain data for the following targets: TARGET. Either the index store is outdated, or you have requested to scan targets that have not been built.

@ileitch 2.10.3 worked like a charm for me, thank you!

I’ve included a potential fix for this in 2.10.3, could you all please give it a try?

@ileitch I’m also seeing essentially the same error output that @spipau saw with Xcode 14.2, Periphery 2.10.2 (installed with Homebrew). Everything worked fine with Xcode 13.4 previously. Hope this can be fixed soon (but no worries if it’s done after New Year’s - thank you for all you do on Periphery!).

It is back for me. See (redacted) log, the redacted parts seems to be ok.

  • The [index:swift] Source file not indexed were recently added to the project (not locally, however, the code is a git checkout for a code review of some changes made by somebody else).
  • The workspace and all targets compile as expected without errors (with just some warnings).
  • The examined Xcode target also runs swiftlint and swiftformat in a build phase.
% periphery scan --workspace "REDACTED.xcworkspace" --schemes REDACTED --targets REDACTED,"REDACTED Tests","Unit Tests" --report-exclude "REDACTED/**/*.swift" --retain-objc-accessible --verbose
[version] 2.10.0
[shell] /bin/zsh -lc env
[shell] /usr/bin/env swift -version
swift-driver version: 1.62.15 Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51)
Target: arm64-apple-macosx12.0
[shell] /usr/bin/env xcodebuild -version
Xcode 14.1
Build version 14B47b
[configuration:begin]
report_exclude:
- "REDACTED/**/*.swift"
retain_objc_accessible: true
schemes:
- REDACTED
targets:
- REDACTED
- REDACTED Tests
- Unit Tests
verbose: true
workspace: REDACTED
[configuration:end]
* Inspecting project...
[xcode:workspace] Loading REDACTED.xcworkspace
[xcode:project] Loading REDACTED.xcodeproj
[xcode:project] Loading REDACTED/TestApp.xcodeproj
[shell] /usr/bin/env xcodebuild -workspace REDACTED.xcworkspace -list -json
[shell] /usr/bin/env xcodebuild -workspace REDACTED.xcworkspace -showBuildSettings -scheme REDACTED build test
* Building REDACTED...
[shell] /bin/sh -c xcodebuild -workspace 'REDACTED.xcworkspace' -scheme 'REDACTED' -parallelizeTargets -derivedDataPath 'REDACTED/Library/Caches/com.github.peripheryapp/DerivedData-8baa28e1-c65005c9' -quiet build-for-testing CODE_SIGNING_ALLOWED="NO" ENABLE_BITCODE="NO" DEBUG_INFORMATION_FORMAT="dwarf"
* Indexing...
[index:swift] Source file not indexed: REDACTED.swift
[index:swift] Source file not indexed: REDACTED.swift
[index:swift] Source file not indexed: REDACTED.swift
[index:swift] Source file not indexed: REDACTED.swift
[index:swift] Source file not indexed: REDACTED.swift
[index:swift] Source file not indexed: REDACTED.swift
error: The index store at 'REDACTED/Library/Caches/com.github.peripheryapp/DerivedData-8baa28e1-c65005c9/Index/DataStore' does not contain data for the following targets: REDACTED. Either the index store is outdated, or you have requested to scan targets that have not been built.