-
-
Notifications
You must be signed in to change notification settings - Fork 79
fix(nitrogen/ios): optional number release build error #1090
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
base: main
Are you sure you want to change the base?
fix(nitrogen/ios): optional number release build error #1090
Conversation
|
@moskalakamil is attempting to deploy a commit to the Margelo Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks for the fix - a few notes;
|
|
in my case, the bug only appeared when two nitro packages were linked together. Building each package individually in release mode worked fine, but once they depended on each other the issue surfaced immediately. This is very similar to what happened in PR #1065; when you added optional number handling there, the problem did not show up because the package was isolated. Not sure how it looks in react-native-nitro-sound (cc again @hyochan) |
|
Since it happens in react-native-nitro-sound and @hyochan does not use external dependencies (as far as I know?) i am not fully sure if this is a deterministic way to test this. I'll build a release version of this tomorrow and check if it can be reliably reproduced, then we'll see |
69a9ee3 to
bb06e3a
Compare
bb06e3a to
68e2856
Compare
|
hey @mrousavy, have you had a chance to take a look? |
fixes a bug where a
std::optional<double>(used to representnumber | undefined) would not work correctly in Release mode due to a Swift C++ interop issue.Even though
std::optional<double>is an optional type, it is not always detected byneedsSpecialHandling, which caused the generated bridging to follow the generic path. This worked in Debug, but Release builds triggered a Swift interop bug causing the optional number to be interpreted incorrectly.A previous attempt to fix this (see #1065) introduced the following pattern:
However, this did not address the issue - the Swift C++ interop layer still failed in Release mode.
A reproducible example of the failing case is here:
moskalakamil@bef989c
Instead of using
.pointer, this PR switches to:cc @hyochan