local: fix mac issues in bazel (#1893)

This commit is contained in:
Adrian Stobbe 2023-06-09 10:35:52 +02:00 committed by GitHub
parent 7c345f4503
commit e0fe8e6ca0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 84 additions and 16 deletions

View file

@ -9,7 +9,7 @@ def go_test(ld = None, count = 3, **kwargs):
It adds the following:
- Sets test count to 3.
- Sets race detector to on by default.
- Sets race detector to on by default (except Mac OS)
- Optionally sets the interpreter path to ld.
Args:
@ -23,7 +23,16 @@ def go_test(ld = None, count = 3, **kwargs):
kwargs["args"].append("--test.count={}".format(count))
# enable race detector by default
kwargs.setdefault("race", "on")
race_value = select({
"@platforms//os:macos": "off",
"//conditions:default": "on",
})
pure_value = select({
"@platforms//os:macos": "on",
"//conditions:default": "off",
})
kwargs.setdefault("race", race_value)
kwargs.setdefault("pure", pure_value)
# set gc_linkopts to set the interpreter path to ld.
kwargs.setdefault("gc_linkopts", [])