Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Please update com.unity.collections reference of System.Runtime.CompilerServices.Unsafe

Discussion in 'Package Manager' started by SLGSimon, Aug 21, 2019.

  1. SLGSimon

    SLGSimon

    Joined:
    Jul 23, 2019
    Posts:
    13
    Currently com.unity.collections is referencing System.Runtime.CompilerServices.Unsafe 4.3

    System.Memory requires System.Runtime.CompilerServices.Unsafe (>= 4.5.0) so anything referencing that will cause an error that cannot be fixed.

    Please move this out to a "nuget.xxx" package with updated versions.
     
    GeorgeAdamon likes this.
  2. ethan_jl_unity

    ethan_jl_unity

    Unity Technologies

    Joined:
    Sep 27, 2018
    Posts:
    43
    Hi there,

    I have forwarded this issue to the team in charge of the `com.unity.collections`. Thanks for the report.
     
    GeorgeAdamon likes this.
  3. SLGSimon

    SLGSimon

    Joined:
    Jul 23, 2019
    Posts:
    13
    Thanks @ethan_jl_unity.

    Would it also be possible to get some info on how these situations will be handled in the future, with unity packaging dlls from nuget?
     
  4. SLGSimon

    SLGSimon

    Joined:
    Jul 23, 2019
    Posts:
    13
    Sorry to ping you again, but is there an update on this? It's blocking updates to our shared libraries.
     
  5. GeorgeAdamon

    GeorgeAdamon

    Joined:
    May 31, 2017
    Posts:
    12
    +1
    This would be greatly appreciated. We are having massive issues with the NumSharp library at the moment, which needs System.Runtime.CompilerServices.Unsafe (>= 4.5.2) and at the same time we need Unity.Collections which ships with 4.0.3.0
     
    Last edited: Oct 1, 2019
  6. GeorgeAdamon

    GeorgeAdamon

    Joined:
    May 31, 2017
    Posts:
    12
    To circumvent my problem, I had to:
    1. Copy the folders com.unity.collections, com.unity.jobs, com.unity.test-framework and com.unity.test-framework.performance from Library/PackageCache/
    2. Paste them inside my Assets folder
    3. Delete or Disable System.Runtime.CompilerServices.Unsafe.dll from the Assets/com.unity.collections/
    4. Uninstall Unity.Collections and Unity.Jobs from the Package Manager
    So far everything works, and both NumSharp and Collections use the 4.5.2 version of System.Runtime.CompilerServices.Unsafe
     
  7. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    143
    @SLGSimon, @GeorgeAdamon,

    I am really sorry you're still having issues. The issues have been forwarded to the relevant teams and I'll follow-up on this. In the meantime, you can get unblocked in a less drastic manner by embedding the faulty packages - similar to the steps taken by @GeorgeAdamon, but under the
    Packages/
    directory. This allows the package manager to still see these packages and install their dependencies, and you don't need to remove them from the project manifest.

    So updated steps would look like:
    1. Copy only the folder com.unity.collections from Library/PackageCache/
    2. Paste it under
      Packages
      (optionally rename it to
      com.unity.collections
      so it has the same name as in its
      package.json
      file)
    3. Delete or Disable System.Runtime.CompilerServices.Unsafe.dll from the Packages/com.unity.collections/
     
    GeorgeAdamon likes this.
  8. GeorgeAdamon

    GeorgeAdamon

    Joined:
    May 31, 2017
    Posts:
    12
    Thanks for the tip @maximeb_unity and we are looking forward for this issue to be resolved!