I have been doing server-side development for some years now using server-side Swift, using Xcode as a convenient editing tool. And now that Xcode has support for Swift packages, the situation has generally improved. I'm not targeting any traditional Apple hardware so that might be the source of my problem, but seeing as this problem has only recently started to arise, I'm reporting it in case others are also running into it.
With one of my packages: http://github.com/SyncServerII/ServerDropboxAccount.git I can no longer build it with Xcode.
My intent in this is primarily to edit and get syntax errors out-- i.e., I'm using Xcode as an editor. In some cases with these server-side packages, I can run unit tests in Xcode. In some cases, I have to run the tests on my Ubuntu target platform.
Just in the past few days I can no longer build this specific package in Xcode, nor at the command line on Mac OS.
I get errors like this:
/Users/chris/Desktop/NewSyncServer/ServerDropboxAccount/Sources/ServerDropboxAccount/DropboxCreds+CloudStorage.swift:140:37: Cannot find type 'APICallResult' in scope
/Users/chris/Desktop/NewSyncServer/ServerDropboxAccount/Sources/ServerDropboxAccount/DropboxCreds.swift:16:29: Cannot find type 'AccountAPICall' in scope
/Users/chris/Desktop/NewSyncServer/ServerDropboxAccount/Sources/ServerDropboxAccount/DropboxCreds.swift:16:45: Cannot find type 'Account' in scope
/Users/chris/Desktop/NewSyncServer/ServerDropboxAccount/Sources/ServerDropboxAccount/DropboxCreds+CloudStorage.swift:49:14: Value of type 'DropboxCreds' has no member 'apiCall'
/Users/chris/Desktop/NewSyncServer/ServerDropboxAccount/Sources/ServerDropboxAccount/DropboxCreds+CloudStorage.swift:49:111: Cannot infer contextual base in reference to member 'string'
/Users/chris/Desktop/NewSyncServer/ServerDropboxAccount/Sources/ServerDropboxAccount/DropboxCreds+CloudStorage.swift:49:147: Cannot infer contextual base in reference to member 'json'
/Users/chris/Desktop/NewSyncServer/ServerDropboxAccount/Sources/ServerDropboxAccount/DropboxCreds+CloudStorage.swift:106:14: Value of type 'DropboxCreds' has no member 'apiCall'
/Users/chris/Desktop/NewSyncServer/ServerDropboxAccount/Sources/ServerDropboxAccount/DropboxCreds+CloudStorage.swift:106:133: Cannot infer contextual base in reference to member 'data'
/Users/chris/Desktop/NewSyncServer/ServerDropboxAccount/Sources/ServerDropboxAccount/DropboxCreds+CloudStorage.swift:106:167: Cannot infer contextual base in reference to member 'json'
/Users/chris/Desktop/NewSyncServer/ServerDropboxAccount/Sources/ServerDropboxAccount/DropboxCreds+CloudStorage.swift:106:190: Unable to infer type of a closure parameter 'apiResult' in the current context
/Users/chris/Desktop/NewSyncServer/ServerDropboxAccount/Sources/ServerDropboxAccount/DropboxCreds+CloudStorage.swift:106:201: Unable to infer type of a closure parameter 'statusCode' in the current context
I get the same errors when I use swift build
at the command line on Mac OS. However, when I use swift build
on Ubuntu, I get no errors-- the package builds cleanly.
On Mac OS:
MacBook-Pro-4:ServerDropboxAccount chris$ swift --version
Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
Target: x86_64-apple-darwin19.6.0
On Ubuntu:
root@7b763a0a0a3f:~/Apps/ServerDropboxAccount# swift --version
Swift version 5.3.1 (swift-5.3.1-RELEASE)
Target: x86_64-unknown-linux-gnu
This may be a fringe use case, but before I full-fledged move away from using Xcode for this, I'd like to understand why this is happening. Thoughts are appreciated. Thanks!
I'm including a tag in this question for Kitura
because my server is Kitura-based. And because Kitura has been undergoing some transitions lately in moving away from IBM to being community supported.