Xcode 15.1 update required `bazel clean --expunge`
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the bug:
Hi wonderful Bazelers,
Upon (auto)update to Xcode 15.1, cc build actions were failing with an error like the following:
```
ERROR: /private/var/tmp/_bazel_cs/c1dcb02408a32f8b43809b55051a2a95/external/curl/BUILD.bazel:42:11: Compiling lib/multi.c failed: I/O exception during sandboxed execution: Running '/var/tmp/_bazel_cs/install/34d6f2d221c0110876b5149600d2d706/xcode-locator 15.0.1.15A507' failed with code 1.
This most likely indicates that xcode version 15.0.1.15A507 is not available on the host machine.
Process exited with status 1
stdout: {
"15.1": "/Applications/Xcode.app/Contents/Developer",
"15": "/Applications/Xcode.app/Contents/Developer",
"15C65": "/Applications/Xcode.app/Contents/Developer",
"15.1.0.15C65": "/Applications/Xcode.app/Contents/Developer",
"15.1.0": "/Applications/Xcode.app/Contents/Developer"
}
stderr: 2023-12-13 18:41:02.973 xcode-locator[20470:2975116] Found bundle com.apple.dt.Xcode in file:///Applications/Xcode.app/; contents on disk: (
"file:///Applications/Xcode.app/Contents/"
)
2023-12-13 18:41:02.974 xcode-locator[20470:2975116] Version strings for file:///Applications/Xcode.app/: short=15.1, expanded=15.1.0
```
The usual `sudo xcodebuild -license`, opening Xcode to install components, etc. didn't resolve the issue, nor did `bazel clean`, but `bazel clean --expunge` did.
My understanding from [the docs](https://bazel.build/docs/user-manual#clean) is that you'd like issues filed when there's somehow bad, cached state like this. I'm filing it here because I think the [xcode-configure stuff still lives in this repo](https://github.com/bazelbuild/bazel/blob/master/tools/osx/xcode_configure.bzl). I think this isn't a duplicate because I don't see any other search results for "15C65" or relevant ones for "15A507", and since 15.1 is just rolling out. Hopefully this'll also help others workaround in the meantime.
Thanks so much for all you do,
Chris
### Which category does this issue belong to?
C++/Objective-C Rules
### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Phew, this feels like one that's going to defy a stateless repro, but build code using Xcode 15.0.1, then update to Xcode 15.1 without clearing (local) cache and see if you can hit this, too.
### Which operating system are you running Bazel on?
macOS
### What is the output of `bazel info release`?
This was on the latest rolling: 8.0.0-pre.20231030.2
Contributor guide
Research direction
Start with tools/osx/xcode_configure.bzl and reproduce the transition from Xcode 15.0.1 to 15.1 without clearing the local cache. Check how cached Xcode version data is reused and compare the behavior of bazel clean with bazel clean --expunge; the issue does not name a test or specify the expected fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, macos, objective-c
- Domain
- build-system, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100