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

fix: use bundled filename to fix common pb includes #1860

Merged

Conversation

gitjuba
Copy link
Contributor

@gitjuba gitjuba commented Jan 31, 2023

Upgrading from 6.7 to 7.0, we ran into the following issue, using the CLI: If the .proto files given as arguments contain some google/protobuf/*.proto files, as well as import statements importing them in other files, the CLI command terminates with error "duplicate name '..' in Namespace .google.protobuf". Basically it didn't recognize that a common file had already been fetched and parsed. Interestingly this only happened if we used the absolute paths of the .proto files.

We found that enforcing the use of the bundled filename in the fetch function fixes the issue, and this PR does just that. In an older version the bundled filename was used here, but it was dropped in this commit. Note that after that commit, the bundled filename is used only when fetching imports.

This PR does not depend on my previous PR.

@alexander-fenster alexander-fenster changed the title Use bundled filename to fix common pb includes fix: use bundled filename to fix common pb includes Feb 2, 2023
@alexander-fenster alexander-fenster merged commit dce9a2e into protobufjs:master Feb 2, 2023
@github-actions github-actions bot mentioned this pull request Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants