bazel-contrib / bazel-contrib/rules_foreign_cc

`cmake_variant` preinstalled make toolchain broken on 0.10.1

Open
#1,154 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
737
Forks
270
PR merge metrics
No merged PRs in 30d

Description

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!

Contributor guide

Open the contributing guide

Research direction

Start with toolchains/BUILD.bazel at the pkgconfig_tool_default target and foreign_cc/built_tools/pkgconfig_build.bzl at the failing _pkgconfig_tool_impl line. Reproduce the failure with bazelisk build @mimalloc//:mimalloc_variant using the linked workspace and the preinstalled_make_toolchain. Done means the reproduction builds with cmake_variant on Linux and macOS without the NoneType error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.