Search Unity

Package Update fails silently

Discussion in 'Package Manager' started by col000r, Mar 6, 2019.

  1. col000r

    col000r

    Joined:
    Mar 27, 2008
    Posts:
    654
    Firstly I have a package, let's call it Package A, that contains a script with a static function.

    Code (CSharp):
    1. public static void DoIt(int id) {}
    The package has an assembly definition file and gets compiled into an assembly that is auto-referenced in predefined assemblies.

    Secondly I have a script in Assets that calls the aforementioned static function.

    Code (CSharp):
    1. void Start() {
    2.    DoIt(2);
    3. }
    So far so good.

    But now I update the package (via the Package Manager) to a new version that changes the signature of the static function to:

    Code (CSharp):
    1. public static void DoIt(int id, string info) {}
    This should be causing an error in my script in Assets, but it doesn't. No error shows up.
    If I look at the script in the Package I can see in the Inspector that the code didn't update. The PackageManager says I have the latest version installed. Only if I reimport the package folder – then I get the error. What's going on here? Is it simply not recompiling the assembly after the update or is it secretly failing in the background and chooses never to tell me about it?

    I'm not entirely sure if this is a problem with packages or with assembly definitions?
    Tried this in 2019.1.0b5 and reported a bug (Case 1134490)
     
  2. benoitv_unity

    benoitv_unity

    Unity Technologies

    Joined:
    Aug 3, 2017
    Posts:
    40
    Hi @col00r,

    What version of npm are you using the publish the package? Newer versions of npm set the modified date of all files in a package to "Oct 26 1985". Switching to another version of the package will keep the same modified date and prevent the Asset Database from detecting that the file has changed.

    We've made a fix for that issue, should be available in the next 2019.1 beta. In the meantime you should use version 5 of npm to publish.

    Regards,
    Benoit
     
  3. col000r

    col000r

    Joined:
    Mar 27, 2008
    Posts:
    654
    yes, that's it! We're on node 6.4.1 and all imported packages have their date set to Oct 26 1985.
    Thanks @benoitv_unity !