Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,15 @@ extension Target {
self.swiftSettings = swiftSettings
}

func addComputeSettings() {
func addComputeSettings(binary: Bool) {
dependencies.append(
"Compute",
)
var swiftSettings = swiftSettings ?? []
swiftSettings.append(.define("OPENATTRIBUTEGRAPH_COMPUTE"))
if binary {
swiftSettings.append(.define("OPENATTRIBUTEGRAPH_COMPUTE_BINARY"))
}
self.swiftSettings = swiftSettings

var linkerSettings = linkerSettings ?? []
Expand Down Expand Up @@ -428,13 +431,13 @@ func setupDPFDependency() {
}

if computeCondition {
let defaultVersion = "0.4.1"
let defaultVersion = "0.5.1"
let binary = envBoolValue("OPENATTRIBUTESHIMS_COMPUTE_BINARY", default: false)
if binary {
let version = envStringValue("OPENATTRIBUTESHIMS_COMPUTE_BINARY_VERSION", default: defaultVersion)
let repo = envStringValue("OPENATTRIBUTESHIMS_COMPUTE_BINARY_REPO", default: "jcmosc/Compute")
let url = envStringValue("OPENATTRIBUTESHIMS_COMPUTE_BINARY_URL", default: "https://github.com/\(repo)/releases/download/\(version)/Compute.xcframework.zip")
let checksum = envStringValue("OPENATTRIBUTESHIMS_COMPUTE_BINARY_CHECKSUM", default: "322c72be5db233d723564a98c45150a45d3d5e9c0a4d4941d43edd1e2ea20bc4")
let checksum = envStringValue("OPENATTRIBUTESHIMS_COMPUTE_BINARY_CHECKSUM", default: "5f2fa067ef30d030409d376be63173b470f89caf0ac387ddc3408b7af466e908")
package.targets.append(
.binaryTarget(
name: "Compute",
Expand All @@ -456,7 +459,7 @@ if computeCondition {
}
package.dependencies.append(computeRepo)
}
openAttributeGraphShimsTarget.addComputeSettings()
openAttributeGraphShimsTarget.addComputeSettings(binary: binary)
package.platforms = [.iOS(.v18), .macOS(.v15), .macCatalyst(.v18), .tvOS(.v18), .watchOS(.v10), .visionOS(.v2)]
} else if danceUIGraphCondition {
let danceUIGraphBinaryRepo: Package.Dependency
Expand Down
12 changes: 11 additions & 1 deletion Sources/OpenAttributeGraphShims/Adapter/Compute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@
public typealias OAGAttributeInfo = IAGAttributeInfo
public typealias OAGCachedValueOptions = CachedValueOptions
public typealias OAGChangedValueFlags = IAGChangedValueFlags
public typealias OAGInputOptions = IAGInputOptions
public typealias OAGInputOptions = InputOptions
public typealias OAGValue = IAGChangedValue
public typealias OAGValueOptions = IAGValueOptions

#if OPENATTRIBUTEGRAPH_COMPUTE_BINARY

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is strange due to a current Compute release issue. I really do not want to add it. cc @jcmosc

  1. Compute removed such conformance in 3c955fe3cff8ae29fa5a66ae087c0763d7f1d1c4. (I did not got the reason. But this is a small thing and I add patch it here if Compute do have a need to remove it.)
  2. The weird thing is the 0.5.1 tag.

The source code point to b66dc81e2d16687b83769c492cd22ab699f28c0b which does not contain 3c955fe3cff8ae29fa5a66ae087c0763d7f1d1c4. So I do not need this patch.

But the 0.5.1 binary looks to be build by main after merge 3c955fe3cff8ae29fa5a66ae087c0763d7f1d1c4 which is 1fbf330926ffcebf74a9ea7e6dcd7957098f85c1 and includes 3c955fe3cff8ae29fa5a66ae087c0763d7f1d1c4. So there is a mismatch here.

extension AnyWeakAttribute: @retroactive Hashable {}
#endif

extension AnyAttribute {
public typealias Flags = Subgraph.Flags

Expand All @@ -24,6 +28,12 @@ extension Subgraph {
}

extension Graph {
public typealias TraceOptions = TraceFlags

public static func startTracing(_ graph: Graph?, options: TraceOptions) {
startTracing(graph, flags: options)
}

public static func startProfiling() {
startProfiling(nil)
}
Expand Down
Loading