flutter icon indicating copy to clipboard operation
flutter copied to clipboard

Check and delete Xcode app at default search path

Open vashworth opened this issue 1 year ago • 3 comments

Type of Request

bug

Infrastructure Environment

Recipes

What is happening?

Recipes resets Xcode every build using xcode-select --reset. This command "Unsets any user-specified developer directory, so that the developer directory will be found via the default search mechanism."

The default path is /Applications/Xcode.app.

If there is an Xcode app at /Applications/Xcode.app, that Xcode app gets selected.

Recipes does not download Xcode at the default directory, it downloads them in the cache path, which means the /Applications/Xcode.app was probably downloaded manually.

Having a unmanaged, potentially outdated Xcode version selected may cause problems such as https://github.com/flutter/flutter/issues/161655#issuecomment-2672312880

Steps to reproduce

No response

Expected results

No response

vashworth avatar Mar 04 '25 23:03 vashworth

The triaged-infra label is irrelevant if there is no team-infra label or fyi-infra label.

flutter-triage-bot[bot] avatar Mar 15 '25 17:03 flutter-triage-bot[bot]

This may be something we can't do from recipes due to permissions issues:

If you use rm -rf, you get rm: /Applications/Xcode.app: Permission denied https://ci.chromium.org/ui/p/flutter/builders/staging.shadow/Mac_arm64_ios%20hello_world_ios__compile/5/infra

If you use self.m.file.rmtree, you get [Errno 1] Operation not permitted: '/Applications/Xcode.app/Contents/_CodeSignature' https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_arm64_ios%20hello_world_ios__compile/17897/overview

vashworth avatar May 12 '25 21:05 vashworth

As I mention here, we likely can't delete it. Perhaps instead, we can provide a warning?

vashworth avatar Dec 09 '25 20:12 vashworth