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

feat: use ILPostProcessor for weaver #525

Merged
merged 40 commits into from
Jan 11, 2021
Merged

feat: use ILPostProcessor for weaver #525

merged 40 commits into from
Jan 11, 2021

Conversation

paulpach
Copy link
Contributor

@paulpach paulpach commented Jan 8, 2021

The weaver now uses ILPostProcessor API from unity. This is the same thing MLAPI will use soon.

This is an internal feature from Unity that is still subject to change, see:
https://forum.unity.com/threads/how-does-unity-do-codegen-and-why-cant-i-do-it-myself.853867/#post-5646937

but it solves a lot of issues:

  • The weaver can now weave the runtime too!, so mirror core can use [Syncvar] and all that jazz.
  • The weaver is multithreaded, each assembly is weaved in a different thread. In theory, this should be faster when you have multiple CPU cores, but I have not benchmarked it.
  • No more cases where weaver doesn't run
  • Some weaver errors now take you to the code when double clicking
  • No need to rebuild all assemblies to bootstrap weaver

Note editor scripts are no longer weaved. Apparently, ILPostProcessor is not applied consistently to editor scripts. For this reason, some of the tests must now be done in runtime tests.

BREAKING CHANGE: MirrorNG assembly no longer contains the components. Reference Mirror.Components instead.
BREAKING CHANGE: Editor scripts are no longer weaved

@paulpach paulpach changed the title refactor: use ILPostProcessor for weaver feat: use ILPostProcessor for weaver Jan 9, 2021
@sonarcloud
Copy link

sonarcloud bot commented Jan 10, 2021

@paulpach paulpach marked this pull request as ready for review January 10, 2021 19:03
@paulpach paulpach merged commit def64cd into master Jan 11, 2021
@paulpach paulpach deleted the ilpp branch January 11, 2021 12:42
github-actions bot pushed a commit that referenced this pull request Jan 11, 2021
# [62.0.0](v61.1.2...v62.0.0) (2021-01-11)

### Features

* use ILPostProcessor for weaver ([#525](#525)) ([def64cd](def64cd)), closes [/forum.unity.com/threads/how-does-unity-do-codegen-and-why-cant-i-do-it-myself.853867/#post-5646937](https://github.com//forum.unity.com/threads/how-does-unity-do-codegen-and-why-cant-i-do-it-myself.853867//issues/post-5646937)

### BREAKING CHANGES

* MirrorNG assembly no longer contains the components.  Reference Mirror.Components instead.
* Editor scripts are no longer weaved
@github-actions
Copy link
Contributor

🎉 This PR is included in version 62.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

1 participant