mirror of
https://github.com/apple/container.git
synced 2026-10-14 10:09:10 +00:00
Hash: Make package visibility/remove ifdef (#631)
These build fine on Linux, and I don't honestly know why we had hashMountSource as public API..
This commit is contained in:
1 parent
a864456240
commit
baccf3f44b
2 files changed
+2
-8
No files matched your search
@@ -28,7 +28,6 @@ public struct AttachedFilesystem: Sendable {
|
||||
/// The options to use when mounting the filesystem.
|
||||
public var options: [String]
|
||||
|
||||
#if os(macOS)
|
||||
public init(mount: Mount, allocator: any AddressAllocator<Character>) throws {
|
||||
switch mount.type {
|
||||
case "virtiofs":
|
||||
@@ -44,7 +43,6 @@ public struct AttachedFilesystem: Sendable {
|
||||
self.options = mount.options
|
||||
self.destination = mount.destination
|
||||
}
|
||||
#endif
|
||||
|
||||
public init(type: String, source: String, destination: String, options: [String]) {
|
||||
self.type = type
|
||||
|
||||
@@ -14,13 +14,11 @@
|
||||
// limitations under the License.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if os(macOS)
|
||||
|
||||
import Crypto
|
||||
import ContainerizationError
|
||||
import Crypto
|
||||
import Foundation
|
||||
|
||||
public func hashMountSource(source: String) throws -> String {
|
||||
package func hashMountSource(source: String) throws -> String {
|
||||
// Resolve symlinks so different paths to the same directory get the same hash.
|
||||
let resolvedSource = URL(fileURLWithPath: source).resolvingSymlinksInPath().path
|
||||
guard let data = resolvedSource.data(using: .utf8) else {
|
||||
@@ -28,5 +26,3 @@ public func hashMountSource(source: String) throws -> String {
|
||||
}
|
||||
return String(SHA256.hash(data: data).encoded.prefix(36))
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user