Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Packages Manager - custom packages cannot have custom dependencies

Discussion in '2018.3 Beta' started by Hostur, Oct 10, 2018.

  1. Hostur

    Hostur

    Joined:
    Jul 6, 2015
    Posts:
    60
    Hi,
    I'm trying to create custom packages. There is very few available options yet but I would like to point a bug which is "handled" by developers but scenario works only for unity packages:

    If I define my own package in manifest like
    "am.packages.other":"file:W:/Users/fzielinski/Packages/inny/0.0.1"
    ..it works until I define any dependency to other custom package because that dependency should looks the same way for example:
    "dependencies": {
    "am.packages.test":"file:W:/Users/fzielinski/Packages/test/1.0.1"
    }

    I need the full path to the custom dependency to resolve it but unity expect that dependency will be subversion only like
    "dependencies": {
    "am.packages.test":"1.0.1"
    }

    This subversion ofc cannot be resolved so this assertion for version format in dependencies should be abandoned
     
    mailfromthewilds likes this.
  2. okcompute_unity

    okcompute_unity

    Joined:
    Jan 16, 2017
    Posts:
    756
    Hi @Hostur,

    Just so you know, the custom package is not a supported feature for the moment. That said, I'll do my best to help you :). What is the error message you get? It would be easier to help you out if I could see the error message.

    Regards,

    Pascal
     
  3. Hostur

    Hostur

    Joined:
    Jul 6, 2015
    Posts:
    60
    Hi, so if I leave "file:" part of the path I'm receiving this error:

    "An error occurred while resolving packages:
    Package am.packages.inny@0.0.1 has invalid dependencies:
    am.packages.testowy: Version is invalid. Expected a pattern like 'x.x.x[-prerelease]', got 'W:/Users/fzielinski/Packages/testowy/1.0.1' instead.

    A re-import of the project may be required to fix the issue or a manual modification of C:/UnityProjects/AMCoreLibExample/Packages/manifest.json file."

    If I add "file:" part before path in dependencies I'm receiving:

    "An error occurred while resolving packages:
    Package am.packages.inny@0.0.1 has invalid dependencies:
    am.packages.testowy: Version is invalid. Expected a 'semver' compatible version, got 'file:W:/Users/fzielinski/Packages/testowy/1.0.1' instead.

    A re-import of the project may be required to fix the issue or a manual modification of C:/UnityProjects/AMCoreLibExample/Packages/manifest.json file."
     
  4. okcompute_unity

    okcompute_unity

    Joined:
    Jan 16, 2017
    Posts:
    756
    I understand the issue. Local package dependencies are only accepted in the project manifest (
    /<project path>/Packages/manifest.json)
    . What you are trying to do is not supported for the moment.

    Either remove the dependency In your `am.packages.inny` package or use a temporary Semver value. Add your leaf dependency as a root dependency in your project. The conflict resolution algorithm will always pick root packages.

    Hope it will help,

    Pascal