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

generate-helper-types with single-file is broken #339

Closed
mgood7123 opened this issue Apr 20, 2022 · 1 comment · Fixed by #391
Closed

generate-helper-types with single-file is broken #339

mgood7123 opened this issue Apr 20, 2022 · 1 comment · Fixed by #391

Comments

@mgood7123
Copy link

PS D:\IMPORTANT\source\repos\WindowsProject1\AndroidUI.Native> ls


    Directory: D:\IMPORTANT\source\repos\WindowsProject1\AndroidUI.Native


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         4/20/2022   8:12 PM           1518 AndroidUI.Native.vcxitems
-a----         4/19/2022   5:09 PM           1378 TmpPtr.h
-a----         4/20/2022   8:14 PM          47296 SkXn.h
-a----         4/20/2022  10:20 PM             39 a.cs
-a----         4/18/2022   5:24 PM          21738 SkTypes.h
-a----         4/20/2022   7:09 PM           3392 SkNx_IMPL.cpp
-a----         4/14/2022   1:33 PM           1521 SkSafe_math.h
-a----         4/14/2022   1:43 PM           2700 SkFloatBits.h
-a----         4/14/2022   1:44 PM           6877 SkScalar.h
-a----         4/20/2022   8:12 PM            885 AndroidUI.Native.vcxitems.filters
-a----         4/14/2022   1:40 PM          10111 SkFloatingPoint.h
-a----         4/17/2022   2:19 PM          30147 SkNx_sse.h
-a----         4/17/2022   2:22 PM          23245 SkNx_neon.h


PS D:\IMPORTANT\source\repos\WindowsProject1\AndroidUI.Native> ClangSharpPInvokeGenerator.exe -f .\SkXn.h -l "runtimes/win-x64/native/AndroidUI.Native.Windows.dll"           -n Bindings -m Windows -c compatible-codegen -c generate-helper-types -o I_DO_NOT_EXIST.cs
Processing '.\SkXn.h'
Diagnostics for binding generation of .\SkXn.h:
    Error (Line 35, Column 11 in ./SkXn.h): Unsupported anonymous named declaration: 'Namespace'.
    Error (Line 173, Column 12 in ./SkXn.h): Unsupported declaration: 'ClassTemplatePartialSpecialization'. Generated bindings may be incomplete.
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.IO.IOException: Cannot create 'D:\IMPORTANT\source\repos\WindowsProject1\AndroidUI.Native\I_DO_NOT_EXIST.cs' because a file or directory with the same name already exists.
   at System.IO.FileSystem.CreateDirectory(String fullPath, Byte[] securityDescriptor)
   at System.IO.Directory.CreateDirectory(String path)
   at ClangSharp.PInvokeGenerator.Close() in /_/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs:line 270
   at ClangSharp.PInvokeGenerator.Dispose(Boolean isDisposing) in /_/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs:line 1689
   at ClangSharp.Program.Run(InvocationContext context) in /_/sources/ClangSharpPInvokeGenerator/Program.cs:line 648
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__24_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseDebugDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext()
PS D:\IMPORTANT\source\repos\WindowsProject1\AndroidUI.Native> ls


    Directory: D:\IMPORTANT\source\repos\WindowsProject1\AndroidUI.Native


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         4/20/2022   8:12 PM           1518 AndroidUI.Native.vcxitems
-a----         4/19/2022   5:09 PM           1378 TmpPtr.h
-a----         4/20/2022   8:14 PM          47296 SkXn.h
-a----         4/20/2022  10:20 PM             39 a.cs
-a----         4/18/2022   5:24 PM          21738 SkTypes.h
-a----         4/20/2022   7:09 PM           3392 SkNx_IMPL.cpp
-a----         4/20/2022  10:21 PM             39 I_DO_NOT_EXIST.cs
-a----         4/14/2022   1:33 PM           1521 SkSafe_math.h
-a----         4/14/2022   1:43 PM           2700 SkFloatBits.h
-a----         4/14/2022   1:44 PM           6877 SkScalar.h
-a----         4/20/2022   8:12 PM            885 AndroidUI.Native.vcxitems.filters
-a----         4/14/2022   1:40 PM          10111 SkFloatingPoint.h
-a----         4/17/2022   2:19 PM          30147 SkNx_sse.h
-a----         4/17/2022   2:22 PM          23245 SkNx_neon.h


PS D:\IMPORTANT\source\repos\WindowsProject1\AndroidUI.Native>
@nike4613
Copy link

nike4613 commented Jan 7, 2023

This still appears to be an issue. The generated code includes using and namespace declarations within the single-file namespace.

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

Successfully merging a pull request may close this issue.

3 participants