rules_xcodeproj icon indicating copy to clipboard operation
rules_xcodeproj copied to clipboard

Bug: create_xcode_overlay.sh: No such file or directory

Open thii opened this issue 3 years ago • 2 comments

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:

  1. Generate a project with bazel build mode
  2. Build the app
  3. Generate again with xcode build mode
  4. 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

thii avatar Sep 07 '22 12:09 thii

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

brentleyjones avatar Sep 07 '22 12:09 brentleyjones

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 avatar Sep 09 '22 13:09 thii

@thii Have you run into this since?

brentleyjones avatar Oct 06 '22 19:10 brentleyjones

I have not. Haven't been playing with BwX recently.

thii avatar Oct 07 '22 12:10 thii

I'm going to close this for now then.

brentleyjones avatar Oct 07 '22 12:10 brentleyjones

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.

thii avatar Oct 07 '22 13:10 thii

Ahh, yeah, not sure we can do anything about that. Hopefully people aren't switching modes in the day to day (cc: @erikkerber).

brentleyjones avatar Oct 07 '22 13:10 brentleyjones

😅

erikkerber avatar Oct 07 '22 18:10 erikkerber