Mystery of XCode and a user provided modules.modulesmap for using C libs

Hi, I was running into some problesm which took now way too much time for me without finding an solution (or even explanation), so I need to reach out for help.

Disclaimer: I come from C++ development, new to the XCode + Swift infrastructure is pretty new.

I have an existing Swift XCode project that consumes some C libraries.

It had no modulemap file, so one was autogenerated for the umbrella header ProjectName.h

I need to rename ProjectName.h since it clashes now with a header in the dependencies, and therefore, I need to provide a custom modules map.

So I added my modulesmap next the the header file which I renamed into ProjectNameUmbrella.h

framework module ProjectName {
  umbrella header "ProjectNameUmbrella.h"
  export *
  module * { export * }
}

Now XCode does not find ProjectNameUmbrella.h and the project does not build

If I write the modulemap as a module, and not a framework, like this

module ProjectName {
  umbrella header "ProjectNameUmbrella.h"
  export *
  module * { export * }
}

The header is found and everything works.

Since we build / generate a XCFramework, for binary consumption in Swift packages, I need the framework module ProjectName and have to patch it. This feels dirty.

Another 'interesting feature' is that XCode 'remembers' the location of the developer header from the Swift package that is consuming the xcframework, which I consume for development locally.

       .binaryTarget(
            name: "ProjectName",
            path: "../project-name/build/ProjectName.xcframework.zip
        ),

If there is some problem in the header, the error (or warning) gives me the absolute path to ../project-name/Source/Folder/ProjectNameUmbrella.h

If I rename the ../project-name folder so it is not found, I get the message as expected, listing .build/artifacts/extract/..../ProjectNameUmbrella.h

That feels super wrong. What settings in XCode could I have wrong that I have this behavior?

Can I not have a modulemap with framework module ProjectName and private info, like absolute paths to the source, should not be leaked?