Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Custom package not updating

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

  1. Wolfoso

    Wolfoso

    Joined:
    Jul 10, 2018
    Posts:
    4
    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?
     
  2. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    582
    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
     
  3. Wolfoso

    Wolfoso

    Joined:
    Jul 10, 2018
    Posts:
    4
    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.
     
  4. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    582
    *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
     
  5. Wolfoso

    Wolfoso

    Joined:
    Jul 10, 2018
    Posts:
    4
    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!