Bazel: New http_archive rule doesn't support repo_mapping

Created on 5 Dec 2018  路  2Comments  路  Source: bazelbuild/bazel

Description of the problem / feature request:

prometheus-cpp imports zlib as @net_zlib_zlib
grpc imports zlib as @com_github_madler_zlib

Previously, I could "join the diamond" by doing:

http_archive(
  name = "com_github_jupp0r_prometheus_cpp",
  repo_mapping = {"@net_zlib_zlib": "@com_github_madler_zlib"},

But with the new:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

The repo_mapping arg doesn't exist.

Feature requests: what underlying problem are you trying to solve with this feature?

Join the diamond when dependencies disagree on naming, as mentioned in https://docs.bazel.build/versions/master/external.html#shadowing-dependencies

What operating system are you running Bazel on?

Linux

What's the output of bazel info release?

release 0.20.0

Have you found anything relevant by searching the web?

There are very few mentions of repo_mapping in general, and none on StackOverflow.

area-ExternalDeps team-XProduct

Most helpful comment

It is supposed to be added to each rule automatically, but given these reports it might be working only for natively defined rules (rules written in Java and built into Bazel) and not for rules defined in starlark. I'll take a look today.

All 2 comments

The repo_mapping attribute is also missing from the git_repository rule. I wonder if it needs to be added explicitly to each repository_rule instantiation, or if it can be spliced in automatically.

It is supposed to be added to each rule automatically, but given these reports it might be working only for natively defined rules (rules written in Java and built into Bazel) and not for rules defined in starlark. I'll take a look today.

Was this page helpful?
0 / 5 - 0 ratings