Fix bug breaking sandboxing on macOS 10.12
macOS version strings that have only two components, e.g. "10.12", were
always failing the check that the macOS version is >= 10.11, causing
Bazel to erroneously think sandboxing isn't supported
@@ -64,8 +64,8 @@ final class DarwinSandboxRunner extends SandboxRunner {
// And we should check if sandbox still work when it gets 11.x
String osxVersion = OS.getVersion();
String[] parts = osxVersion.split("\\.");
- if (parts.length != 3) {
- // Currently the format is 10.11.x
+ if (parts.length < 2 || parts.length > 3) {
+ // Can be 10.xx or 10.xx.yy format
return false;
}
try {
