Skip to content

Duplicate proto filenames fail build even with fileNaming=PathToUnderscoresΒ #1761

@jeffbadorek

Description

@jeffbadorek

When using PathToUnderscores, we are now getting an error that the generated file does not exist. However, the path to the non-existant file is the full path version (e.g. some/path/to/my.pb.swift). I believe the issue is in plugin.swift where the proto input file is mapped to an output file

            let protobufOutputPath = outputDirectory.appending(file)

            // Add the outputPath as an output file
            outputFiles.append(protobufOutputPath)

That sets up a dependency from some/path/to/my.proto to some/path/to/my.pb.swift but the latter doesn't exist since the generator actually generated some_path_to_my.pb.swift.

  • MacOS 15.3
  • Xcode 16.2
  • Swift 6.0
  • SwiftProtobuf 1.29.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions