Skip to content
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

VNHumanBodyPose3DObservationJointName smart enum GetValue method linked away during optimized build #19712

Closed
haritha-mohan opened this issue Dec 29, 2023 · 0 comments · Fixed by #19836
Assignees
Labels
bug If an issue is a bug or a pull request a bug fix tests Anything related to tests
Projects
Milestone

Comments

@haritha-mohan
Copy link
Contributor

Ref: #19412

The xammac test fails to build when in release mode with all the optimizations enabled: stack trace.

Using tools.sln to build the app locally, I discovered the null reference exception mentioned in the trace originates from:

foreach (var m in getValueMethods) {

The loop is trying to iterate through a null enumerable.

For an unknown reason, during the optimized release build the value extension methods for the smart enum Vision.VNHumanBodyPose3DObservationJointNameExtensions are getting linked away. This is only an issue with the Value methods as the constant methods mentioned right above this code are still present..and since the xammac debug and other release version (without the all optimizations argument passed) are passing it clarifies that its not an issue with the actual smart enum or api but just something during the linking step.

As a temp workaround, there has been an additional test added in the monotouch test suite (which is where the test code for xammac is) that uses the GetValue method to prevent it from being linked away from the time being. This allows for the xammac test to be built successfully.

Other helpful context I've come across when investigating:

@haritha-mohan haritha-mohan added the bug If an issue is a bug or a pull request a bug fix label Dec 29, 2023
@rolfbjarne rolfbjarne added the tests Anything related to tests label Jan 2, 2024
@rolfbjarne rolfbjarne self-assigned this Jan 2, 2024
@rolfbjarne rolfbjarne added this to the .NET 9 milestone Jan 2, 2024
@rolfbjarne rolfbjarne added this to Bugs in .NET 9 Jan 2, 2024
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Jan 16, 2024
…Fixes xamarin#19712.

Looks like this was substep was only added to mtouch, never to mmp, so let's fix that.

This also makes it possible to remove a test that was only there for the
linker to keep some required methods so that the test app would build
correctly.

Fixes xamarin#19712.
rolfbjarne added a commit that referenced this issue Jan 22, 2024
…Fixes #19712. (#19836)

Looks like this was substep was only added to mtouch, never to mmp, so
let's fix that.

This also makes it possible to remove a test that was only there for the
linker to keep some required methods so that the test app would build
correctly.

Fixes #19712.
.NET 9 automation moved this from Bugs to Done Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug If an issue is a bug or a pull request a bug fix tests Anything related to tests
Projects
2 participants