-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[dotnet][macOS] Incorrect registrar.h used when --require-pinvoke-wrappers:true is used #15190
Comments
The header file but there's a check not to duplicate the generation inside n = "struct trampoline_struct_" + name.ToString ();
if (!structures.Contains (n)) {
structures.Add (n);
declarations.WriteLine ("{0} {{\n{1}}};", n, body.ToString ());
} so it ends up using |
Yeah, the problem is that the pinvoke wrapper generation code uses a lot of logic from the static registrar, but doesn't properly clean up after itself, so when the static registrar runs it sees some leftover state from the pinvoke wrapper generation. |
…ing the static registrar. Fixes dotnet#15190. Otherwise the P/Invoke generator leaves partial results in the static registrar class, essentially saying things like "we've processed CoreMidi, no need to add an #include for this framework", and then we'd generate the static registrar code and that code would lack the #include for CoreMidi. Finishing the P/Invoke generator output will clear out any state stored in the static registrar. Fixes dotnet#15190.
…ing the static registrar. Fixes #15190. (#15214) Otherwise the P/Invoke generator leaves partial results in the static registrar class, essentially saying things like "we've processed CoreMidi, no need to add an #include for this framework", and then we'd generate the static registrar code and that code would lack the #include for CoreMidi. Finishing the P/Invoke generator output will clear out any state stored in the static registrar. Also fix a few other issues to make the generated P/Invoke wrapper code work, and add a test. Fixes #15190.
Steps to Reproduce
--require-pinvoke-wrappers:true
Expected Behavior
Both project should build without error and run correctly
Actual Behavior
Native compilation failures happens when
--require-pinvoke-wrappers:true
is usedEnvironment
Feature not yet released. Using xamarin-macios main 33b73a1
Build Logs
https://gist.github.com/spouliot/cad06d79b61a4545981170c4131965bc
macos.binlog.zip
registrar.h (working)
registrar.h (non working)
Note the lack of
which is the source of the compile time errors.
Example Project (If Possible)
See #15145 for the (dotnet) project being used
The text was updated successfully, but these errors were encountered: