OpenAttributeGraph is an open source implementation of Apple's Private framework - AttributeGraph which is a high performance computing engine written in C++ and Swift.
And it powers the underlying computing and diffing of OpenSwiftUI.
| CI Status |
|---|
The project is for the following purposes:
- Add OAG support for non-Apple platform (eg. Linux, WASI and Windows)
- Diagnose and debug AG issues on Apple platform
Currently, this project is in early development.
Please refer to the documentation for more information on it.
Add OpenAttributeGraph as a dependency in your Package.swift:
dependencies: [
.package(url: "https://github.com/OpenSwiftUIProject/OpenAttributeGraph.git", from: "0.2.0")
]Note
- You may need to configure the Swift toolchain header for proper integration of OpenAttributeGraph
- By default, OpenAttributeGraphShims will use the private AttributeGraph as its implementation on Apple platforms
For a simpler setup, you can use the prebuilt XCFramework available on the releases page.
The current suggested toolchain to build the project is Swift 6.1.2 / Xcode 16.4.
If your swift binary path is located in your <toolchain>/usr/bin/swift (eg. installed by swiftbox), no setup is required.
Otherwise set up it manully by exporting LIB_SWIFT_PATH environment variable.
The following command assume you already have swiftly installed.
export OPENATTRIBUTEGRAPH_LIB_SWIFT_PATH="$(swiftly use --print-location)/usr/lib/swift"
# Or use the swift_static path
export OPENATTRIBUTEGRAPH_LIB_SWIFT_PATH="$(swiftly use --print-location)/usr/lib/swift_static"Alternatively, you can set the path using the Swift SDK location. For example:
export OPENATTRIBUTEGRAPH_LIB_SWIFT_PATH=~/.swiftpm/swift-sdks/swift-6.1.3-RELEASE_static-linux-0.0.1.artifactbundle/swift-6.1.3-RELEASE_static-linux-0.0.1/swift-linux-musl/musl-1.2.5.sdk/aarch64/usr/lib/swift_staticSee LICENSE file - MIT
See CREDITS.md for third-party licenses and acknowledgements.