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

incompatible_do_not_emit_buggy_external_repo_import: Do not emit imports containing external and repo names. #8711

Closed
hlopko opened this issue Jun 25, 2019 · 0 comments

Comments

@hlopko
Copy link
Contributor

@hlopko hlopko commented Jun 25, 2019

Added in: 0.28
Will be flipped in: 1.0

Motivation

Because of #8030 the only way to import protos that use import_prefix and that crossed the external repo boundary was to use ugly paths like <import_prefix>/external/<repo_name>/<proto_path>.

This was fixed, and the import path is now what is expected: <import_prefix>/<proto_path>. This incompatible flag is to keep existing workarounds working and allow users to migrate away from the bug.

Migration

Replace:

`<import_prefix>/external/<repo_name>/<proto_path>`

with:

`<import_prefix>/<proto_path>`
@hlopko hlopko self-assigned this Jun 25, 2019
bazel-io pushed a commit that referenced this issue Jun 28, 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 #8030.

Incompatible change: #8711.

Closes #8683.

PiperOrigin-RevId: 255606742
siberex added 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 added 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
@bazel-io bazel-io closed this in 25bc4ab Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.