Search Unity

Error in the compilation of assemblies and dependencies depending on which folder it is in

Discussion in 'Package Manager' started by bdovaz, Oct 24, 2019.

  1. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
  2. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    Thanks for reporting a bug!

    Pascal
     
  3. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    @okcompute_unity I've looked into it a little more and I can give you some more clues.

    C# compiler errors

    I have some official nuget as UPM packages (using https://github.com/xoofx/UnityNuGet):
    - "AssemblyA.dll" 1.0 that depends on "AssemblyB.dll" >= 1.0.

    If I put:
    - Assets/AssemblyA.dll (1.0)
    - Assets/AssemblyB.dll (1.1)

    WORKS.

    If I put them as packages:
    - Packages/com.package.a/AssemblyA.dll (1.0)
    - Packages/com.package.b/AssemblyB.dll (1.1)

    COMPILATION ERRORS.

    An example of those errors:

    It seems that being on a package they are compilated with different flags by Unity and it's forcing a specific version? I need to alter this and behave like Nuget packages where you rely on >= 1.0 and not == 1.0..

    Were are heavily relying on UPM for our codebase and https://github.com/xoofx/UnityNuGet for Nuget dependencies so this is a big problem for us and a stopper gaving us a lot of headaches.

    In fact, I attach an even stranger example with "System.IO.Pipelines" (4.6.0):

    https://www.nuget.org/packages/System.IO.Pipelines/4.6.0

    The project (in 2019.3.0b8) simply has the dependencies chain for ".NET Standard 2.0" distributed in UPM package format (no higher dependencies, exact dependencies).

    If you later take all the dlls from those packages and leave them simply in Assets you'll see that it compiles.
     

    Attached Files:

    • test.zip
      File size:
      244.7 KB
      Views:
      347
    Maeslezo likes this.
  4. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    @bdovaz These packages are not officially supported by Unity. I'll let the community help you with this one. And you can probably also push an issue on UnityNuget repository to give you more visibility on the issue.

    Regards,

    Pascal
     
  5. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    @okcompute_unity

    Please take a moment to read my messages and replicate my bug report and my other project in the attached file. They are simply the official nuget assemblies packaged in UPM format (it's the assembly with the package.json). If the assemblies in the assets folder work I don't know why they don't work when they are in UPM format. Please take the time to investigate the problem as it has nothing to do with that repository you mention, it is easily replicable.

    The bug/problem it's on Unity side.

    Consider the time I have taken to prepare the two projects, replicate it easily and write it all down and don't answer me that they are not Unity-supported packages and that the community will answer me. It is evident that they are not packages from Unity... I'm creating them from Nuget. I'm giving my feedback, I hope at least you do your job and give me an answer when you've taken the time to look at it please.
     
  6. xoofx

    xoofx

    Unity Technologies

    Joined:
    Nov 5, 2016
    Posts:
    417
    I believe this is a known limitation of UPM today that will fail on NuGet packages deployed as UPM that are relying on a >= version dependency instead of ==. There is currently no way to express such dependencies with UPM
     
  7. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,052
    @okcompute_unity @xoofx

    My compilation problem has to do with what folder the assemblies are in. If they are all in the same folder it works perfectly, otherwise those errors come out. I have prepared a very basic project just with that and you can try.
     

    Attached Files:

    • test.zip
      File size:
      201.1 KB
      Views:
      384