Fix coverage with MacOS autoconf toolchains#720
Conversation
3911f5d to
e856912
Compare
| if darwin: | ||
| overridden_tools["gcc"] = "cc_wrapper.sh" | ||
| overridden_tools["ar"] = _find_generic(repository_ctx, "libtool", "LIBTOOL", overridden_tools) | ||
| xcrun = repository_ctx.which("xcrun") |
There was a problem hiding this comment.
@keith curious if this is the recommended way to do this. I'd love to avoid invoking xcrun but this toolchain is already unique to the host so feels like it's aligned with the spirit of the toolchain.
There was a problem hiding this comment.
the hermetic way to do it would be to make the tools shell scripts that run xcrun llvm-cov and then put the xcode env vars / execution_info on the actions, then the absolute path to xcode would be entirely separated.
as is i think this would make the toolchain sensitive to that path which probably isn't desirable?
There was a problem hiding this comment.
Yeah, definitely not desirable and I can make shell scripts. What do you mean "xcode env vars / execution info" does that currently exist (is that a fragment already)?
There was a problem hiding this comment.
this stuff https://github.com/bazelbuild/apple_support/blob/a909b7bb32e43765aff58a52f7cdcff6c67b4faa/crosstool/cc_toolchain_config.bzl#L813-L816 https://github.com/bazelbuild/apple_support/blob/a909b7bb32e43765aff58a52f7cdcff6c67b4faa/crosstool/cc_toolchain_config.bzl#L107
in this toolchain we're mostly not handling these details and recommending folks use the apple_support toolchain instead
This change updates the autoconf toolchains for MacOS to search for
llvm-profdatawhich is required to produce coverage. Toolchains which enable llvm code coverage but do not providellvm-profdatawill now see an explicit message explaining the configuration error.relates to #613