Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Git support on Package Manager

Discussion in 'Package Manager' started by rizu, Oct 24, 2018.

  1. ShawnFeatherly

    ShawnFeatherly

    Joined:
    Feb 22, 2013
    Posts:
    31
    I tried to use the
    file:
    scheme in Unity 2018.3.0f2. I made a bare git repository (No working directories) locally and can't get it to be recognized. Here's the line I'm putting into my Manifest.json
    "com.frl.versionit": "file:C:\\Test\\VersionIt.git",


    The error says "file: Name or service not known fatal: Could not read from remote repository"
    Screenshot of error message: https://imgur.com/tCgh0Km


    A clone of the repo works fine:
    "com.frl.versionit": "file:C:\\Test\\VersionIt.gitClone",


    Any ideas what I'm doing wrong?
     
    Last edited: Feb 6, 2019
  2. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    345
    Hi @ShawFeatherly,

    The local git package scheme you use is not supported for the moment. For the meantime, you need to use this scheme
    file:///C:\\Test\\VersionIt.git
    (or
    file://localhost/C:\\Test\\VersionIt.git
    if you prefer the explicit form).

    Regards,

    Pascal
     
  3. Skjalg

    Skjalg

    Joined:
    May 25, 2009
    Posts:
    128
    @okcompute_unity I cant get the SCP style pattern to work.

    "com.mycompany.library": "git@bitbucket.org:mycompany/my-package.git",

    Code (CSharp):
    1.   Project has invalid dependencies:
    2.     my-package: Version 'git@bitbucket.org:mycompany/my-package.git' is invalid. Expected a 'SemVer' compatible value or a value starting with 'file:', 'http:', 'https:', 'git:' or 'ssh:'.
    3.  
    But if I add ssh:// to the path like this:

    "com.mycompany.library": "ssh://git@bitbucket.org:mycompany/my-package.git",

    Then I at least get a git error
    Code (CSharp):
    1.   Project has invalid dependencies:
    2.     my-package: Error when executing git command. ssh: Could not resolve hostname bitbucket.org:mycompany: Name or service not known
    3.     fatal: Could not read from remote repository.
    4.     Please make sure you have the correct access rights
    5.     and the repository exists.
    Even though I do have access rights (its a private repo on bitbucket, but i have ssh key for it). I know this because if I open command prompt and type git clone infront of it it works just fine

    C:\Users\skjal>git clone git@bitbucket.org:mycompany/my-package.git
    Cloning into 'my-package'...

    This is tested on Unity 2018.3 and 2019.1.b02. What am I doing wrong? Is it the git url-parsing which is removing the last bit of the url?


    edit; It worked when i changed it to git@bitbucket.org/mycompany/my-package.git (replacing the : with /)
     
    Last edited: Feb 7, 2019
  4. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    345
    @Skjalg You hit the other format that we don't support at this time. For now, SCP and local file: scheme are not supported :(. Sorry about that. As you discovered, in the meantime, you can resort to the SSH scheme URL.

    Regards,

    Pascal
     
  5. Skjalg

    Skjalg

    Joined:
    May 25, 2009
    Posts:
    128
    Yeah thats perfectly fine. What I'd consider a bug though is the : vs / issue in the url
     
  6. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    345
    The ":" is not valid in an SSH URL. Only with SCP type URL.
     
  7. keenanwoodall

    keenanwoodall

    Joined:
    May 30, 2014
    Posts:
    545
    What's the plan for package dependencies on assets published to the Asset Store. Will Unity ever support dependencies that reference git repos being published on the Asset Store? I saw you have to have git installed for it to work (makes sense.) Is the final package manager going to ship with some internal version of git, or is using git repos as dependencies only something to be used outside the context of the Asset Store?
     
  8. keenanwoodall

    keenanwoodall

    Joined:
    May 30, 2014
    Posts:
    545
    I'd understand if external packages aren't allowed in stuff published to the asset store b/c you can't moderate it easily, but it would be nice :)
     
  9. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    60
    Hi @keenanwoodall,

    That's correct. At this time, we have no plans to allow packages to be published with dependencies other than on other packages from the registry. This is both a matter of security and stability.

    Due to how Asset Store contents are imported in a project, and the lack of metadata about these contents, it's currently impossible to know if a given Asset Store asset is present or not, or the version of that asset. The Asset Store package format will in time be migrated to the new format, so that it is possible to reference Asset Store contents from packages.
     
    MrMatthias and keenanwoodall like this.
  10. keenanwoodall

    keenanwoodall

    Joined:
    May 30, 2014
    Posts:
    545
    Makes sense. What's the policy for having dependencies to official Unity packages? What about preview packages? I haven't seen anything on the Asset Store that depends on Burst or Mathematics yet. I've been working on an asset for a long while that has the Mathematics and Burst packages as dependencies. I'm assuming I won't even have a ability to publish the asset until the packages are out of preview?
     
  11. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    60
    The Asset Store packages haven't been integrated with the new package ecosystem yet. We are working on preparing a transition from one system to the other; the details of the process will be publicly announced and documented once we reach the point where we can move forward with that. I can't give you more details at this time, unfortunately.

    Regarding your asset, as of today, you could publish your asset to the Asset Store and document the manual steps required to add the Burst and Mathematics dependencies. Preview packages can be used just the same as official packages, they're just potentially more likely to change between versions and possibly less tested, so we don't recommend using them for actual production.
     
    keenanwoodall likes this.
  12. keenanwoodall

    keenanwoodall

    Joined:
    May 30, 2014
    Posts:
    545
    Good to know, thanks! :)
     
  13. Kalle-Jillheden

    Kalle-Jillheden

    Joined:
    Jan 21, 2015
    Posts:
    8
    @okcompute_unity
    Heyo will there be support for recursive dependencies as well? Such as if I have a dependency added via UPM for a git link to `"com.example.projB": "https://github.com/example/projB"`, and that project itself has listed `"com.example.projB": "https://github.com/example/projA"` as a dependency in its package.json they both will be downloaded by the UPM.

    My testing leads me to believe this is not the case at the moment. I tested on 2018.3.6f1 and it gave the error `Package has invalid dependencies. Version 'https://github.com/example/projA.git' is invalid. Expected a 'SemVer' compatible value`

    Obviously tested on proper repositories and not example/projA and projB. They're just substitution for simplicity and censoring sake.
     
  14. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    60
    Correct. As you have found out, packages cannot themselves declare a dependency on anything other than an officially published version. We don't have any plans to allow dependencies on unofficial sources for the time being but this design might be revisited at a later date. Please note that I cannot confirm we'll do it, nor (obviously) provide an ETA.