Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake_variant preinstalled make toolchain broken on 0.10.1 #1154

Open
criemen opened this issue Jan 5, 2024 · 2 comments
Open

cmake_variant preinstalled make toolchain broken on 0.10.1 #1154

criemen opened this issue Jan 5, 2024 · 2 comments

Comments

@criemen
Copy link

criemen commented Jan 5, 2024

Hi,

when upgrading from 0.9.0 to 0.10.1, our invocation of cmake_variant with toolchain = "@rules_foreign_cc//toolchains:preinstalled_make_toolchain" is broken on Linux (Ubuntu 20.04) and MacOS.

We're getting

ERROR: /private/var/tmp/_bazel_criemen/1ae7e8b72656956ce63cda3a3c55ef29/external/rules_foreign_cc/toolchains/BUILD.bazel:317:15: in pkgconfig_tool_unix rule @rules_foreign_cc//toolchains:pkgconfig_tool_default:
Traceback (most recent call last):
File "/private/var/tmp/_bazel_criemen/1ae7e8b72656956ce63cda3a3c55ef29/external/rules_foreign_cc/foreign_cc/built_tools/pkgconfig_build.bzl", line 21, column 61, in _pkgconfig_tool_impl
additional_tools = depset(transitive = [make_data.target.files])
Error: 'NoneType' value has no field or method 'files'
ERROR: /private/var/tmp/_bazel_criemen/1ae7e8b72656956ce63cda3a3c55ef29/external/rules_foreign_cc/toolchains/BUILD.bazel:317:15: Analysis of target '@rules_foreign_cc//toolchains:pkgconfig_tool_default' failed
ERROR: Analysis of target '@mimalloc//:mimalloc_variant' failed; build aborted:

A simple reproduction workspace can be found at https://github.com/criemen/bazel-rules-foreig-cc-bug-repro, the bug reproduces with bazelisk build @mimalloc//:mimalloc_variant.

The same code compiles with 0.9.0.

Let me know if I can do anything to help investigating this bug!

@criemen criemen changed the title cmake_variant preinstalled make toolchain broken on 0.10.1/Linux cmake_variant preinstalled make toolchain broken on 0.10.1 Jan 5, 2024
@criemen
Copy link
Author

criemen commented Feb 22, 2024

I bisected this, and the cause is #1104.
Therefore, setting rules_foreign_cc_dependencies(register_built_pkgconfig_toolchain = False) is a workaround for this issue.

@criemen
Copy link
Author

criemen commented Feb 22, 2024

Now, of course that PR didn't introduce the problem, so I bisected again with register_built_pkgconfig_toolchain = True (which was a bit harder as not all variants have that flag), and that points at #987 as the culprit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant