saagarjha / unxip

A fast Xcode unarchiver
GNU Lesser General Public License v3.0
867 stars 39 forks source link

Compilation error. #11

Closed alok-dks closed 2 years ago

alok-dks commented 2 years ago

Hi @saagarjha Can you please update the installation instruction please.

With current installation instructions. I am gettting compilation errors.

unxip-main dks0580224$ swiftc -parse-as-library -O unxip.swift
unxip.swift:16:11: error: cannot find type 'AsyncStream' in scope
extension AsyncStream.Continuation {
          ^~~~~~~~~~~
unxip.swift:25:37: error: cannot find type 'Sendable' in scope
struct ConcurrentStream<TaskResult: Sendable> {
                                    ^~~~~~~~
unxip.swift:29:15: error: cannot find type 'AsyncStream' in scope
        var results: AsyncStream<TaskResult> {
                     ^~~~~~~~~~~
unxip.swift:72:89: error: cannot find type 'Task' in scope
        mutating func addRunningTask(operation: @escaping @Sendable () async -> TaskResult) -> Task<TaskResult, Never> {
                                                                                               ^~~~
unxip.swift:83:20: error: cannot find type 'Sendable' in scope
final class Chunk: Sendable {
                   ^~~~~~~~
unxip.swift:341:80: error: cannot find type 'AsyncStream' in scope
        static func files<ChunkStream: AsyncSequence>(in chunkStream: ChunkStream) -> AsyncStream<File> where ChunkStream.Element == Chunk {
                                                                                      ^~~~~~~~~~~
unxip.swift:341:33: error: cannot find type 'AsyncSequence' in scope
        static func files<ChunkStream: AsyncSequence>(in chunkStream: ChunkStream) -> AsyncStream<File> where ChunkStream.Element == Chunk {
                                       ^~~~~~~~~~~~~
unxip.swift:341:116: error: 'Element' is not a member type of type 'ChunkStream'
        static func files<ChunkStream: AsyncSequence>(in chunkStream: ChunkStream) -> AsyncStream<File> where ChunkStream.Element == Chunk {
                                                                                                              ~~~~~~~~~~~ ^
unxip.swift:73:14: error: cannot find 'Task' in scope
                let task = Task {
                           ^~~~
unxip.swift:128:9: error: cannot find 'Task' in scope
                                try Task.checkCancellation()
                                    ^~~~
unxip.swift:145:3: error: missing protocol 'AsyncSequence'
                for await chunk in compressionStream.results {
                ^
unxip.swift:407:46: error: cannot find 'Task' in scope
                var hardlinks = [File.Identifier: (String, Task<Void, Never>)]()
                                                           ^~~~
unxip.swift:408:33: error: cannot find 'Task' in scope
                var directories = [Substring: Task<Void, Never>]()
                                              ^~~~
unxip.swift:409:3: error: missing protocol 'AsyncSequence'
                for await file in files(in: chunks(from: content).results) {
                ^
unxip.swift:515:3: error: missing protocol 'AsyncSequence'
                for await _ in taskStream.results {
                ^
unxip.swift:423:43: error: cannot find type 'Task' in scope
                        func parentDirectoryTask(for: File) -> Task<Void, Never>? {
                                                               ^~~~
unxip.swift:547:21: error: '_Concurrency' module not imported, required for async main
        static func main() async throws {
                           ^
saagarjha commented 2 years ago

I think the version of Swift you're using is too old. unxip requires Swift 5.6 (specifically, Concurrency support). If you're on a recent version of macOS, I would recommend installing the command line tools and using its Swift to boostrap unxip, then downloading a recent version of Xcode.

saagarjha commented 2 years ago

Closing this; do let me know if you still have difficulty after following my suggestion.