Closed jkurland-roku closed 1 week ago
Could you add a test usage of these new attributes to https://github.com/bazel-contrib/toolchains_llvm/blob/master/tests/MODULE.bazel? You could add synthetic constraint_setting
s with default values so that the default platform matches them. I would just like to get some coverage of the new Starlark code.
I've added a test, the only issue I think is that it causes another llvm toolchain to be downloaded and extracted (or just extracted if there's a repository cache), so up to you if you think it's worth the extra CI time.
@jkurland-roku I fixed the reference to the host platform, but tests are still failing
Looks like the ubuntu failures are when bzlmod is disabled which makes sense and I'll look to fix that. The macos failures might be to do with the cxxflags, maybe there's another mechanism to detect which toolchain was selected
I think those changes should fix both issues (although not sure about macos, I don't really know anything about macos). I've tested with bzlmod disabled so at least that should work
So I think the issue is that on the platforms which only support up to llvm 13.0.0 the c++20 toolchain fails to build. So I'm thinking that maybe I get rid of the current c++20 check and instead make a new platform for zlib supporting linker (a better name would be helpful) and then switch to llvm 13 automatically based on that. So replacing the "extra_toolchain" arg in the CI with "--host_platform=@//:archlinux_docker" for example.
What do you think?
That's one approach. You could also try to disable the test for these platforms. Generic starlark changes that work on two common platforms are very unlikely to break on untested platforms.
I've made this test manual and now only run it when the toolchain isn't overriden
Thanks for carrying this through!
No worries, thanks for the help
An implementation of the fix suggested in https://github.com/bazel-contrib/toolchains_llvm/issues/361 to allow users to specify additional platform constraints for each toolchain.
My personal use case was building some targets with musl and the toolchains here were interferring.