Skip to content

Commit

Permalink
Make Linux Bundle concurrency safe for Swift 6.
Browse files Browse the repository at this point in the history
Signed-off-by: furby™ <devs@wabi.foundation>
  • Loading branch information
furby-tm committed Feb 15, 2025
1 parent 6fe6bad commit 9379afa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
6 changes: 3 additions & 3 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "574e70c31d2f9e918e37ad66f2b3778e74a498b10fbcf408505b90a3b7d2c027",
"originHash" : "3abc8be558cfafce9b6bfe2e4459c53be9490bc02aa0976397031b7ca60ab377",
"pins" : [
{
"identity" : "icu",
Expand All @@ -15,8 +15,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/wabiverse/MetaverseKit",
"state" : {
"branch" : "main",
"revision" : "8cf6729a950092be3d3d627964731c3b974531b8"
"revision" : "e23651486710c0a442c70adc709acdf91c0c74ff",
"version" : "1.9.0"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ let package = Package(
// prepare for SwiftCrossUI, for a cross-platform UsdView.
// .package(url: "https://github.com/stackotter/swift-cross-ui", revision: "5c5d8c8"),
.package(url: "https://github.com/wabiverse/icu.git", from: "76.1.2"),
.package(url: "https://github.com/wabiverse/MetaverseKit", branch: "main"),
.package(url: "https://github.com/wabiverse/MetaverseKit", from: "1.9.0"),
.package(url: "https://github.com/swiftlang/swift-syntax.git", from: "600.0.1"),
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.4.3"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.3"),
Expand Down
18 changes: 6 additions & 12 deletions Sources/PixarUSD/Bundle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,22 @@ import Rainbow
/**
* On Linux there is no ``Foundation.Bundle``, so we create one.
*/
public struct Bundle
public final class Bundle: Sendable
{
public static let main = Bundle()

public let resourcePath: String?

private init()
{
resourcePath = "/" + Arch.getExecutablePath().split(separator: "/").dropLast().joined(separator: "/")

Msg.logger.log(level: .info, "Bundle path: \(resourcePath ?? "")")
}

public var resourcePath: String?

public init?(path: String)
{
if FileManager.default.fileExists(atPath: path, isDirectory: nil)
{
resourcePath = path
}
else
{
return nil
}
guard FileManager.default.fileExists(atPath: path, isDirectory: nil) else { return nil }
resourcePath = path
}
}
#endif /* os(Linux) */
Expand Down

0 comments on commit 9379afa

Please sign in to comment.