Toolchain not detected in rules_foreign_cc
When using the local toolchain, everything builds fine. When using the hermetic tool chain from this repo, some build systems fail to use the compiler for a simple test program.
Reproduction example in https://github.com/bazel-contrib/rules_foreign_cc/pull/1295.
The linked thread has lots of useful information on how to get ffmpeg to build, thanks for linking it.
I'll close this issue since the problems are due to ffmpeg using an opinionated configure script rather than any issue we could fix in toolchains_llvm.
There are things which should be fixed on the toolchain side. For example the $AR and $STRIP environment variable are not populated.
Without them, one has to do hacky stuff like the following for meson builds like libdav1d:
env = {
"AR": "$$EXT_BUILD_ROOT/external/toolchains_llvm~~llvm~llvm_toolchain/bin/llvm-ar",
"STRIP": "$$EXT_BUILD_ROOT/external/toolchains_llvm~~llvm~llvm_toolchain/bin/llvm-strip",
}
or
env = {
"AR": "$$EXT_BUILD_ROOT/$$(dirname $(LD))/llvm-ar",
"STRIP": "$$EXT_BUILD_ROOT/$$(dirname $(LD))/llvm-strip",
}
@fmeum could you please reopen? Thanks!
That's a good point. Are we not adding them to the tools dict or does rules_foreign_cc not read them from there? Either should be easy to fix.
That's a good point. Are we not adding them to the tools dict or does rules_foreign_cc not read them from there? Either should be easy to fix.
It's on my list to debug this further.