[swift-build-dev] error: ambiguous use of operator

Gordon Fontenot gordon at fonten.io
Wed Nov 30 09:25:22 CST 2016


Maintainer of Argo here, I finally had time to look at this on my end today.

This appears to be a bug around duplicate filenames that aren't caught when
building the lib via `swift build` because of case differences. In our case,
we had two files named `decode.swift` with different cases in different
sub-directories:

```
❯ g ls-files | grep -i decode.swift
Sources/Argo/Functions/decode.swift
Sources/Argo/Operators/Decode.swift
```

This meant that `swift build` succeeded for us (and for our users), but then
when the consuming code was compiled, it (seemingly) found duplicates of one
of the files in the built binary.

I assume the simplest fix here would be to make sure that we're doing a
case-insensitive compare when checking filenames. However, as a package
maintainer I will say that I find this behavior a _bit_ annoying in general.
I'd _much_ rather see the ability to name files whatever makes the most sense
without needing to ensure that the filenames are unique in the package.

I've uploaded a small lib that exhibits this bug to my GitHub:

https://github.com/gfontenot/SwiftPMCaseBug

 - gordon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <https://lists.swift.org/pipermail/swift-build-dev/attachments/20161130/e1f084ee/attachment.sig>


More information about the swift-build-dev mailing list