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

When defined a CORLIB_ONLY. #88

Closed
MichihitoManaka opened this issue Jun 16, 2015 · 9 comments
Closed

When defined a CORLIB_ONLY. #88

MichihitoManaka opened this issue Jun 16, 2015 · 9 comments
Labels
enhancement Requires or request to feature enhancement question

Comments

@MichihitoManaka
Copy link

Environment:
-using MsgPack.Unity3D.(2015/06/16, 0.6.0-beta3)
-Mac OS X Yosemite(10.10.3)
(In another matter, I am happy if you could make a unitypackage for Mac environment.)
-Unity 5.1.0f3, buildin monodevelop.
-Unity settings,
Api Compatibility Level ".NET 2.0 Subset",
CORLIB_ONLY defined.

Now the compiling is stopped, the SubtreeUnpacker.cs Line 51, 52, 53.
The reason is because has disappeared defined from line 35 ~ 38.

35 #if !CORLIB_ONLY
36 using BooleanStack = System.Collections.Generic.Stack<System.Boolean>;
37 using Int64Stack = System.Collections.Generic.Stack<System.Int64>;
38 #endif

51 private readonly BooleanStack _isMap; // <- BooleanStack undefine.
52 private readonly Int64Stack _unpacked; // <- Int64Stack undefine.
53 private readonly Int64Stack _itemsCount; // <- Int64Stack undefine.

Same problem in "ItemsUnpacker.Skipping.cs".
It may be present in other.

I made unitypackage(Source code registration) for Mac environment.
So I want you to tell me if I have a mistake.

Thanks,

@MichihitoManaka
Copy link
Author

Additional(another Issues?)
When I do not define the CORLIB_ONLY.

AotHelper.EqualityComparers.cs Line 1619 ~ 1633.
System.RuntimeMethodHandle is Structure.
But it has been compared to the null.

TypeInfoEncoder.cs Line 71 ~ 72.
Is there one string argument to the Pack method?

Thanks,

@yfakariya yfakariya added question enhancement Requires or request to feature enhancement labels Jun 22, 2015
@yfakariya
Copy link
Member

CORLIB_ONLY compiler parameter switches System.dll dependents to others, so you must define manually when you use '.NET 2.0 subset' with source code now. I'll change the source package default.

AotHelper.EqualityComparers.cs Line 1619 - 1533 compare Nullable<RuntimeMethodHandle> and null, so it should be compiled as !left.HasValue by C# compiler. Do you face any compilation problem?

TypeInfoEncoder.cs Line 71 - 72 should be routed in Pack, but they are not very efficient, so they should use PackString. Thank you.

@MichihitoManaka
Copy link
Author

・AotHelper.EqualityComparers.cs Line 1619 - 1533

It reported a compile error in my environment.

Assets/MsgPack/Serialization/AotHelper.EqualityComparers.cs(1658,38): error CS0121: The call is ambiguous between the following methods or properties: System.RuntimeTypeHandle.operator ==(object, System.RuntimeTypeHandle)' andSystem.RuntimeTypeHandle.operator ==(System.RuntimeTypeHandle, object)'

Is this a problem of Unity Buildin Monodevelop?
Monodevelop version of Unity(for binary build) is 2.X?

My environment:
-Mac OS X Yosemite(10.10.3)
-Unity 5.1.0f3, buildin monodevelop.
-MsgPack.Unity3D.(2015/06/16, 0.6.0-beta3)
This slh project, we've built manually(The described unitypackage).
Because, our environment is Mac.

Or, whether the registration of any file is missing?

Thanks,

@MichihitoManaka
Copy link
Author

I was mistaken.

Mistake : Monodevelop version 2.x
Correct : Mono version 2.x

* Add more information.
All reports are all compile error.

yfakariya added a commit that referenced this issue Jul 5, 2015
.

Mono compiler on Unity fails to compile some nullable type. So workarounds are required.
@MichihitoManaka
Copy link
Author

Thank you very much!
It was confirmed Fix.

However, we still have "BooleanStack" and "Int64Stack" to SubtreeUnpacker.cs is used.

Thanks,

@yfakariya
Copy link
Member

Sorry for delay. And I'm sorry to forgot telling the problem. Did you include sources which exist only under https://github.com/msgpack/msgpack-cli/tree/master/src/MsgPack.Unity3D.Full ? xxxStack for Unity are defined in CorLubOnlyHelper.cs.

@MichihitoManaka
Copy link
Author

Thank you for your reply.
We went the "Unity Build" again in the project of "MsgPack.Unity3D.Full".
It went well all but one of the problems.

The problem is that the UnityBuild uses a MonoVersion 2.x.

Specifically, 71 line of TypeInfoEncoder.cs.
Assets/MsgPack/Serialization/Polymorphic/TypeInfoEncoder.cs(71,34): error CS1501: No overload for method Pack' takes2' arguments
(This is no problem if use the "Mono3.x" on MonoVedelop, but Unity is "Mono2.x".)

Thanks,

@yfakariya
Copy link
Member

Sorry for delay.
It has been fixed in 0.6.0 because Pack extension method is no longer used. Please try latest drop it also supports IL2CPP. https://github.com/msgpack/msgpack-cli/releases/tag/0.6.1.1

@MichihitoManaka
Copy link
Author

Thank you very much.
Your work is not delayed.
It has become to our help. Good luck.

Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Requires or request to feature enhancement question
Projects
None yet
Development

No branches or pull requests

2 participants