bazel-contrib / bazel-contrib/rules_foreign_cc

pkg-config rules

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

Description

When converting a target from `rules_foreign_cc` to `rules_cc` it was revealed that this dropped integrations with other `rules_foreign_cc` targets (https://github.com/bazelbuild/bazel-central-registry/pull/8393#issuecomment-4250284232). The issue is `ffmpeg` uses [pkg-config](https://linux.die.net/man/1/pkg-config) to locate dependencies but they way this is wired up is relying on an install directory and the original build system producing a `.pc` file with the appropriate info.

My initial thought is that it would be nice to have a `pkg_config_library` rule that wraps `cc_library` and consume the necessary info to fill generate a `.pc` file with all the same sanitizations the other `rules_foreign_cc` rules do to provide seamless inter-op.

But I'm curious what others think and if there are existing solutions.

Contributor guide

Open the contributing guide

Research direction

Begin with the linked BCR pull request comment and the existing rules_foreign_cc/rules_cc integration around ffmpeg. Determine whether an existing pkg-config solution covers the use case; a satisfactory outcome should define the rule's scope and interoperability requirements before implementation, with validation for generated .pc metadata and cross-rule consumption.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.