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

bazel_version rule conflicting with bazelbuild/rules_rust #44

Open
tiziano88 opened this issue Nov 7, 2019 · 2 comments
Open

bazel_version rule conflicting with bazelbuild/rules_rust #44

tiziano88 opened this issue Nov 7, 2019 · 2 comments

Comments

@tiziano88
Copy link
Member

asylo definition of bazel_version:

# Required by gRPC
if not native.existing_rule("bazel_version"):
_bazel_version_repository = repository_rule(
implementation = _bazel_version_repository_impl,
local = True,
)
_bazel_version_repository(name = "bazel_version")

rules_rust definition of bazel_version:
https://github.com/bazelbuild/rules_rust/blob/fe9a91e8b42f731aeb3b596246f6bf4bb9a88dc3/workspace.bzl

This fails compilation with an error similar to:

ERROR: error loading package 'rust/oak_runtime': in /usr/local/google/home/tzn/.cache/bazel/_bazel_tzn/0afd379f1411abdcf552c905c7b0282a/external/io_bazel_rules_rust/rust/rust.bzl: in /usr/local/google/home/tzn/.cache/bazel/_bazel_tzn/0afd379f1411abdcf552c905c7b0282a/external/io_bazel_rules_rust/rust/private/rust.bzl: in /usr/local/google/home/tzn/.cache/bazel/_bazel_tzn/0afd379f1411abdcf552c905c7b0282a/external/io_bazel_rules_rust/rust/private/rustc.bzl: Unable to load file '@bazel_version//:def.bzl': file doesn't exist

since both projects define @bazel_version but with a different internal layout.

Is there a way to disambiguate this in the local WORKSPACE file, or do the two repositories need to agree on a naming convention to avoid the clash?

@tiziano88
Copy link
Member Author

I may have managed to work around this using the very obscure and almost undocumented repo_mapping feature in Bazel: https://docs.bazel.build/versions/master/external.html#shadowing-dependencies

@tiziano88
Copy link
Member Author

Blocks project-oak/oak#313

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