-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
proto_library's import_prefix does not work across repository boundaries #8030
Labels
P2
We'll consider working on this in future. (Assignee optional)
team-Rules-Server
Issues for serverside rules included with Bazel
type: bug
Comments
aiuto
added
team-Rules-Server
Issues for serverside rules included with Bazel
and removed
team-Bazel
General Bazel product/strategy issues
labels
Jun 12, 2019
My bad on the mis-categorization |
Hi Robin, could you pls check that #8683 fixes your problem? |
hlopko
added
P2
We'll consider working on this in future. (Assignee optional)
type: bug
and removed
untriaged
labels
Jun 21, 2019
siberex
pushed a commit
to siberex/bazel
that referenced
this issue
Jul 4, 2019
Before this PR, when strip_import_prefix was not specified, and the proto target was declared in an external repository, Bazel generated import path that leaked `external/<repository_name>` path fragment. That path fragment is an implementation detail of Bazel's execroot layout and should not be used in proto source files. This PR adds a correct path fragment to the import paths. It also introduces an incompatible flag `--incompatible_do_not_emit_buggy_external_repo_import` that removes the incorrect import path from Bazel. Fixes bazelbuild#8030. Incompatible change: bazelbuild#8711. Closes bazelbuild#8683. PiperOrigin-RevId: 255606742
irengrig
pushed a commit
to irengrig/bazel
that referenced
this issue
Jul 15, 2019
Before this PR, when strip_import_prefix was not specified, and the proto target was declared in an external repository, Bazel generated import path that leaked `external/<repository_name>` path fragment. That path fragment is an implementation detail of Bazel's execroot layout and should not be used in proto source files. This PR adds a correct path fragment to the import paths. It also introduces an incompatible flag `--incompatible_do_not_emit_buggy_external_repo_import` that removes the incorrect import path from Bazel. Fixes bazelbuild#8030. Incompatible change: bazelbuild#8711. Closes bazelbuild#8683. PiperOrigin-RevId: 255606742
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
P2
We'll consider working on this in future. (Assignee optional)
team-Rules-Server
Issues for serverside rules included with Bazel
type: bug
Description of the problem / feature request:
import_prefix
does not set the prefix correctly when theproto_library
target lives in an external dependency.Feature requests: what underlying problem are you trying to solve with this feature?
The
import_prefix
should work across repo boundaries.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
(Skip to
Repro case
below for a zip containing a testable example of the reported behaviour)Create a
proto_library
withimport_prefix
and reference it from a different workspace. If the depended-on repository has namedependency_a
and the depended-onproto_library
target usesimport_prefix = "prefix_a"
, the expected import path is in a .proto file is:but the actual path is:
Repro case
Please download this repro.zip, which illustrates this behaviour using a
local_repository
.Build the repro target:
bazel build :test_proto
The file
test.proto
contains both the expected, non-functional import path, and the actual import path.What operating system are you running Bazel on?
macOS 10.14
What's the output of
bazel info release
?Tested on both 0.22 and 0.24.1
Have you found anything relevant by searching the web?
Related error:
proto_source_root
not working across multiple workspaces #4665The text was updated successfully, but these errors were encountered: