rules_xcodeproj
rules_xcodeproj copied to clipboard
Bug: create_xcode_overlay.sh: No such file or directory
Describe the bug
PhaseScriptExecution Generate\ Files /Users/user/Library/Developer/Xcode/DerivedData/Projects-fypotnookqgqmegzxfveuwcvjqgb/Build/Intermediates.noindex/Projects.build/rules_xcodeproj/Script-13F45F77FBD42E72938E9FF1.sh (in target 'BazelDependencies' from project 'Projects')
cd /Users/user/app
/bin/sh -c /Users/user/Library/Developer/Xcode/DerivedData/Projects-fypotnookqgqmegzxfveuwcvjqgb/Build/Intermediates.noindex/Projects.build/rules_xcodeproj/Script-13F45F77FBD42E72938E9FF1.sh
/Users/user/app/Projects.xcodeproj/rules_xcodeproj/bazel/bazel_build.sh: line 156: /Users/user/app/Projects.xcodeproj/rules_xcodeproj/create_xcode_overlay.sh: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
Reproduction steps
I'm not able to reproduce with the example project here, but here's how I got the error with our project:
- Generate a project with
bazelbuild mode - Build the app
- Generate again with
xcodebuild mode - Build the app
Expected behavior
No error.
Versions
- Bazel: 6.0.0-pre.20220804.3
- rules_xcodeproj: https://github.com/buildbuddy-io/rules_xcodeproj/commit/7ee46ec29bb4365f2c81525200a078b80bf5ca4a
- rules_apple: d04edf4136b4818662d7126582ec257aee372339
- rules_swift: 6153a848f747e90248a8673869c49631f1323ff3
Since this file is created based on this check: https://github.com/buildbuddy-io/rules_xcodeproj/blob/main/tools/generator/src/Generator/CreateFilesAndGroups.swift#L600, it would seem there is a bug here, or calling it: https://github.com/buildbuddy-io/rules_xcodeproj/blob/7ee46ec29bb4365f2c81525200a078b80bf5ca4a/tools/generator/src/Generator/AddBazelDependenciesTarget.swift#L5-L19
This only happened to me twice, I'm not able to reproduce it anymore. I'll take a look when I see it again.
@thii Have you run into this since?
I have not. Haven't been playing with BwX recently.
I'm going to close this for now then.
I've just reproduced it now. Looks like it's an Xcode's bug. Xcode doesn't reload the project if you regenerate it while keeping the project open, so I was building an BwX project with the BwB integration files (which doesn't have create_xcode_overlay.sh).
Seems only happens with large project.pbxproj file.
Ahh, yeah, not sure we can do anything about that. Hopefully people aren't switching modes in the day to day (cc: @erikkerber).
😅