Skip to content

[wasm] Fix CocoaError construction for unsupported copy/link operations #944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

kateinoigakukun
Copy link
Member

@kateinoigakukun kateinoigakukun commented Sep 25, 2024

This is a follow-up fix for 6c0a3e8, which re-organized CocoaError helper functions, to repair the following build failure:

/home/build-user/swift-foundation/Sources/FoundationEssentials/FileManager/FileOperations.swift:926:36: error: 'fileOperationError' is inaccessible due to 'private' protection level
  74 |     }
  75 | #else
  76 |     private static func fileOperationError(_ errNum: Int32, _ suspectedErroneousPath: String, sourcePath: String? = nil, destinationPath: String? = nil, variant: String? = nil) -> CocoaError {
     |                         `- note: 'fileOperationError(_:_:sourcePath:destinationPath:variant:)' declared here
  77 |         // Try to be a little bit more intelligent about which path should be reported in the error. In the case of ENAMETOOLONG, we can more accurately guess which path is causing the error without racily checking the file system after the fact. This may not be perfect in the face of operations which span file systems, or on file systems that only support names/paths less than NAME_MAX or PATH_MAX, but it's better than nothing.
  78 |         var erroneousPath = suspectedErroneousPath
     :
 924 |             // wasi-libc does not support FTS for now, so we don't support copying/linking
 925 |             // directories on WASI for now.
 926 |             let error = CocoaError.fileOperationError(.featureUnsupported, src, dst)
     |                                    `- error: 'fileOperationError' is inaccessible due to 'private' protection level
 927 |             try delegate.throwIfNecessary(error, src, dst)
 928 |             return

This is a follow-up fix for 6c0a3e8,
which re-organized CocoaError helper functions.
@kateinoigakukun
Copy link
Member Author

@swift-ci test

@jmschonfeld
Copy link
Contributor

@swift-ci please test

@kateinoigakukun
Copy link
Member Author

I'll merge this once I verified the change in our CI swiftwasm/swiftwasm-build#440

@kateinoigakukun kateinoigakukun merged commit 4784ffb into swiftlang:main Sep 25, 2024
3 checks passed
cthielen pushed a commit to cthielen/swift-foundation that referenced this pull request Nov 8, 2024
…ns (swiftlang#944)

This is a follow-up fix for 6c0a3e8,
which re-organized CocoaError helper functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants