rules_scala
rules_scala copied to clipboard
`scala_proto_library` should respect `strip_import_prefix`
Proto targets compiled with stripped prefixes are empty srcjars.
Minimal build file
proto_library(
name = "example_proto",
srcs = ["example.proto"],
strip_import_prefix = "/prefix",
)
scala_proto_library(
name = "example_scala_proto",
deps = [":example_proto"],
)
Source proto:
# /prefix/example.proto
syntax = "proto3";
package foo
message Foo {}
Output:
$ bazel build prefix:example_scala_proto Sunday August 11 10:32:28 AM
INFO: Analyzed target //prefix:example_scala_proto (1 packages loaded, 3 targets configured).
INFO: Found 1 target...
INFO: From ScalaProtoCompile prefix/tmp/example_scala_proto:
protoc-jar: protoc version: 3.8.0, detected platform: osx-x86_64 (mac os x/x86_64)
protoc-jar: embedded: bin/3.8.0/protoc-3.8.0-osx-x86_64.exe
protoc-jar: executing: [/var/folders/t9/2yf73c553136pl7hzsrk8msm0000gn/T/protocjar10477993719091343746/bin/protoc.exe, --plugin=protoc-gen-scala=/var/folders/t9/2yf73c553136pl7hzsrk8msm0000gn/T/protocbridge3494382799574754229, --scala_out=bazel-out/darwin-fastbuild/bin/prefix/tmp/example_scala_proto, bazel-out/darwin-fastbuild/bin/prefix/_virtual_imports/example_proto/example.proto]
bazel-out/darwin-fastbuild/bin/prefix/_virtual_imports/example_proto/example.proto:3:1: Expected ";".
Target //prefix:example_scala_proto up-to-date:
bazel-bin/prefix/example_scala_proto.srcjar
INFO: Elapsed time: 0.264s, Critical Path: 0.13s
INFO: 2 processes: 1 darwin-sandbox, 1 worker.
INFO: Build completed successfully, 4 total actions
The generated file (bazel-bin/prefix/example_scala_proto.srcjar
) is empty.
Hey @kerinin, thanks for filing this issue.
I'd like to reproduce it on my machine. Which higherkindness/rules_scala
commit are you currently using?
Once we repro and fix adding a test for this would be awesome. Our proto test coverage at the moment is not great.
Sorry for the delay - that was using a0812a27e2367dce65dc6f40ccaa12e76282d1e6