Skip to content

Remove a few dependencies from unity package#1497

Merged
AArnott merged 2 commits intoMessagePack-CSharp:developfrom
AArnott:fix1475
Nov 19, 2022
Merged

Remove a few dependencies from unity package#1497
AArnott merged 2 commits intoMessagePack-CSharp:developfrom
AArnott:fix1475

Conversation

@AArnott
Copy link
Collaborator

@AArnott AArnott commented Sep 7, 2022

Unity 2021.2 and later already include these assemblies, and our inclusion of them causes failures because unity will prefer the 'app-local' copy over its own.

Fixes #1475

Unity 2021.2 and later already include these assemblies, and our inclusion of them causes failures because unity will prefer the 'app-local' copy over its own.

Fixes MessagePack-CSharp#1475
@AArnott AArnott added this to the v2.5 milestone Sep 7, 2022
@AArnott AArnott requested a review from neuecc September 7, 2022 22:14
@AArnott
Copy link
Collaborator Author

AArnott commented Sep 7, 2022

@joshpeterson @MichalPetryka I'd welcome your confirmation that this is the right fix.

@AArnott AArnott linked an issue Sep 7, 2022 that may be closed by this pull request
@MichalPetryka
Copy link
Contributor

Won't this break the package on Unity older than 2021.2? I think that 2 separate packages would be needed.

@AArnott
Copy link
Collaborator Author

AArnott commented Sep 7, 2022

Thanks for reviewing, @MichalPetryka.
Perhaps you're right. Which versions of unity are still supported, and how popular are they?

@joshpeterson
Copy link

This makes sense to me. I'm not sure how to check for the Unity version in MessagePack though. Is it possible to release two different packages?

@AArnott
Copy link
Collaborator Author

AArnott commented Sep 8, 2022

Is it possible to release two different packages?

Yes, probably. I'm no unity expert (I don't use it myself) and the repo's primary author has been unavailable for a while. If someone else can improve on this, I'd appreciate it. Otherwise I'll get to it when I can.

@AArnott
Copy link
Collaborator Author

AArnott commented Sep 8, 2022

Our unity build agent is failing at this point anyway, so we can't produce any unitypackage at the moment.

@jsteinich
Copy link
Contributor

Perhaps you're right. Which versions of unity are still supported, and how popular are they?

Unity 2020 LTS (2020.3.x) still has support for another 6-9 months.
Unity 2021 LTS (2021.3.x) is the current active LTS release.
Unity 2022 is the actively developed version.

Should probably aim to have official support for any LTS that is still supported. Supporting the active version is definitely nice, but official support for it probably isn't required (I've seen other libraries take that approach).

@jsteinich
Copy link
Contributor

Our unity build agent is failing at this point anyway, so we can't produce any unitypackage at the moment.

I'm not that familiar with how the builds are setup for this project, but one option would be to move towards Game CI. They have prebuilt GitHub actions, but could also use their docker images within Azure Pipelines.
This would also make testing on different versions easier as they publish docker images for each Unity version.

Copy link
Member

@neuecc neuecc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it is especially important to retain lower-level support because the development cycle of a game is several years long and they cannot increase the engine version too much.

@AArnott
Copy link
Collaborator Author

AArnott commented Oct 2, 2022

@neuecc What would you recommend? Should we abandon the PR?

@neuecc
Copy link
Member

neuecc commented Oct 2, 2022

I see, but is this only affecting the build machine (or local)?
If it doesn't seem to affect the packages to be distributed or the git UPM, it may be safe to merge.

@AArnott
Copy link
Collaborator Author

AArnott commented Oct 3, 2022

If it doesn't seem to affect the packages to be distributed or the git UPM, it may be safe to merge.

It removes files from the unity package we build. This is required so that newer unity clients don't malfunction on the dll's that we ship but are also now part of their platform.

If a game developer is stuck on one unity version for years, can't they also lock down on a particular major.minor version of messagepack so that they keep working, allowing future minor releases of messagepack to evolve to work by default in newer unity clients?

@jsteinich
Copy link
Contributor

If a game developer is stuck on one unity version for years, can't they also lock down on a particular major.minor version of messagepack so that they keep working, allowing future minor releases of messagepack to evolve to work by default in newer unity clients?

I mostly agree with this sentiment; however, I have experienced / can think of a couple cases where that may not hold true:

  • Other technologies continue to advance and can sometimes force/strongly encourage updates.
    • Some of our developers are switching to M1 macs. .net only has native support with .net 6.x. Older MPC versions don't work correctly on .net 6.x. Hence wanting to upgrade to a newer MessagePack version.
  • An established project (on an older Unity version) is looking to add MessagePack for new functionality. A developer will naturally look to start at the latest version, but will be forced to find and use an older version.

Despite those points, this is an open source project and compromises likely need to be made.

@neuecc
Copy link
Member

neuecc commented Oct 4, 2022

Hmmm...I see...it's a little too early to disappear completely.
How about a build of two packages like this?

[MessagePack.Unity.2.4.35.unitypackage]
[MessagePack.Unity.2.4.35.netstandard21.unitypackage]

@neuecc
Copy link
Member

neuecc commented Oct 26, 2022

@AArnott
Recently I was organizing packages for Unity at several libraries and changed my mind.
I think we can DROP support for 2020 in future updates (still LTS, but OK).
Minimum support version is 2021.3.
This way, only C# 9.0 and netstandard2.1 will be supported.
First of all, this PR is ACCEPT!

And the code can be nullable-enabled.
We will need to enable the warning suppression option for Unity, which I will set up if it becomes necessary.

I apologize for the delay in reporting on the policy and regarding the hesitation.

@AArnott
Copy link
Collaborator Author

AArnott commented Nov 19, 2022

/azp run

@AArnott AArnott merged commit 22632c0 into MessagePack-CSharp:develop Nov 19, 2022
@AArnott AArnott deleted the fix1475 branch November 20, 2022 21:26
@AArnott
Copy link
Collaborator Author

AArnott commented Nov 20, 2022

@neuecc This PR broke the unity build in our CI because it was still building with Unity 2019. When I update it to 2021.3 in #1530, it fails with new errors that I don't know how to fix. Can you take a look?

@neuecc
Copy link
Member

neuecc commented Nov 21, 2022

ok, i'll check soon.

@chung08061995
Copy link

Hi, I have a problem. When i build mono standalone window i can send to socket normally, but IL2CPP didn't work!

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

Successfully merging this pull request may close these issues.

Unity 2022.1.10 MessagePack 2.4.35 IL2CPP build Issues

6 participants