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

Check for duplicate files on Build #2751

Closed
wants to merge 2 commits into from
Closed

Conversation

emcfarlane
Copy link
Contributor

Build on a ModuleSetBuilder will now fail with a duplicate error if a module contains the same file path for a proto file as another module. A new error type DuplicatePathError will be returned.

Build on a ModuleSetBuilder will now fail with a duplicate error if a
module contains the same file path for a proto file as another module.
A new error type DuplicatePathError will be returned.
// Validate all proto files are unique.
filePathToModule := make(map[string]Module, len(modules))
for _, module := range modules {
if err := module.WalkFileInfos(ctx, func(fileInfo FileInfo) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to force a load of the ModuleData for this Module, which we don't want to do.

I'm forgetting now, which layer did we do this in the past? It must have been close to Image construction time.

@emcfarlane
Copy link
Contributor Author

Closing, moving to BSR layer.

@emcfarlane emcfarlane closed this Feb 5, 2024
@emcfarlane emcfarlane deleted the ed/duplicateFiles branch February 5, 2024 16:02
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.

2 participants