Skip to content
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

Build of fresh project fails, Swift 5.4 and 5.5.1 #78

Closed
ShonFrazier opened this issue Jan 12, 2022 · 4 comments
Closed

Build of fresh project fails, Swift 5.4 and 5.5.1 #78

ShonFrazier opened this issue Jan 12, 2022 · 4 comments

Comments

@ShonFrazier
Copy link

ShonFrazier commented Jan 12, 2022

Snipped output here, full log attached below:

[I] me@host:~/
➤ alchemy new myproj
🧪 Cloning quickstart
🧪 Which template would you like to use?
0: Server: server only.
1: Fullstack iOS: a single project with Backend, iOS, & Shared targets.
> 0
🧪 Created project at 'myproj'
[I] me@host:~/
➤ cd myproj/
[I] me@host:~/myproj|HEAD⚡?
➤ swiftenv local 5.4
[I] me@host:~/myproj|HEAD⚡?
➤ swift build

Fetching https://github.com/alchemy-swift/alchemy from cache
[...snip fetching, cloning, updating...]
Resolving https://github.com/swift-server/swift-backtrace.git at 1.3.1
[1/904] Compiling _NIODataStructures Heap.swift
[2/904] Compiling _NIODataStructures PriorityQueue.swift
[3/905] Merging module _NIODataStructures
[4/927] Compiling SwiftCLI ArgumentList.swift
myproj/.build/checkouts/SwiftCLI/Sources/SwiftCLI/Task.swift:55:26: warning: 'launchPath' is deprecated: renamed to 'executableURL'
            self.process.launchPath = executable
                         ^

[...snip more warnings and 'compiling' messages...]

myproj/.build/checkouts/alchemy/Sources/Alchemy/Alchemy+Papyrus/Endpoint+Request.swift:52:33: error: cannot find 'parameters' in scope
                parameters: try parameters(dto: dto),
                                ^~~~~~~~~~
myproj/.build/checkouts/alchemy/Sources/Alchemy/Alchemy+Papyrus/Endpoint+Request.swift:78:33: error: cannot find 'parameters' in scope
                parameters: try parameters(dto: .value),
                                ^~~~~~~~~~
myproj/.build/checkouts/alchemy/Sources/Alchemy/Alchemy+Papyrus/Endpoint+Request.swift:111:27: error: value of type 'HTTPComponents' has no member 'bodyEncoding'
            if parameters.bodyEncoding == .json {
               ~~~~~~~~~~ ^~~~~~~~~~~~
myproj/.build/checkouts/alchemy/Sources/Alchemy/Alchemy+Papyrus/Endpoint+Request.swift:114:34: error: value of type 'HTTPComponents' has no member 'bodyEncoding'
            } else if parameters.bodyEncoding == .urlEncoded,
                      ~~~~~~~~~~ ^~~~~~~~~~~~
myproj/.build/checkouts/alchemy/Sources/Alchemy/Alchemy+Papyrus/Router+Endpoint.swift:62:11: error: cannot find type 'PapyrusValidationError' in scope
extension PapyrusValidationError: ResponseConvertible {
          ^~~~~~~~~~~~~~~~~~~~~~
myproj/.build/checkouts/alchemy/Sources/Alchemy/Alchemy+Papyrus/Router+Endpoint.swift:120:41: error: cannot find type 'BodyEncoding' in scope
    public func decodeBody<T>(encoding: BodyEncoding = .json) throws -> T where T: Decodable {
                                        ^~~~~~~~~~~~
myproj/.build/checkouts/alchemy/Sources/Alchemy/Alchemy+Papyrus/Router+Endpoint.swift:70:17: error: instance method 'header(for:)' has different argument labels from those required by protocol 'DecodableRequest' ('header')
    public func header(for key: String) -> String? {
                ^      ~~~

[...snip many more errors...]

Full build log here:
alchemy-build.log

@ShonFrazier
Copy link
Author

Platform: Ubuntu 20.04.3

Apologies for leaving out this detail

@joshuawright11
Copy link
Member

joshuawright11 commented Jan 12, 2022

Hey @ShonFrazier, thanks for reaching out & checking out the project. I forgot a .upToNextMinor(...) in the package file. I've updated it now so it should work.

FYI development is now being done in the async branch; it's fully async/await and has been ready for a couple months but I'm waiting to merge it until test discovery is available for swift on Linux.

While the docs aren't fully up to date there, if you're interested in async/await APIs, you might consider giving that branch a try. It should be merged into main soon.

@ShonFrazier
Copy link
Author

Thanks, @joshuawright11, for the timely reply. That change fixed my problem.

Looks like Linux test discovery came with 5.4:

Automatic test discovery is now the default on all platforms, removing the need in LinuxMain.swift (which has been deprecated)

from: https://www.swift.org/blog/swift-5-4-released/

@joshuawright11
Copy link
Member

Ah, I meant async/await test discovery on Linux. Though it looks like 5.5.2 fixes that!

Still some crashes in expectation on Linux, but was able to refactor tests to avoid those.

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

No branches or pull requests

2 participants