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

fix proto regression #963

Merged
merged 6 commits into from
Jan 29, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,29 @@ MAVEN_SERVER_URLS = [
"https://repo1.maven.org/maven2",
]

# bazel, for testing compiling proto across repo boundaries
bazel_version = "2.0.0"

bazel_sha256 = "6ecac334b1bfa33d4713c8a3d2de1377e69bb165e17125e386ac5c36ddb6cd2b"

http_archive(
name = "io_bazel",
patch_cmds = [
"""find ./ -type f -name BUILD | xargs sed -i.bak -e 's/visibility = \[[^]]*\]/visibility = \["\/\/visibility:public"\]/g'""",
],
sha256 = bazel_sha256,
strip_prefix = "bazel-%s" % bazel_version,
type = "zip",
url = "https://github.com/bazelbuild/bazel/archive/%s.zip" % bazel_version,
)

# this is needed indirectly by @io_bazel
http_archive(
name = "rules_python",
sha256 = "aa96a691d3a8177f3215b14b0edc9641787abaaa30363a080165d06ab65e1161",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.0.1/rules_python-0.0.1.tar.gz",
)

# test adding a scala jar:
jvm_maven_import_external(
name = "com_twitter__scalding_date",
Expand Down
3 changes: 2 additions & 1 deletion scala/private/resources.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def _target_path_by_strip_prefix(resource, resource_strip_prefix):
# Start from absolute resource path and then strip roots so we get to correct short path
# resource.short_path sometimes give weird results ie '../' prefix
path = resource.path
path = _strip_prefix(path, resource.owner.workspace_root + "/")
if resource_strip_prefix != resource.owner.workspace_root:
path = _strip_prefix(path, resource.owner.workspace_root + "/")
path = _strip_prefix(path, resource.root.path + "/")

# proto_library translates strip_import_prefix to proto_source_root which includes root so we have to strip it
Expand Down
13 changes: 13 additions & 0 deletions test/proto_cross_repo_boundary/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
load("@io_bazel_rules_scala//scala_proto:scala_proto.bzl", "scalapb_proto_library")

scalapb_proto_library(
name = "build_event_stream_scala_proto",
visibility = ["//visibility:public"],
deps = ["@io_bazel//src/main/java/com/google/devtools/build/lib/buildeventstream/proto:build_event_stream_proto"],
)

scalapb_proto_library(
name = "build_scala_proto",
visibility = ["//visibility:public"],
deps = ["@io_bazel//src/main/protobuf:build_proto"],
)