Can't clone private repos when scanning
When I try to build the project using xcodebuild command it builds successfully, but when I try to run Periphery, it gives me an error that I don't have access to a private repo (which I do have access to)
Error 🚨:
periphery scan --project XYZ.xcodeproj --schemes XYZ --clean-build
* Inspecting project...
* Building XYZ...
error: Shell command '/bin/sh -c xcodebuild -project '/Users/ahmadyasser/Documents//XYZ.xcodeproj' -scheme 'XYZ' -parallelizeTargets -derivedDataPath '/Users/ahmadyasser/Library/Caches/com.github.peripheryapp/DerivedData-66819cbe-3304282e-3304282e' -quiet build CODE_SIGNING_ALLOWED="NO" ENABLE_BITCODE="NO" DEBUG_INFORMATION_FORMAT="dwarf" COMPILER_INDEX_STORE_ENABLE="YES" INDEX_ENABLE_DATA_STORE="YES"' returned exit status '74':
2023-11-15 12:44:13.411 xcodebuild[28412:218271] Writing error result bundle to /var/folders/28/x4jsqs3x4v92hz54h17ycbk80000gn/T/ResultBundle_2023-15-11_12-44-0013.xcresult
xcodebuild: error: Could not resolve package dependencies:
Failed to clone repository [email protected]:COMPANY/PRIVATE_XYZ.git:
Cloning into bare repository '/Users/ahmadyasser/Library/Caches/com.github.peripheryapp/DerivedData-66819cbe-3304282e-3304282e/SourcePackages/repositories/PRIVATE_XYZ-58530665'...
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Same thing for me but with public repo dependency
I have the same issue with private repositories.
Building the "regular" project in XCode works just fine, but periphery is not able to pull dependencies from my private repo.
Any updates on this from anyone? Maybe a workaround?
@kanduvisla Nothing yet from my side, if I found anything I'll share it here.
@ahmdyasser I did manage to get some sort of workaround, but it's not working for me (but maybe it will for you). The idea is to separate the build and the scan:
# 1. use xcodebuild
xcodebuild -scheme MyScheme -destination 'platform=iOS Simulator,OS=16.2,name=iPhone 14' -derivedDataPath '../dd' clean build
# 2. use produced index store for scanning
periphery scan --skip-build --index-store-path '../dd/Index.noindex/DataStore/'
But in my case, the scan shows almost all my files as false postives (#711), but maybe you'll get different results. If so: could you please share this? Then we can see if it's periphery-related, or project-related.
@kanduvisla When I try to run the first command it gives me this error