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

Using OnCoroutineCycle event causes build exception #2

Closed
zimavi opened this issue Sep 6, 2023 · 4 comments
Closed

Using OnCoroutineCycle event causes build exception #2

zimavi opened this issue Sep 6, 2023 · 4 comments
Assignees
Labels
bug Something isn't working upstream-issue An issue that is related to Cosmos itself

Comments

@zimavi
Copy link

zimavi commented Sep 6, 2023

What happened

When assigning a method to the OnCoroutineCycle method, IL2CPU throws System.Exception.

Screenshots

Compiling with event assigning
Compiling without event assigning

Note

Usually IL2CPU throws System.Exception when using none plugged classes (such as all from System.Threading namespace)

@ascpixi
Copy link
Owner

ascpixi commented Sep 6, 2023

Can you attach the output logs as well, please? You can access them from this menu:
image

I suspect the issue to be an unplugged MulticastDelegate method. If so, I can create an upstream issue for Cosmos and implement a workaround.

@zimavi
Copy link
Author

zimavi commented Sep 7, 2023

It says:

Сборка начата…
1>------ Сборка начата: проект: WinttOS, Конфигурация: Debug Any CPU ------
1>Анализаторы пропускаются для ускорения сборки. Для запуска анализаторов можно выполнить команды "Собрать" или "Пересобрать".
1>C:\Users\Anton\source\repos\WinttOS\WinttOS\Base\commands\rmCommand.cs(30,38,30,41): warning CS0168: Переменная "ex2" объявлена, но ни разу не использована.
1>C:\Users\Anton\source\repos\WinttOS\WinttOS\Base\commands\rmCommand.cs(24,33,24,35): warning CS0168: Переменная "ex" объявлена, но ни разу не использована.
1>C:\Users\Anton\source\repos\WinttOS\WinttOS\Base\commands\rmCommand.cs(50,38,50,41): warning CS0168: Переменная "ex2" объявлена, но ни разу не использована.
1>C:\Users\Anton\source\repos\WinttOS\WinttOS\Base\commands\rmCommand.cs(44,34,44,36): warning CS0168: Переменная "ex" объявлена, но ни разу не использована.
1>C:\Users\Anton\source\repos\WinttOS\WinttOS\Base\GUI\PowerOffButton.cs(16,31,16,43): warning CS0649: Полю "PowerOffButton.imageInBytes" нигде не присваивается значение, поэтому оно всегда будет иметь значение по умолчанию null.
1>C:\Users\Anton\source\repos\WinttOS\WinttOS\Base\commands\installCommand.cs(29,31,29,42): warning CS0649: Полю "installCommand.button1_img" нигде не присваивается значение, поэтому оно всегда будет иметь значение по умолчанию null.
1>C:\Users\Anton\source\repos\WinttOS\WinttOS\Base\Utils\GUI\OSMouse.cs(17,23,17,34): warning CS0649: Полю "OSMouse.cursorbytes" нигде не присваивается значение, поэтому оно всегда будет иметь значение по умолчанию null.
1>C:\Users\Anton\source\repos\WinttOS\WinttOS\Base\commands\installCommand.cs(22,31,22,38): warning CS0649: Полю "installCommand.bgBytes" нигде не присваивается значение, поэтому оно всегда будет иметь значение по умолчанию null.
1>WinttOS -> C:\Users\Anton\source\repos\WinttOS\WinttOS\bin\Debug\net6.0\WinttOS.dll
1>Executing IL2CPU on assembly
1>Kernel Base: Cosmos.System.Kernel
1>Checking target assembly: C:\Users\Anton\source\repos\WinttOS\WinttOS\bin\Debug\net6.0\WinttOS.dll
1>IL2CPU : warning : Loading plugs from assembly: Cosmos.Core_Asm, Version=10.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983
1>IL2CPU : warning : Loading plugs from assembly: Cosmos.Core_Plugs, Version=10.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983
1>IL2CPU : warning : Loading plugs from assembly: Cosmos.Debug.Kernel.Plugs.Asm, Version=10.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983
1>IL2CPU : warning : Loading plugs from assembly: Cosmos.System2_Plugs, Version=10.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983
1>IL2CPU : error : Exception: System.Exception:
1>Native code encountered, plug required.
1>  DO NOT REPORT THIS AS A BUG.
1>  Please see http://www.gocosmos.org/docs/plugs/missing/
1>  Need plug for: System.MulticastDelegate  System.Delegate.InternalAllocLike(System.Delegate)(Plug Signature: System_MulticastDelegate__System_Delegate_InternalAllocLike_System_Delegate_ ).
1>  Static: True
1>  Assembly: System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
1>  Called from:
1>System.MulticastDelegate::System.MulticastDelegate NewMulticastDelegate(System.Object[], Int32, Boolean)
1>System.MulticastDelegate::System.Delegate CombineImpl(System.Delegate)
1>System.Delegate::System.Delegate CombineImpl(System.Delegate)
1>
1>
1>   at Cosmos.IL2CPU.ILScanner.ScanMethod(MethodBase aMethod, Boolean aIsPlug, String sourceItem) in C:\Users\Anton\Desktop\IL2CPU\source\Cosmos.IL2CPU\ILScanner.cs:line 562
1>   at Cosmos.IL2CPU.ILScanner.ScanQueue() in C:\Users\Anton\Desktop\IL2CPU\source\Cosmos.IL2CPU\ILScanner.cs:line 752
1>   at Cosmos.IL2CPU.ILScanner.Execute(MethodBase aStartMethod, IEnumerable`1 plugsAssemblies) in C:\Users\Anton\Desktop\IL2CPU\source\Cosmos.IL2CPU\ILScanner.cs:line 270
1>   at Cosmos.IL2CPU.CompilerEngine.Execute() in C:\Users\Anton\Desktop\IL2CPU\source\Cosmos.IL2CPU\CompilerEngine.cs:line 189
1>IL2CPU task took 00:00:03.8226778
1>Сборка проекта "WinttOS.csproj" завершена с ошибкой.
========== Сборка: успешно выполнено — 0 , со сбоем — 1, в актуальном состоянии — 0, пропущено — 0 ==========
========== Прошло 00:19,432 ==========

EDIT: Yep, you are right. It's Multicast delegate issue. It is unplugged.

@ascpixi ascpixi self-assigned this Sep 7, 2023
@ascpixi ascpixi added bug Something isn't working upstream-issue An issue that is related to Cosmos itself labels Sep 7, 2023
@ascpixi
Copy link
Owner

ascpixi commented Sep 7, 2023

Filed an issue at upstream @ CosmosOS/Cosmos#2765. I'll implement a workaround for now.

@ascpixi
Copy link
Owner

ascpixi commented Sep 7, 2023

Should be fixed with commit e673c09.

@ascpixi ascpixi closed this as completed Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream-issue An issue that is related to Cosmos itself
Projects
None yet
Development

No branches or pull requests

2 participants