You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our repository all protos live in a special directory within the monorepo. For historical reasons they reference each other relative to the directory, not the repository root. We are trying to speed up gazelle by using --index=false but it seems to break the proto_strip_import_prefix directive rewriting of the imports during language/proto/resolve.go:resolveProto()
In essence, --index=false + strip_import_prefix results in dropping the //prefix in deps that was there with indexing on
The strip_import_prefix attribute is generated in both situations, so the root BUILD.bazel file was read with or without indexing. The deps attribute should be the same in both cases.
The text was updated successfully, but these errors were encountered:
The following work in progress PR (please ignore changes to resolve.go) nchepanov#1 contains a fully functional test that fails as expected, showcasing the unsupported edge-case.
For now, I don't have more time to dig more into this, I ended up solving this in our custom language by using CrossResolve that was introduced in #771 to support a very similar use-case: full indexing is too slow.
For reference, a super simple CrossResolve impelmentation ended up looking like this
nchepanov
changed the title
Incorrect proto_library deps generated with strip_import_prefix when --index=false
Incorrect proto_library deps generated with strip_import_prefix when --index=false and mode=fileSep 25, 2024
nchepanov
changed the title
Incorrect proto_library deps generated with strip_import_prefix when --index=false and mode=file
Incorrect proto_librarydeps when strip_import_prefix, --index=false and mode=fileSep 25, 2024
What version of gazelle are you using?
Latest,
v.0.39.0
What version of rules_go are you using? / What version of Bazel are you using? / Does this issue reproduce with the latest releases of all the above?
N.A.
What operating system and processor architecture are you using?
Darwin nchepanov-mac 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000 arm64
MacOS 14.6.1What did you do?
Reproducer https://github.com/nchepanov/gazelle-strip-import-prefix-index-off/
In our repository all protos live in a special directory within the monorepo. For historical reasons they reference each other relative to the directory, not the repository root. We are trying to speed up gazelle by using
--index=false
but it seems to break theproto_strip_import_prefix
directive rewriting of the imports duringlanguage/proto/resolve.go:resolveProto()
In essence,
--index=false
+strip_import_prefix
results in dropping the//prefix
indeps
that was there with indexing onWhat did you expect to see?
The
strip_import_prefix
attribute is generated in both situations, so the root BUILD.bazel file was read with or without indexing. The deps attribute should be the same in both cases.The text was updated successfully, but these errors were encountered: