Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Custom package not updating

Discussion in 'Package Manager' started by Wolfoso, Jun 17, 2019.

  1. Wolfoso

    Wolfoso

    Joined:
    Jul 10, 2018
    Posts:
    11
    I've created a custom package and uploaded it on GitHub to privately share with my colleagues. We then added the link to the GitHub Repo in the manifest.json of Packages folder and everything seemed to be working fine: the package was successfully downloaded and all the functionalities were there. When I updated the repository though, restarting the project did not update the package.

    Project folder structure:
    Code (CSharp):
    1.  <root>
    2.    ├── package.json
    3.    ├── package-lock.json
    4.    ├── README.md
    5.    ├── Scripts
    6.    │   ├── Runtime
    7.    │   │    ├── MessagingLibrary.asmdef
    8.    │   │    └── MessagingManager.cs
    9.    │   │    └── MessageType.cs
    10.    │   │    └── NetworkMessageBase.cs
    11.    │   │    └── NetworkOutMessage.cs
    12.    │   │    └── NetworkInMessage.cs
    Manifest line:
    Code (CSharp):
    1.  "com.hevolus.messagingservice": "https://github.com/Wolfoso/MessagingService",
    What am I doing wrong?
     
    Pacosmico likes this.
  2. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    729
    Hi @Wolfoso,

    The Package Manager will lock the Git package to a specific revision in your project. This is to render the resolution of your project dependencies deterministic. It is a mechanism to protect users against out of scope changes that could break your project. To update the project to a different revision, you have two choices.

    1) Re-add the Git package URL in your project through the Package Manager UI (*this UX was added recently in the Package Manager UI)
    2) Open the project manifest (
    Packages/manifest.json
    ) in a text editor, erase the entry for your package in the
    lock
    section.

    Hope this help,

    Regards,

    Pascal
     
    Pacosmico likes this.
  3. Wolfoso

    Wolfoso

    Joined:
    Jul 10, 2018
    Posts:
    11
    Hello @okcompute_unity,

    Thank you for your quick reply, that helps a lot. While I can think of a workaround to automate this process, I don't understand why Untiy's default behaviour on Packages would be to lock them. Isn't the whole purpose of packages to act as project addons? Locking a revision should be an option, not the standard, in my opinion.
    All information regarding the package are in the manifest anyway, it would be possible to avoid updating to an incompatible version by just checking that manifest, wouldn't it?

    Thanks again for your time.
     
    transat likes this.
  4. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    729
    *Determinism* is a key foundation for the Unity Package Manager. As I said, we don't want people to get their project in a broken state just because they closed and re-open Unity. In our view, it is critical for the lock to be enabled by default to make sure the whole development team has the same behaviour. That said, we do not provide proper UX to easily update _locked_ packages. This is where we need to put more effort. Manually modifying the project manifest is not really nice. Making the *lock* optional could be something to add to the Package Manager. This would be opt-in for sure. Not default. Maybe this makes sense for a prototype project used only by one person?

    Thank you for your feedback!

    Pascal
     
    transat, Pacosmico and Bunderant like this.
  5. Wolfoso

    Wolfoso

    Joined:
    Jul 10, 2018
    Posts:
    11
    I understand the logic behind it now, it does indeed make sense.
    Guess this solves it then. We'll be looking forward to a lock-toggle functionality!
     
    Pacosmico likes this.
  6. KarolStolaDD

    KarolStolaDD

    Joined:
    Sep 10, 2019
    Posts:
    5
    Or could we just get an "update" button like in the standard packages?
     
  7. andrew-lukasik

    andrew-lukasik

    Joined:
    Jan 31, 2013
    Posts:
    167
    Hi @okcompute_unity. We get determinism part. But please consider adding manual update button (that just deletes this lock, nothing more) because explaining this operation to **every**single**user** (while he expects update button there as well) is exhausting
     
    runette_unity likes this.
  8. Anthony_cts

    Anthony_cts

    Joined:
    Mar 11, 2017
    Posts:
    5
    I think having the update button would be very nice indeed. I am sharing a toolset on github as a UPM package that people can't update without re-adding the repo. I understand that packages shouldn't update automatically, but having an update button would make it so much better UX-wise.
     
  9. Shaunyowns

    Shaunyowns

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    288
    There is work for this but we currently don't have an ETA on this.
     
unityunity