GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Unity 2022.1.10 MessagePack 2.4.35 IL2CPP build Issues · Issue #1475 · MessagePack-CSharp/MessagePack-CSharp

Unity 2022.1.10 MessagePack 2.4.35 IL2CPP build Issues #1475

New issue
Copy link
New issue
Copy link
Closed
#1497
Closed
Unity 2022.1.10 MessagePack 2.4.35 IL2CPP build Issues#1475
#1497
Copy link
Labels
unity
Milestone
v2.5

Description

@Racot007
Racot007
opened on Jul 28, 2022
Issue body actions

Hi there.
I can't build IL2CPP project for PC. Trying NET standart and NET Framework
Editor serialization works fine.

Google Drive Link to repro project and full Editor log

Part of Editor log message:

Building Library\Bee\artifacts\WinPlayerBuildProgram\u1oik\lhyy_ssagePack2.obj failed with output:
MessagePack2.cpp
D:\Projects\Temp\TestMP\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\MessagePack2.cpp(20747): error C2664: 'String_t *Strings_WeakIntern_mC72EF2A3C712D84A4E92074BC83E711414D7F0BD(ReadOnlySpan_1_t0846CD1BEF355AE12F9A41FFB292AA4A85F072F3,const RuntimeMethod *)': cannot convert argument 1 from 'ReadOnlySpan_1_t59614EA6E51A945A32B02AB17FBCBDF9A5C419C1' to 'ReadOnlySpan_1_t0846CD1BEF355AE12F9A41FFB292AA4A85F072F3'
D:\Projects\Temp\TestMP\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\MessagePack2.cpp(20747): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
D:\Projects\Temp\TestMP\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\MessagePack2.cpp(7047): note: see declaration of 'Strings_WeakIntern_mC72EF2A3C712D84A4E92074BC83E711414D7F0BD'
UnityEditor.GenericMenu:CatchMenu (object,string[],int)

Activity

  1. AArnott
    added
    unity
    on Jul 30, 2022
  2. MichalPetryka commented on Aug 19, 2022

    @MichalPetryka
    MichalPetryka
    on Aug 19, 2022
    Contributor
    More actions

    This looks like a serious il2cpp (and possibly whole Unity) bug:
    https://github.com/neuecc/MessagePack-CSharp/blob/a0324060aaad24b9f7f10feee04d575a017e8061/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/StringInterningFormatter.cs#L46
    The type returned by Slice is a base runtime fast span (which consists of a ByReference struct and an int) while the WeakFormat method apparently is compiled to take a legacy portable span (with Pinnable, intptr and an int). Unity should never use the portable span, instead always redirecting it to the fast, base runtime one.

    @joshpeterson should probably take a look at this.

  3. MichalPetryka commented on Aug 19, 2022

    @MichalPetryka
    MichalPetryka
    on Aug 19, 2022
    Contributor
    More actions

    Removing the System.Memory and System.Buffers DLLs from Plugins does fix things though.

    Reacted by KOGA Mitsuhiro, powellsky and nekromant80lvl
  4. joshpeterson commented on Aug 22, 2022

    @joshpeterson
    joshpeterson
    on Aug 22, 2022
    More actions

    Thanks for raising this - removing the two specific assemblies is the proper way to work around this issue.

    The behavior here is not great, but historically Unity has given assemblies in the project precedence over assemblies in the base class library. So to avoid breaking projects which rely on this behavior, we need to continue it. Unfortunately this can lead to confusion like this case.

    Reacted by Artyom Sovetnikov
  5. AArnott commented on Sep 5, 2022

    @AArnott
    AArnott
    on Sep 5, 2022
    Collaborator
    More actions

    @joshpeterson Is there anything this repo should do to help this work by default, or is this a change that each unity app must change?

  6. joshpeterson commented on Sep 7, 2022

    @joshpeterson
    joshpeterson
    on Sep 7, 2022
    More actions

    @joshpeterson Is there anything this repo should do to help this work by default, or is this a change that each unity app must change?

    I'm not familiar enough this the code in this repo to say. Do the System.Memory and System.Buffers assemblies ship with a plugin from this repo? If so, then for Unity 2021 and later, they should be removed from the release.

  7. AArnott commented on Sep 7, 2022

    @AArnott
    AArnott
    on Sep 7, 2022
    Collaborator
    More actions

    Thanks. It looks like we do in fact pack those two and other assemblies in our unity package. Do you see any others in that list that may be problematic, @joshpeterson?

  8. joshpeterson commented on Sep 7, 2022

    @joshpeterson
    joshpeterson
    on Sep 7, 2022
    More actions

    Thanks. It looks like we do in fact pack those two and other assemblies in our unity package. Do you see any others in that list that may be problematic, @joshpeterson?

    You should not need System.Threading.Tasks.Extensions.dll and System.Runtime.CompilerServices.Unsafe.dll either. As of Unity 2021.2 and later, those are included in the Unity distribution, because Unity supports .NET Standard 2.1.

  9. MichalPetryka commented on Sep 7, 2022

    @MichalPetryka
    MichalPetryka
    on Sep 7, 2022
    Contributor
    More actions

    Thanks. It looks like we do in fact pack those two and other assemblies in our unity package. Do you see any others in that list that may be problematic, @joshpeterson?

    You should not need System.Threading.Tasks.Extensions.dll and System.Runtime.CompilerServices.Unsafe.dll either. As of Unity 2021.2 and later, those are included in the Unity distribution, because Unity supports .NET Standard 2.1.

    System.Runtime.CompilerServices.Unsafe in not in .NET Standard 2.1.

  10. joshpeterson commented on Sep 7, 2022

    @joshpeterson
    joshpeterson
    on Sep 7, 2022
    More actions

    Thanks. It looks like we do in fact pack those two and other assemblies in our unity package. Do you see any others in that list that may be problematic, @joshpeterson?

    You should not need System.Threading.Tasks.Extensions.dll and System.Runtime.CompilerServices.Unsafe.dll either. As of Unity 2021.2 and later, those are included in the Unity distribution, because Unity supports .NET Standard 2.1.

    System.Runtime.CompilerServices.Unsafe in not in .NET Standard 2.1.

    Oh yes, that is a good point - sorry! That assembly can stay.

  11. AArnott
    added 3 commits that reference this issue on Sep 7, 2022

    Remove a few dependencies from unity package

    This issue will close once commit 739c32b is merged into the 'master' branch.
    739c32b

    Remove a few dependencies from unity package

    This issue will close once commit dcaea3a is merged into the 'master' branch.
    dcaea3a

    Remove a few dependencies from unity package

    This issue will close once commit 78dcd86 is merged into the 'master' branch.
    78dcd86
  12. AArnott
    linked a pull request that will close this issueRemove a few dependencies from unity package #1497on Sep 7, 2022
  13. AArnott
    added this to the v2.5 milestone on Nov 19, 2022
  14. AArnott
    closed this as completedon Nov 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    unity

    Type

    No type

    Projects

    No projects

      Milestone

      • v2.5

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.