Cysharp/MessagePipe

`GetResult` and `UnsafeGetStatus` appears twice in Unity assets

itn3000 opened this issue · 4 comments

Overview

void IUniTaskSource.GetResult(short token) and public IUniTaskStatus UnsafeGetStatus() In

void IUniTaskSource.GetResult(short token) => GetResult(token);
public UniTaskStatus UnsafeGetStatus() => core.UnsafeGetStatus();
appears twice when build MessagePipe.sln.

Environment

  • Windows10(x64)
  • dotnet-sdk-6.0pre5
  • dotnet-sdk-5.0.301

Steps to reproduce

  1. clone source
  2. build by dotnet build MessagePipe.sln

Expected result

  • no changes will be found in git

Additional Information

This may be caused by executing tools/PostBuildUnity/PostBuildUnity.csproj in PostBuildEvent.
This is no problem if executing only once, but executed twice, public UniTaskStatus GetStatus(short token) will be hit and generating same lines again.

{"public UniTaskStatus GetStatus(short token)", @"void IUniTaskSource.GetResult(short token) => GetResult(token);
public UniTaskStatus UnsafeGetStatus() => core.UnsafeGetStatus();
public UniTaskStatus GetStatus(short token)" },

Thank you.
I thought it was always copied, but does that mean it's running without being copied?
Would this be solved by SkipUnchangedFiles=false?

MessagePipe.csproj+netstandard2.0 and MessagePipe.csproj+net5.0 seem to execute PostBuildUnity(inspected from msbuild log).
I tested SkipUnchangedFiles=false, it seems to depend on -maxCpuCount parameter(if maxCpuCount=1, replacement works correctry).
dotnet build seems to attempt parallel build by default(it may depend on system cpu?).

Oh, sorry, it seems to only depend on parallel build num(if maxcpucount=1, problem did not appear even if SkipUnchangedFiles=true).
Another solution I think is inserting trivia in public UniTaskStatus GetStatus(short token)(e.g. replacing from public UniTaskStatus GetStatus(short token) to public /*replaced*/ UniTaskStatus GetStatus(short token))

This seems to be fixed by #64, closing.