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

already defined errors when files are prefixed with ./ #1471

Closed
Juneezee opened this issue Feb 14, 2025 · 4 comments
Closed

already defined errors when files are prefixed with ./ #1471

Juneezee opened this issue Feb 14, 2025 · 4 comments

Comments

@Juneezee
Copy link
Contributor

Environment details

  • OS: Linux 6.13.2
  • Language runtime version: Go 1.24.0
  • Package version: v1.69.0

Steps to reproduce

  1. go install github.com/googleapis/api-linter/cmd/[email protected]
  2. git clone https://github.com/googleapis/googleapis.git
  3. cd googleapis
  4. api-linter ./google/api/annotations.proto ./google/api/http.proto

Error output:

2025/02/14 14:32:28 google/api/http.proto:29:9: symbol "google.api.Http" already defined at ./google/api/http.proto:29:9
google/api/http.proto:33:21: symbol "google.api.Http.rules" already defined at ./google/api/http.proto:33:21
google/api/http.proto:41:8: symbol "google.api.Http.fully_decode_reserved_expansion" already defined at ./google/api/http.proto:41:8
google/api/http.proto:308:9: symbol "google.api.HttpRule" already defined at ./google/api/http.proto:308:9
google/api/http.proto:313:10: symbol "google.api.HttpRule.selector" already defined at ./google/api/http.proto:313:10
google/api/http.proto:321:12: symbol "google.api.HttpRule.get" already defined at ./google/api/http.proto:321:12
google/api/http.proto:324:12: symbol "google.api.HttpRule.put" already defined at ./google/api/http.proto:324:12
google/api/http.proto:327:12: symbol "google.api.HttpRule.post" already defined at ./google/api/http.proto:327:12
google/api/http.proto:330:12: symbol "google.api.HttpRule.delete" already defined at ./google/api/http.proto:330:12
google/api/http.proto:333:12: symbol "google.api.HttpRule.patch" already defined at ./google/api/http.proto:333:12
google/api/http.proto:339:23: symbol "google.api.HttpRule.custom" already defined at ./google/api/http.proto:339:23
google/api/http.proto:348:10: symbol "google.api.HttpRule.body" already defined at ./google/api/http.proto:348:10
google/api/http.proto:356:10: symbol "google.api.HttpRule.response_body" already defined at ./google/api/http.proto:356:10
google/api/http.proto:361:21: symbol "google.api.HttpRule.additional_bindings" already defined at ./google/api/http.proto:361:21
google/api/http.proto:318:9: symbol "google.api.HttpRule.pattern" already defined at ./google/api/http.proto:318:9
google/api/http.proto:365:9: symbol "google.api.CustomHttpPattern" already defined at ./google/api/http.proto:365:9
google/api/http.proto:367:10: symbol "google.api.CustomHttpPattern.kind" already defined at ./google/api/http.proto:367:10
google/api/http.proto:370:10: symbol "google.api.CustomHttpPattern.path" already defined at ./google/api/http.proto:370:10

After updating api-linter from v1.68.0 to v1.69.0, it started reporting already defined errors when I prefix the files with ./. However, these errors do not occur in v1.68.0.

This regression appears to have been introduced by #1466.

This breaks my existing workflow because I'm using find to find all *.proto files:

$ find . -name '*.proto'
./google/example/library/v1/library.proto                     
./google/privacy/dlp/v2/dlp.proto
./google/privacy/dlp/v2/storage.proto
./google/apps/meet/v2beta/service.proto
./google/apps/meet/v2beta/resource.proto
./google/apps/meet/v2/service.proto
./google/apps/meet/v2/resource.proto
./google/apps/script/type/script_manifest.proto
./google/apps/script/type/extension_point.proto
./google/apps/script/type/sheets/sheets_addon_manifest.proto
./google/apps/script/type/docs/docs_addon_manifest.proto
./google/apps/script/type/drive/drive_addon_manifest.proto
./google/apps/script/type/calendar/calendar_addon_manifest.proto
./google/apps/script/type/slides/slides_addon_manifest.proto
./google/apps/script/type/gmail/gmail_addon_manifest.proto
./google/apps/script/type/addon_widget_set.proto
...

Although this issue can be worked around by using find * -name '*.proto' (https://unix.stackexchange.com/a/537241/376279), the * is expanded by the shell, making its behavior slightly different. The StackExchange answer also discusses the implications of using *.

Screenshots

v1.68.0

v1.68.0

v1.69.0

v1.69.0

@noahdietz
Copy link
Collaborator

You're right, @Juneezee it is a result of that change. I'll get a fix together soon, apologies for the issue! Please use the previous version if possible!

@noahdietz
Copy link
Collaborator

v1.69.1 should fix it! I tested locally as well, but please lmk if you have any other issues.

@Juneezee
Copy link
Contributor Author

@noahdietz Confirmed that v1.69.1 fixed it! Thanks for the swift response

@noahdietz
Copy link
Collaborator

wonderful, thanks for trying out the new version and opening the bug report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants