I managed to come back around to take a look at getting swift-package-manager working on Windows. It seems that some things have gotten better and some things are moving in a direction of being easier to work with.
One of challenges to porting s-p-m to Windows that still remains frustrating is the path representation. swift-tools-support-core has a set of types that work with the file system representation and try to perform operations on them. The problem is that there is a ton of logic which has been baked into a particular representation.
Paths on Windows are far more complicated. As an example, the following set (probably although not definitively without being able to look at the particular hard disk and computer) refer to the same file:
And there are probably other representations as well (I can think of a couple more). Each of these behave slightly differently and have different limitations.
Currently, given the previous attempts I continued down the path of trying to replace a function at a time, but this is getting really frustrating to find and alter. Eventually, we will end up with multiple paths for different representations. More so than that, these paths are conditionally compiled. This means that changing one side could break another. Addition of new interfaces would break other targets. Although some of that is possible to catch with CI, iteration becomes a problem. Not only do you need specific tests for each of the targets, you also need to have multiple builds to ensure that everything is tested in all the combinations. This becomes increasingly more difficult and makes it a problem to support. Additionally using all the platform dependent APIs makes it harder to change things for a platform that you may not be as familiar with.
There is however a universally accepted encoding of these paths - URLs. The idea being that you can represent the path as a URL consistently and then convert to the file system representation before calling into the system. This would mean that we could have a uniform implementation and representation that works across all platforms.
I would like to suggest that we keep the interfaces as is but switch the implementation to use URLs and then convert to the file system representation when making calls to the system. This really would simplify the code base and make it easier to port.