kylef/PathKit

Unable to build with Xcode 13 GM

jsorge opened this issue · 10 comments

When I build the package for release (using swift build -c release) I get the following errors:

/Users/ci/Downloads/PathKit-master/Sources/PathKit.swift:594:12: error: value of optional type 'UnsafeMutablePointer<CChar>?' (aka 'Optional<UnsafeMutablePointer<Int8>>') must be unwrapped to a value of type 'UnsafeMutablePointer<CChar>' (aka 'UnsafeMutablePointer<Int8>')
      free(cPattern)
           ^
/Users/ci/Downloads/PathKit-master/Sources/PathKit.swift:594:12: note: coalesce using '??' to provide a default when the optional value contains 'nil'
      free(cPattern)
           ^
                    ?? <#default value#>
/Users/ci/Downloads/PathKit-master/Sources/PathKit.swift:594:12: note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
      free(cPattern)
           ^
                   !
/Users/ci/Downloads/PathKit-master/Sources/PathKit.swift:625:12: error: value of optional type 'UnsafeMutablePointer<CChar>?' (aka 'Optional<UnsafeMutablePointer<Int8>>') must be unwrapped to a value of type 'UnsafeMutablePointer<CChar>' (aka 'UnsafeMutablePointer<Int8>')
      free(cPattern)
           ^
/Users/ci/Downloads/PathKit-master/Sources/PathKit.swift:625:12: note: coalesce using '??' to provide a default when the optional value contains 'nil'
      free(cPattern)
           ^
                    ?? <#default value#>
/Users/ci/Downloads/PathKit-master/Sources/PathKit.swift:625:12: note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
      free(cPattern)
           ^
                   !
/Users/ci/Downloads/PathKit-master/Sources/PathKit.swift:626:12: error: value of optional type 'UnsafeMutablePointer<CChar>?' (aka 'Optional<UnsafeMutablePointer<Int8>>') must be unwrapped to a value of type 'UnsafeMutablePointer<CChar>' (aka 'UnsafeMutablePointer<Int8>')
      free(cPath)
           ^
/Users/ci/Downloads/PathKit-master/Sources/PathKit.swift:626:12: note: coalesce using '??' to provide a default when the optional value contains 'nil'
      free(cPath)
           ^
                 ?? <#default value#>
/Users/ci/Downloads/PathKit-master/Sources/PathKit.swift:626:12: note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
      free(cPath)
           ^
                !

Is this a straightforward patch that can be applied?

looks like #78 fixes this

ds8k commented

Running into this same error with UnsafeMutablePointer

Screen Shot 2021-09-21 at 5 19 17 PM

Running into this same error with UnsafeMutablePointer

Screen Shot 2021-09-21 at 5 19 17 PM

Have same issue when trying to build

Hi @kylef is this fix sufficient for the release?
#80

Oh sorry, didn't see the comment about releasing today. #80 (comment)
Thanks a lot!

Hi,
I'm still getting a compilation error with version 1.0.1

~/Library/Developer/Xcode/DerivedData/ios-ci-helpers-dorskpgcnqncbihcmayjbhhgveqs/SourcePackages/checkouts/XcodeProj/Sources/XcodeProj/Extensions/Path+Extras.swift:30:18: Value of optional type 'UnsafeMutablePointer<CChar>?' (aka 'Optional<UnsafeMutablePointer<Int8>>') must be unwrapped to a value of type 'UnsafeMutablePointer<CChar>' (aka 'UnsafeMutablePointer<Int8>')
Anyone else?

kylef commented

SourcePackages/checkouts/XcodeProj/Sources/XcodeProj/Extensions/Path+Extras.swift

This source file is not from PathKit

kylef commented

This has been resolved in 1.0.1 thanks to everyone who helped out here with propsed changes and investigations!

Opps 😬, apologies, I'm really sorry.