Search Unity

  1. Curious about what's going to be in 2020.1? Have a look at the 2020.1 beta blog post.
    Dismiss Notice
  2. Want to see 2020.1b in action? Sign up for our Beta 2020.1 Overview Webinar on April 20th for a live presentation from our evangelists and a Q&A session with guests from R&D.
    Dismiss Notice
  3. Interested in giving us feedback? Join our online research interviews on a broad range of topics and share your insights with us.
    Dismiss Notice
  4. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Modifying Tiny's mscorlib.cs issues

Discussion in 'Project Tiny' started by tomy93, Dec 20, 2019.

  1. tomy93

    tomy93

    Joined:
    May 31, 2017
    Posts:
    3
    I'm trying to modify Tiny's mscrolib.cs (located in
    \Library\DotsRuntimeBuild\artifacts\Stevedore\il2cpp\mscorlib
    ) in Tiny 0.16.1-preview.

    Though, I have a couple of weird results:
    - My changes are not being reflected when trying a build (Nullreference or Could not load errors).
    - At the output build folder, the mscorlib.dll does indeed reflect my changes (I took a look with dotPeek Decompiler).
    - If I delete the mscorlib.dll from the build folder, the build console doesn't shows any error related to that dll missimg.

    So, what's going on? It's possible to modify Tiny's mscorlib? I need to this because there is a
    error CS0656: Missing compiler required member 'System.String.Concat'
    error that prevent's building when trying to concat some strings.
     
  2. elliotc-unity

    elliotc-unity

    Unity Technologies

    Joined:
    Nov 5, 2015
    Posts:
    51
    0.16 is no longer supported; please upgrade to 0.20 first. We still use a tiny mscorlib in 0.20, so you might still need to do this, but it has changed some, and moreover the build process for it has changed as well.
     
  3. yossi_horowitz_artie

    yossi_horowitz_artie

    Joined:
    Jan 30, 2019
    Posts:
    77
    @elliotc-unity Thansk for your reply. Would you mind letting us know the best way to determine what's in the 0.20 tiny mscorlib, and how to make changes to that (if necessary)? I see a lot of `mscorlib.dll` files in the `ProjectTinySamples/Tiny3D` library folder after making a build.
     
  4. elliotc-unity

    elliotc-unity

    Unity Technologies

    Joined:
    Nov 5, 2015
    Posts:
    51
    You could look at it in ILSpy, but that's one of the things that's going to be hard to modify at the moment. The one that's in the final build directory (Builds/YourBuildSettingsName) is the one used at runtime.
     
  5. yossi_horowitz_artie

    yossi_horowitz_artie

    Joined:
    Jan 30, 2019
    Posts:
    77
    Thanks. I'm also curious about modifying it for wasm and asm.js builds, though -- would you mind letting us know which is the one that gets passed into the emscripten linker, and where in the build process code that's controlled?
     
  6. elliotc-unity

    elliotc-unity

    Unity Technologies

    Joined:
    Nov 5, 2015
    Posts:
    51
    Should be in
    Library/DotsRuntimeBuild/artifacts/NameOfYourBuildSettingsAsset/post_typereg
    , but I'm not sure that will do it for you, because I think the C# compiler reacts to it being missing at compile time (much earlier) and generates code you don't like. So you might have better luck modifying the one we ship, which is in
    Library/DotsRuntimeBuild/artifacts/Stevedore/il2cpp/build/profiles/Tiny
    , and then leaving the build hookup alone.

    In general, the build stuff controlling this latter location is in
    com.unity.dots.runtime\bee~\BuildProgramSources\Il2Cpp.bee.cs
    , specifically the
    _tinyCorlib
    field. As you can see, though, we ALSO ship our own version of netstandard.dll, and compile against that, which you will also have to modify, so it's gonna get real tricky. I would really think you would have a better time just creating strings in a way that compiles with the existing situation.
     
  7. yossi_horowitz_artie

    yossi_horowitz_artie

    Joined:
    Jan 30, 2019
    Posts:
    77
    You're probably right, but I'm glad that we know where to look in case we run into trouble. Thanks a lot for taking the time!
     
unityunity