build-tools icon indicating copy to clipboard operation
build-tools copied to clipboard

The version of Xcode downloaded by `e load-xcode` produces a "damaged and can't be opened" popup

Open NoelTautges opened this issue 1 year ago • 3 comments

Operating System

macOS 13.5.1, arm64

To Reproduce

This is only a problem on macOS 10.15 (Catalina) or higher because that's when the notarization requirement was introduced.

  1. Run e load-xcode.
  2. Provided you already have a config set, run e sync.

Expected Behavior

The source code is downloaded.

Actual Behavior

The following is logged, along with 2 '"Xcode-14.3.0.app" is damaged and can't be opened. You should move it to the trash.' popups, one per invocation of git:

Running "gclient sync --with_branch_heads --with_tags -vv" in /Users/ntautges/electron/src
Updating depot_tools...
git: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
git: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
depot_tools update failed. Couldn't fetch main branch.
Retry later or reclone depot_tools
git: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
git: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
ERROR Error: spawnSync /bin/sh ENOENT
    at Object.spawnSync (node:internal/child_process:1110:20)
    at spawnSync (node:child_process:871:24)
    at Object.execSync (node:child_process:952:15)
    at setRemotes (/Users/ntautges/.electron_build_tools/src/e-sync.js:29:8)
    at runGClientSync (/Users/ntautges/.electron_build_tools/src/e-sync.js:62:5)
    at Command.<anonymous> (/Users/ntautges/.electron_build_tools/src/e-sync.js:77:7)
    at Command.listener [as _actionHandler] (/Users/ntautges/.electron_build_tools/node_modules/commander/lib/command.js:480:17)
    at /Users/ntautges/.electron_build_tools/node_modules/commander/lib/command.js:1234:65
    at Command._chainOrCall (/Users/ntautges/.electron_build_tools/node_modules/commander/lib/command.js:1151:12)
    at Command._parseCommand (/Users/ntautges/.electron_build_tools/node_modules/commander/lib/command.js:1234:27)

Screenshots

xcode is damaged

Additional Information

The developer tools can be manually authorized by going to Settings > Privacy & Security > '"Xcode-14.3.0.app was blocked from use because it is not from an identified developer.' > Open Anyway > Open. Rerunning the command makes everything work.

This might be able to be solved by renotarizing the stripped-down version of Xcode (if possible, I don't have experience with the process) or informing the user of a workaround, maybe running an executable a couple times just so they can manually authorize it?

Thank you for your work on this project.

NoelTautges avatar Aug 31 '23 21:08 NoelTautges

Or if there is a way to point to the locally installed /Applications/Xcode.app that could resolve here as well?

(I'm hitting the same issue, thank you for the work around @NoelTautges 🎉 )

devm33 avatar Sep 05 '23 19:09 devm33

See the screenshot in #494. We should improve our documentation now that this is more prevalent, but that is the correct solution.

dsanders11 avatar Nov 07 '23 04:11 dsanders11