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

GetResult and UnsafeGetStatus appears twice in Unity assets #63

Closed
itn3000 opened this issue Jun 21, 2021 · 4 comments
Closed

GetResult and UnsafeGetStatus appears twice in Unity assets #63

itn3000 opened this issue Jun 21, 2021 · 4 comments

Comments

@itn3000
Copy link
Contributor

itn3000 commented Jun 21, 2021

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)" },

@neuecc
Copy link
Member

neuecc commented Jun 21, 2021

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?

@itn3000
Copy link
Contributor Author

itn3000 commented Jun 21, 2021

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?).

@itn3000
Copy link
Contributor Author

itn3000 commented Jun 21, 2021

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))

itn3000 added a commit to itn3000/MessagePipe that referenced this issue Jun 22, 2021
neuecc added a commit that referenced this issue Jun 22, 2021
prevent duplicated method generation(#63)
@itn3000
Copy link
Contributor Author

itn3000 commented Jun 24, 2021

This seems to be fixed by #64, closing.

@itn3000 itn3000 closed this as completed Jun 24, 2021
mfandreich pushed a commit to HolyShovelSoft/MessagePipe that referenced this issue Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants