Skip to content

Fix tuple.value not set in OGTupleWithBuffer #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 2, 2025

Conversation

Dark-Existed
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Jul 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 5.60%. Comparing base (6aceaa1) to head (6d2dfd0).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #135   +/-   ##
=====================================
  Coverage   5.59%   5.60%           
=====================================
  Files         25      25           
  Lines        643     642    -1     
=====================================
  Hits          36      36           
+ Misses       607     606    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Kyle-Ye
Copy link
Contributor

Kyle-Ye commented Jul 27, 2025

Nice catch up. Would you mind adding a test case to cover it?

Note: Currently CI won't run the cases due to #104. We need to set up OPENGRAPH_SWIFT_TOOLCHAIN_SUPPORTED and run it locally.

@Dark-Existed
Copy link
Contributor Author

Dark-Existed commented Jul 28, 2025

Sorry for the late reply. I have ran the test locally, and when executing swift test --filter UnsafeMutableTupleCompatibilityTests, I encountered an issue.

swift test --filter UnsafeMutableTupleCompatibilityTests
[1/1] Planning build
Building for debugging...
In file included from /Users/xxx/SwiftProjects/OpenSwiftUIProject/OpenGraph/Tests/OpenGraph_SPITests/table_test_case.mm:8:
In file included from /Applications/Xcode-16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.h:35:
In file included from /Applications/Xcode-16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCUIAutomation.framework/Headers/XCUIAutomation.h:7:
In file included from /Applications/Xcode-16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCUIAutomation.framework/Headers/XCUIApplication.h:6:
In file included from /Applications/Xcode-16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCUIAutomation.framework/Headers/XCUIElement.h:10:
In file included from /Applications/Xcode-16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:15:
In file included from /Applications/Xcode-16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSAccessibilityColor.h:9:
In file included from /Applications/Xcode-16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSColor.h:46:
In file included from /Applications/Xcode-16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:10:
/Applications/Xcode-16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSResponder.h:376:4: error: expected a type
  376 | - (IBAction)newWindowForTab:(nullable id)sender API_AVAILABLE(macos(10.12));
      |    ^
/Applications/Xcode-16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSResponder.h:382:4: error: expected a type
  382 | - (IBAction)showWritingTools:(nullable id)sender API_AVAILABLE(macos(15.2));
      |    ^
2 errors generated.
[2/33] Compiling OpenGraph_SPITests table_test_case.mm
error: fatalError

In Package.swift

let swiftToolchainPath = Context.environment["OPENGRAPH_SWIFT_TOOLCHAIN_PATH"] ?? (development ? "/Volumes/BuildMachine/swift-project" : "")
if !swiftToolchainPath.isEmpty {
    sharedCSettings.append(
        .unsafeFlags(
            [
                "-static",
                "-DCOMPILED_WITH_SWIFT",
                "-DPURE_BRIDGING_MODE",
                "-UIBOutlet", "-UIBAction", "-UIBInspectable",
                "-I\(swiftToolchainPath)/swift/include",
                "-I\(swiftToolchainPath)/swift/stdlib/public/SwiftShims",
                "-I\(swiftToolchainPath)/llvm-project/llvm/include",
                "-I\(swiftToolchainPath)/llvm-project/clang/include",
                "-I\(swiftToolchainPath)/build/Default/swift/include",
                "-I\(swiftToolchainPath)/build/Default/llvm/include",
                "-I\(swiftToolchainPath)/build/Default/llvm/tools/clang/include",
                "-DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING", // Required to fix LLVM link issue
            ]
        )
    )
}

After remove "-UIBOutlet", "-UIBAction", "-UIBInspectable", it works well.
table_test_case.mm -> XCTest.h → XCUIAutomation.h → AppKit.h → NSResponder.h -> IBAction.
I haven't got around to fixing this part yet.

@Kyle-Ye
Copy link
Contributor

Kyle-Ye commented Aug 2, 2025

I haven't got around to fixing this part yet.

Got it and I'll fix it later.

@Kyle-Ye Kyle-Ye merged commit 38bf2ad into OpenSwiftUIProject:main Aug 2, 2025
5 checks passed
@Kyle-Ye
Copy link
Contributor

Kyle-Ye commented Aug 2, 2025

Thanks for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants