Search Unity

Unity 2019.2 - Support for local packages in hidden folders inside Assets

Discussion in 'Package Manager' started by sp-ivan-hernandez, Aug 1, 2019.

  1. sp-ivan-hernandez

    sp-ivan-hernandez

    Joined:
    May 26, 2014
    Posts:
    3
    In our unity projects we work with a submodule for sharing code, located in the Assets/Plugins folder.

    We wanted to make some of this code optional and we decided to start splitting it into assemblies and move those assemblies to packages.

    The packages created were moved to a hidden folder Assets/Plugins/Packages~ in order to add them using the file:/ protocol. We want them in this location because we want them to belong to the submodule.

    All this setup was working fine in 2019.1, but we can not upgrade to 2019.2 because of:

    Package Manager: A local package (using the file:/ protocol) is no longer allowed to reference a sub folder inside "Assets", "Library" or "ProjectSettings".

    Why this restriction? Could you make exceptions with hidden folders in the Assets folder at least?
     
  2. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    556
    I'm sorry this breaks your flow. This decision was a case of balancing potential harm that users can bring on themselves by trivially misusing custom packages vs supporting exceptions for edge cases.

    The reason why these restrictions were added is that the risk of problems arising from someone having a package under Assets or ProjectSettings would lead to double-importing assets (unless the path included a "hidden" folder, as in your case; a subtle exception that is hard to communicate clearly), which would result in all sorts of unexpected errors.

    As for the Library folder, users should never put any content in there as a general rule. (From https://docs.unity3d.com/Manual/BehindtheScenes.html: "All the data for Unity’s internal representation of your assets is stored in the Library folder which can be thought of as similar to a cache folder. As a user, you should never have to alter the Library folder manually and attempting to do so may affect the functioning of the project in the Unity editor.")

    In your case, there are a few ideas for workarounds:
    • You could move the submodule to a different location outside of Assets (but I presume this wouldn't work because of Plugins that need to be there).
    • You could have a second submodule dedicated to packages, and move it up a couple levels, e.g. in a directory "SharedPackages" in the project root.
    • You could even consider tracking each package as their own repo, and only add those you need in the project under
      "Packages/<package-name>"
      rather than pulling all packages all the time and only wiring in a subset. Note that packages directly located under "Packages" are implicitly added as dependencies, without specifying in the project manifest.json file.
     
  3. sp-ivan-hernandez

    sp-ivan-hernandez

    Joined:
    May 26, 2014
    Posts:
    3
    @maximeb_unity none of those workarounds suit for us (we a lot of projects working with the current setup). So, the only acceptable solution is to allow file:/ protocol to allow hidden folders in the Assets folder.

    How can we request this feature?
     
  4. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    556
    We've logged in in our backlog and will be considering it for an upcoming release.
     
  5. sp-ivan-hernandez

    sp-ivan-hernandez

    Joined:
    May 26, 2014
    Posts:
    3
    Unity 2019.2.5f1 still has this issue.
     
    Ferran_SP and sp-manuel-alvarez like this.
  6. samuelb_unity

    samuelb_unity

    Unity Technologies

    Joined:
    Nov 13, 2017
    Posts:
    151
    Unfortunately this feature has not yet been prioritized but it remains in our backlog
     
  7. Ferran_SP

    Ferran_SP

    Joined:
    Jul 9, 2018
    Posts:
    27
    Hi,
    is there any update on this?
    We'll be stuck in 2019.1 unless we're able to have these local packages inside a hidden folder.
    This is blocker for us.
     
  8. sp-LeventeLajtai

    sp-LeventeLajtai

    Joined:
    Jul 11, 2019
    Posts:
    10
    Hi,

    I don't think this is a very good reason to block a perfectly valid use case. Users will always get themselves into trouble if they want to, warning them in the manual to not add a package under Assets or ProjectSettings folders should be enough. There are many examples of such restrictions in Unity that the users need to follow, this would just be one more.
    Meanwhile, allowing to use hidden folders with file:/ protocol would allow using newer versions of Unity for those who want to, and would probably even simplify the code on Unity side (no special handling for "hidden" folders needed). That seems to be a win-win for me.
     
  9. okcompute_unity

    okcompute_unity

    Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    756
    Hi guys,

    I would suggest you contact your account manager to get this feature bumped in priority.

    Regards,

    Pascal