Search Unity

Can I configure the location of the packages cache?

Discussion in 'Package Manager' started by cxode, May 6, 2018.

  1. Hypertectonic

    Hypertectonic

    Joined:
    Dec 16, 2016
    Posts:
    75
    I voted. There's now a grand total of 9 votes (which btw should be 21 if you counted everyone that asked in this thread). The issue might as well not exist. Nobody ever has the time to go through all possible issues to vote, most users will never see the issue and therefore never vote, even if this and many other issues affects them. Relying only on the voting system is an incredibly bad idea.

    This issue is relevant to at least 50% of Unity users. So many softwares love to treat your C drive as their own personal garbage dump and never ask for permission, it's a constant battle that has only grown worse with SSDs. Currently I have a bunch of projects in this computer ranging from 2018.3 to 2021.1. This means that for my most used packages there probably are 7 or 8 versions for each in the package cache, perhaps more since I don't know when (if ever) older versions get deleted.

    This is a basic quality of life issue that should be prioritized, not languish in issue tracker hell for another 3 years. It's common sense.

    You wouldn't happen to have that publicly available? I actually reached this thread trying to figure out how to use the Package Manager API so I could automate the importing of my most commonly used assets, assuming that since the asset store is now all in the package manager, there would be an API to search and grab them, but it seems to only work with *Unity* packages. Silly me to expect basic functionality to be present...
     
    Marc-Saubion and BackseatGaming like this.
  2. Noisecrime

    Noisecrime

    Joined:
    Apr 7, 2010
    Posts:
    2,054
    Not currently, though I always planned on releasing it at some point, but i'm unsure how helpful it would be for others.

    The one main drawback currently is that it is unable to check for newer asset store package versions. It does report the version number and published date, so for myself its easy to simply check the asset store ( clicking on the package name in my editor will show a popup where you can view the asset directly in the asset browser or in a Internet browser window ).

    At one point I tried hooking into the Unity web api to try and determine if a package had a newer version but I couldn't get it to work. More recently i'd planned to examine the package manager code and see if there was any exposed or even internal api for doing that, but haven't had the time. Initially I was also hopeful that providing the assets store packages in the package manager might make my editor tool redundant, but my experience with it was appalling bad to the point I've not tried it again.

    If you are on github I could make a private repro for you to test with, pm me with your username and email, either here or i guess you can do that on github ( i have some repros in my sig ).

    EDIT:
    Have released the Unity AssetStoreOrganizer editor tool on github.
    Please check the read me to learn how to use it and what features it has.
     
    Last edited: Mar 23, 2021
    Hypertectonic and christh like this.
  3. c_Yosuke

    c_Yosuke

    Joined:
    Feb 12, 2021
    Posts:
    1
    Same issue here : small SSD C:/ drive for executables, big magnetic drive for content.
    I voted for the feature request. Managing drives appears to me as a basic software setting.
     
    christh likes this.
  4. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    It would seem that Unity still doesn't clean up after itself...

    12GB in AppData\Local\Unity
    0.5GB in AppData\Roaming\Unity (and that is because I cleaned the asset store downloads already)

    Why do packages even reside on our drives? Can't you just download them on demand?

    Then you have the editors:

    4.8GB for 2020.3
    4.1GB for 2019.4
    2.7GB for 2018.4

    Unity has grown FAT AND SLOW.

    I Just finished setting up my new pc a: 5900x with a High end SSD and 64GB of ram and unity editor is still freezing all the time to do "stuff" on the main thread. It's a real pain in the ass.

    2017 is the last version I remember using that didn't feel like an Autodesk bloatware.

    The similarities are staggering.
     
    christh and zetaFairlight like this.
  5. It would be very bad to download them every time when you create a new project and install it. We need to be able to choose where to put it, not abolish it.
     
  6. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    It's nearly July 2021 and this still hasn't been fixed. No wonder UE is eating Unity's lunch. Developer UX PEOPLE!!!
     
  7. UnityMaru

    UnityMaru

    Community Engagement Manager PSM

    Joined:
    Mar 16, 2016
    Posts:
    1,227
    Hey there, sincere apologies for the delays on this one. I've chat to the team to get an update on this who advise me that they are still exploring adding this but there's no timeframe on when this will be done.
     
  8. cxode

    cxode

    Joined:
    Jun 7, 2017
    Posts:
    268
    Is it reasonable to consider this as evidence that Unity development is horrendously inefficient, disorganized, and bad at choosing priorities? It's been three years.

    I mean, seriously? Y'all can't even add a command-line flag for it? That's gotta be like 2 lines of code...
     
  9. BigSteph71

    BigSteph71

    Joined:
    Apr 6, 2021
    Posts:
    4
    Guys, seriously?
     
  10. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569
    I'd like to understand the thinking that led them to decide this wasn't important:

    1. No workaround that isn't technically challenging
    2. Affects people through no direct action of their own (just use Unity normally long enough on a typical PC with an SSD system drive)
    3. Affects new users and inexperienced users (who are maybe possibly more likely to have a machine configured with a small SSD system drive)
    4. Side effects are widespread (affects the whole system), severe (many apps fail randomly) and hard to diagnose (error messages rarely say "your system drive is nearly full" - instead you get messages about temp files, or just a sudden force close)

    My only conclusion is that the Unity team responsible use the criteria "Does it affect me?" to decide on the priority of a fix.

    And this is most certainly a fix - not a new feature. This should never have been designed this way.
     
    jawasjnsdjn, PaulRdy and cxode like this.
  11. TieSKey

    TieSKey

    Joined:
    Apr 14, 2011
    Posts:
    225
    My regular search engine led me to this post, yup, another usability bug (it's a bug not a missing feature) that has not been solved after several years.

    That being said, kudos to UnityMaru and the other unity folks that at least care to reply to the thread even if they don't bring good news. All other teams (I'm looking at u DOTS) should learn from u guys.


    My work around for this (and a lot other issues with how AppData is used by a lot of software makers) was to move the entiry user profile folder to a secondary drive and have only 1 symlink. As a side effect this makes it a lot more easy and safe to keep your entire user profile between windows installations :p
     
    cxode likes this.
  12. Noisecrime

    Noisecrime

    Joined:
    Apr 7, 2010
    Posts:
    2,054
    FYI
    Whilst checking the known issues for 2019.4.29 I noticed an entry for UPM and AssetStore Package locations that had an issue tracker link which led to this page.

    It states that a fix is planned for 2019.4.x, 2020.3.x, 2021.1.x, 2021.2.x which taken at face value is great news as it means it might actually happen soon.

    If you want to you can add more votes to the issue by going to the page and voting.
     
    cxode likes this.
  13. kkaehler

    kkaehler

    Joined:
    Nov 15, 2016
    Posts:
    11
    I'm thoroughly confused.. same as everyone else here, my C: drive is running full. After some searching I came across the UPM_CACHE_ROOT env variable, but setting this or UPM_CACHE_PATH doesn't seem to have any effect.

    See https://docs.unity3d.com/2021.1/Documentation/Manual/upm-config.html#cacheconfig

    So, is this broken or (contradicting the docs) not implemented at all? I've voted on the issue mentioned above, but still wondering if it's a different problem.
     
  14. UnityMaru

    UnityMaru

    Community Engagement Manager PSM

    Joined:
    Mar 16, 2016
    Posts:
    1,227
    While I cant relay an exact ETA on when this will be fixed, I can say that this has been worked on for some time to improve, so this shouldn't be a thing forever.
     
    Noisecrime likes this.
  15. april_4_short

    april_4_short

    Joined:
    Jul 19, 2021
    Posts:
    489
    Narrators Voice: "...but it probably will be..."
     
  16. ZhavShaw

    ZhavShaw

    Joined:
    Aug 12, 2013
    Posts:
    173
    I genuinely feel for you.. Having to be the in-between for a feature that you know is great, but being told to tell everyone it's still not a priority.
     
    BanicaTom likes this.
  17. cathyma

    cathyma

    Unity Technologies

    Joined:
    May 5, 2021
    Posts:
    10
    Hello everyone, the ability to configure Package Manager cache settings has been a missing feature in the product, we recognized that. This is currently getting worked on. Since we are now tracking this as feature work rather than a bug, we are closing this record. Nonetheless, please rest assured that this work is happening and will be released as soon as possible. Please follow the status of the card on Package Manager’s public roadmap : https://portal.productboard.com/nzg7uvh3wm9nomkscvhixtbt/c/780-package-manager-cache-settings
     
    critterman, Ariku64, christh and 3 others like this.
  18. OccularMalice

    OccularMalice

    Joined:
    Sep 8, 2014
    Posts:
    169
    I really hope the way you've worded this is what we're asking for. "Flexibility to choose which cache settings that fit your project setup for UPM & asset store packages" sounds very vague to me. What I'm hoping is some setting in the Unity editor (or hub) where I can pick a directory where my downloaded packages go. 4 years on and we're still waiting for a fairly common sense setting.
     
  19. leozzyzheng2

    leozzyzheng2

    Joined:
    Jul 2, 2021
    Posts:
    63
    I believe even the feature is completed, you will never have a chance to use it because they rarely backport new feature to old version Unity which you are using and can't upgrade to the new version.
     
  20. PrithviNayak

    PrithviNayak

    Joined:
    Jul 5, 2017
    Posts:
    1
    2022 same problem
     
  21. 2022 has the config.
    screenshot.png
     
    bn-l, OccularMalice and christh like this.
  22. OccularMalice

    OccularMalice

    Joined:
    Sep 8, 2014
    Posts:
    169
    I'm glad this made it into 2022 however that's a year away until LTS. When/if can we expect to see this in 2021 or earlier versions?
     
    BanicaTom likes this.
  23. Parallax

    Parallax

    Joined:
    May 23, 2015
    Posts:
    39
    Can we manually remove packages from the cache without blowing up the application?
     
  24. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569
    Yeah. I regularly delete the whole cache whenever I start to feel my disk space should belong to me a bit more than it belongs to Unity.

    It just means Unity recreates what it needs when it needs. Generally speaking any folder called "cache" *should* be safe to delete (assuming the developer is remotely competent)
     
  25. Papeczek

    Papeczek

    Joined:
    Feb 2, 2020
    Posts:
    2
    almost 2023, still obvious feature not available
     
  26. cxode

    cxode

    Joined:
    Jun 7, 2017
    Posts:
    268
    Incorrect, it was finally released in 2022.1, as noted two posts up from yours. Better embarrassingly late than never.
     
  27. bn-l

    bn-l

    Joined:
    Aug 27, 2022
    Posts:
    7

    I want to thank you. I spent a long time googling "unity cacheRoot toml", "unity cacheRoot upmconfig". I had an error with my .toml file when unity would open it and try to parse it. Error said:

    [Package Manager Window] Cannot perform upm operation: The file [C:\Users\me\.upmconfig.toml] is not valid TOML: Invalid character in unicode sequence, expected hex at row 1, col 19, pos 18:

    I spent a long time looking at this doc page: https://docs.unity3d.com/Manual/upm-config-cache.html#upmconfigUser

    It turns out I was using backslashes in my path variable for cacheRoot.

    So I had:
    cacheRoot = "E:\UnityCache"

    instead of
    cacheRoot = "E:/UnityCache"


    Edit: I found this thread by translating this tweet written in japanese: https://twitter.com/rijicho_nl/status/1538211443149250561?lang=en

     
    Last edited: Dec 20, 2022
  28. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    556
    Hi @bn-l ,

    I'm sorry you ran into this issue. The documentation can indeed be clarified. I'll make sure we improve it.

    In TOML (just like JSON and YAML too), strings allow representing characters like new lines, tabs or any Unicode characters in the string by using escape sequences. New lines are represented with
    \n
    , tabs with
    \t
    and arbitrary Unicode characters with
    \U########
    , where
    ########
    represents the Unicode character whose ID is ########.

    The problem you ran into is that you copied the Windows path without escaping
    \
    characters into
    \\
    , so every occurrence of
    \
    introduced an escape sequence identified by the following character. Like I mentioned above,
    \U
    is recognized as a Unicode escape sequence, therefore it was expecting 8 digits after it. Your solution (using
    /
    instead of
    \
    ) is a good one because Windows supports either; the other option would be to double all backslashes, e.g.
    E:\\UnityCache
    .

    (Edited: TOML Unicode escape sequences are \u#### (lowercase u, 4 digits) or \U######## (uppercase U, 8 digits). Source: https://toml.io/en/v1.0.0#string)

    This will be clarified in the documentation.
     
    Last edited: Jan 24, 2023
    bn-l likes this.