This project demonstrates an issue in buildbuddy-io/rules_xcodeproj whereby the Xcode Address Sanitizer feature does not seem to work as expected in BwB (Build-with-Bazel) mode. As described below, a buildbuddy-io/rules_xcodeproj Xcode project is compared to a yonaskolb/XcodeGen Xcode project to understand how a vanilla Xcode project behaves.
This project was created to add context and reproduction steps to the GitHub Issue opened here.
These results were validated using the following configuration:
- Host machine:
- 16-inch MacBook Pro (2021)
- Apple M1 Max
- 32 GB memory
- macOS 12.6 (Monterey)
- Dependecies:
- Xcode: 14.0.1
- Bazel: 6.0.0
- buildbuddy-io/rules_xcodeproj: 0.12.0
The Makefile
contains two commands to demonstrate the issue:
The following command produces a buildbuddy-io/rules_xcodeproj Xcode project:
make bazel_project
The following command produces a yonaskolb/XcodeGen Xcode project:
make xcodegen_project
After performing the following steps:
make bazel_project
- Enable Address Sanitizer via
Product > Scheme > Edit Scheme > Run > Diagnostics > Address Sanitizer
- Run
App
target - Tap
Trigger Address Sanitizer
button
We see that the Address Sanitizer
does not work as expected in the buildbuddy-io/rules_xcodeproj project.
Application execution is halted, and a call-stack identifying the runtime issue is provided.
Application execution continues without any halts or crashes.
- As confirmed here,
Address Sanitizer
works as expected in BwX mode (Build-with-Xcode). - As confirmed here,
Address Sanitizer
works as expected for a Swift implementation in BwB mode (Build-with-Bazel). - As confirmed here,
Address Sanitizer
works as expected for a different Objective-C implementation in BwB mode (Build-with-Bazel).