Closed avdv closed 2 years ago
The cause for this is again that wrapCCWith
et. al. are not composable. All the flags added to the nix-support/*
files of the original wrapper are gone, and we have to replicate all of them into the new wrapper (or source them ?).
In this case, the llvm tools are adding in the -resource-dir
flag so that clang can find its resources, such as the profiling RT libraries: https://github.com/NixOS/nixpkgs/blob/bad39490e9f108654904872d00ccb1a22d75d450/pkgs/development/compilers/llvm/11/default.nix#L45
Describe the bug
After upgrading rules_nixpkgs, the coverage test fails:
https://github.com/tweag/rules_haskell/blob/62a35834bff96e7e9ec0fe8118f02681fc7036be/.github/workflows/workflow.yaml#L58
See https://github.com/tweag/rules_haskell/runs/7231655925?check_suite_focus=true
To Reproduce
on Darwin, run
Expected behavior
This should simply work.
Environment
Additional context
This time it passed the tests with flying colors, but failed the
bazel coverage //...
invocation. See https://app.buildbuddy.io/invocation/e9802e2f-a258-4534-bd76-6bb27193a37a#log:_Originally posted by @avdv in https://github.com/tweag/rules_haskell/issues/1750#issuecomment-1152184953_
Here are some details:
It seems the compiler (clang on Darwin) is invoked with:
(note the
-fprofile-instr-generate
flag)and clang then invokes the linker thusly:
So clang is adding in the
libclang_rt.profile_osx.a
static library since it expects it to be located inside of the "InstallationDir". Whereas the library is actually part of thecompiler-rt-libc
package.