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.
Join the diamond when dependencies disagree on naming, as mentioned in https://docs.bazel.build/versions/master/external.html#shadowing-dependencies
Linux
bazel info release?release 0.20.0
There are very few mentions of repo_mapping in general, and none on StackOverflow.
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.
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.