$ swift package compute-checksum some.xcframework.zip - returns "error: root manifest not found".

In WWDC 2020 an example was given that you could use a command like the following:

Code Block
$ swift package compute-checksum some.xcframework.zip


and it would return a checksum that you can use in a Swift Package. When I zip my xcframework and run this command from the command line I get:

error: root manifest not found

What am I doing wrong?

I got past that error by cd'ing to the directory containing the Package.swift and then

swift package compute-checksum /path/to/some.xcframework.zip
For anyone else who lands here, you can also avoid cd'ing into the package directory by supplying a --package-path argument:

Code Block
swift package --package-path /path/to/some/package compute-checksum /path/to/some.xcframework.zip

I ran into the same thing, which has now been resolved.
Download xcframework.zip, then move it to the root of a package(any package) and use swift package compute-checksum.
I used johntmcintosh solution, thanks! FYI, the package doesn't actually need to be complete. I get away with creating an empty tmp Package.swift file in my active dir.

note.
when adding Package.swift
swift package compute-checksum xcframework.zip
ec5b67ce3bacefb59e55a2a306179ecf7d53fd69f9d9f9d5d0128ce50d74b43d

without Package.swift
shasum -a 256 xcframework.zip | sed 's/ .*//'
ec5b67ce3bacefb59e55a2a306179ecf7d53fd69f9d9f9d5d0128ce50d74b43d

error: root manifest not found

when you create xcframework.zip file, you should use zip command correctly.

you should execute zip command in the same directory as the xcframework location. if not, your zip file will contain the extra directory level path name info in the result zip file. and this cause the error occur.

$ swift package compute-checksum some.xcframework.zip - returns "error: root manifest not found".
 
 
Q