Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[feature request] Symbolic link support for package manager

Discussion in 'Package Manager' started by xlemaitre-poc, May 15, 2019.

  1. xlemaitre-poc

    xlemaitre-poc

    Joined:
    Mar 10, 2016
    Posts:
    2
    Hello,

    Would it be possible to add (Windows) symbolic link support for the package manager on the "Packages" directory or at least on the "manifest.json" file ?

    We are working on multiplayer Unity projects and it has been proven to be efficient to clone our Unity projects by using symbolic link feature for multiplayer debugging with 2 Unity Editor instances running on the same project (in 2 different directories) or even to be able to work on 2 different plateforms using the same base code.

    We used to create symbolic links on "Assets" & "ProjectSettings" folders only, but since the use of the packages we have to copy the Packages directory and its manifest.json file into the directory of the clone project.

    Code (output):
    1. Directory of "Project"
    2. <DIR>          .
    3. <DIR>          ..
    4. <DIR>          Assets
    5. <DIR>          Library
    6. <DIR>          Packages
    7. <DIR>          ProjectSettings
    8.  
    9. Directory of "ProjectClone"
    10. <DIR>          .
    11. <DIR>          ..
    12. <SYMLINKD>     Assets [..\Project\Assets]
    13. <DIR>          Packages
    14. <SYMLINKD>     ProjectSettings [..\Project\ProjectSettings]

    We would love to only have to create another symbolic link to the "Packages" directory instead. For now it's not working and the Package Manager blocks the loading of the project because it cannot detect the files needed through the symbolic link.

    Regards,
     
    zetaFairlight likes this.
  2. mathieur

    mathieur

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    31
    I believe this is because on windows symlink will act as a file. So what you would need would be a junction, which you can create using mklink /J Packages PackagesXYZ, for example. I just tried it locally and it seems to work for what you are trying to do.
     
  3. xlemaitre-poc

    xlemaitre-poc

    Joined:
    Mar 10, 2016
    Posts:
    2
    Ok thanks!

    Working fine for us. I'm just a little bit perplex on why the Package Manager is not supporting the same filesystem features than Unity Editor as it's working fine with classic symlink on folders "Assets" & "Packages", so i would maintain my feature request ;)

    And we still have to try if Package Manager can work with hardlink on MacOSX ( https://github.com/selkhateeb/hardlink ) as we are using a Mac as a build machine with the same project cloning mechanism. If you already have a clue, please share ;)

    Regards,
     
  4. cjackcandy

    cjackcandy

    Joined:
    Sep 8, 2013
    Posts:
    23
    This doesn't work for me. Package Manager just ends up creating 2 copies of the asset package. Using your example above, if I download an asset using Package Manager, it will be downloaded to both Packages and PackagesXYZ. In my specific case my command reads: mklink /J "c:\users\myusername\AppData\Roaming\Unity\Asset Store-5.x" E:\UnityAssetStorePackages
    Then, when downloading an asset package inside Package Manager, I end up with package copies in both locations. Also if I move all my packages from c:\...\Asset Store-5.x to e:\UnityAssetStorePackages, next time I run Package Manager, it copies them all back to c:\...\Asset Store-5.x.