Search Unity

Question Package Manager Dependencies

Discussion in 'General Discussion' started by DrMeatball, May 20, 2023.

  1. DrMeatball

    DrMeatball

    Joined:
    Nov 21, 2021
    Posts:
    109
    Is there a way to find out what the dependencies are? Oftentimes random imports break existing projects. And skipping gives us no inkling of what was needed in the first place so that we can fix things ourselves.

    This has seemed curious to me for a while.. am I missing something?


    Screenshot 2023-05-19 202340.png
     
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,156
    Packages have a dependency list in the package manager itself.
    upload_2023-5-19_22-25-49.png
     
    angrypenguin likes this.
  3. This isn't about the UPM's dependencies, this is about the .unitypackage packages' UPM dependencies. Currently "asset store packages" can signal that they need certain UPM dependencies. Unfortunately the screenshot above is the UI which tells us that it has one or more.
    The question is about if we can know what those dependencies are. And the unfortunate answer currently is that we can't.
    I think(!) I saw a bug report about this, but I'm not sure and can't validate at the moment, so for the OP I advise to file a bug report and ask for it. That never hurts.
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,975
    You can find out rather easily though, simply by installing the package to the project, or an empty one. Then take a look at the changed files in version control, specifically the changes to manifest.json. You can also go through the asset‘s assembly definition files.

    While it would be welcome to see dependencies before importing, it really doesn‘t seem like a big deal to just import the asset (into the production project in a branch, or a test project) and then find out what changed. And also test the asset for compatibility before committing it to the rest of the team.

    What really bothers me is that we don‘t have a way of seeing all these dependencies before purchasing the asset! That could be a dealbreaker knowing ahead of time that an asset depends on something (or specific version) that just won‘t work with the project.
     
    DrMeatball likes this.
  5. DrMeatball

    DrMeatball

    Joined:
    Nov 21, 2021
    Posts:
    109
    Cool I'll try this ty! I'd thought about this due to the ability to import into a temp project, but then I wasn't sure if there was something I would then be missing just by manually observing. Wasn't aware of manifest.json - thanks!!

    The knowing ahead of time is also something that would be useful.. I left an undeserved negative review once (since updated much more favorably) because I really didn't understand a Unity 'way of things' at the time.

    Glad to have a workaround though!
     
  6. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    I don't follow. The screenshot there has a list of "Is using" items, listing Burst, Serialization, and a bunch of other packages.

    Outside of that UI, there's also a file inside the package you can look at which lists dependencies. Unfortunately I can't remember if they're listed by name or GUID, but I remember having solved a dependency issue by looking at these in the past.

    Are you saying that there's another, unspecified set of dependencies which people may also have to resolve separately?
     
  7. Because you are talking about the package manager package (UPM), we're talking about the asset store packages (.unitypackage).
    Screenshot 2023-05-21 171203.png

    There is no list of dependencies here (don't mind the deprecation notice, I just knew for a fact that Rival has UPM dependencies).
     
    DrMeatball and angrypenguin like this.
  8. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    Right, I get it. They're installed via the Package Manager, but for whatever reason don't display equivalent information, resulting in a guessing game.
     
    Lurking-Ninja likes this.