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

1.16.6: Project settings stored in Library, not accessible via API etc

Discussion in 'Addressables' started by einWikinger, Oct 19, 2020.

  1. einWikinger

    einWikinger

    Joined:
    Jul 30, 2013
    Posts:
    97
    tl;dr below.

    This just has been such a huge "facepalm head-desk" moment for me after updating addressables to 1.16.6.
    Here's a little story.

    I was really exited to see
    • Added detailed build layout feature. See documentation for details.
    in the changelog! Finally, more data to analyze how/why builds are laid out the way they are!
    I updated the package, got into the Project Settings and set the checkmark for the build layout report.
    I tried to commit the changed project settings into our VCS. But - no changed files! I saved the project, closed the editor... still no changed files. "Where is this setting stored?" shot through my mind.
    I started my journey through the addressables source, just to find...

    (Okay sorry, I have to correct myself here, it's actually an editor preference and not a project settings, so I guess my whole rant about this just doesn't have an argument behind it anymore)

    Code (CSharp):
    1. dataPath += "/Library/AddressablesConfig.dat";
    I couldn't believe my eyes. It's like... just violating everything. Now suddenly, project data is stored in the Library folder. If this is starting to gain traction, we suddenly need to put the Library folder under source control just to ensure we don't miss anything you could put there thats actually belonging (conceptually) into Assets or ProjectSettings. I really don't like to believe this and instead think it's just some mishap because of shortsightedness but nonetheless this is sets a really bad example.
    (But the API part still applies...)

    Now, actually, it wouldn't be so bad if we could still change the flag programatically because it only matters within specific build environments. I guess you guys already now a lot of us (especially working on larger projects) have some sort of CI setup. So I thought as a work around whilst waiting for the settings issue to be sorted out I could just change the flag before we build our bundles but...

    Code (CSharp):
    1. class ProjectConfigData {...}
    It's private. Yeah I know I can now go in and do a asmref hack to get access to the flag from within our own assemblies (like we have to do for the shadergraph package) but that just can't be the way. Seriously, if there is a user-facing setting that *can be changed* why is the API path blocked off? The package isn't verified, it's not stable, etc. so we know our risk of changing API but that's easier to deal with than trying to get all these workarounds into place just to tear them off later on.

    This made me really furious because it's just a pattern that seems to repeat itself over and over again.

    So tl;dr
    1. Project settings belong to ProjectSettings/*
    2. User facing settings in the GUI should be accessible via API as well
     
    Last edited: Oct 19, 2020
    ImpossibleRobert likes this.
  2. einWikinger

    einWikinger

    Joined:
    Jul 30, 2013
    Posts:
    97
    As a bonus, we also can't set "ignoreUnsupportedFilesInBuild" for our builds. This is an epic fail. The feature exists, but you can't use it. And something deep deep in my brain really doesn't want to check in the AdressablesConfig.dat in the Library folder. Really doesn't want to. May be my OCD and I may just say "Whatever." and commit it anyways.

    (I opted for the "hack" for now and injected a public API wrapper myself. To anyone having the same issues as me here is my workaround: https://gist.github.com/zsoi/cc91e1fba22cf4e82f5420e9e5aeceb3 )
     
    Last edited: Oct 19, 2020
    futurlab_peterh and OrioliBublar like this.
  3. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    521
    I want to chime in the part with the "ignoreUnsupportedFilesInBuild". I also brought this already up but did not receive any reply yet. I really hope @DavidUnity3d or @TreyK-47 can chime in and bring this to the attention of the team. Having GUI settings, especially this one as I waited a long time to finally be able to upgrade, suddenly not accessible in a private class, is really really bad design. I hope the team can quickly fix this. It should never have happened to be honest though.
     
    futurlab_peterh and einWikinger like this.
  4. OrioliBublar

    OrioliBublar

    Joined:
    Jun 28, 2017
    Posts:
    5
    I would also like to +1 this issue, I have raised it as a bug on the issue tracker as well, it goes contrary to best practices for version control. Providing an API way of changing the config would also be great since then we could control the flag and similar settings via environment variables in our build pipeline.
     
    futurlab_peterh and einWikinger like this.
  5. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    521
    Are there any news on this? I have now released 1.16.7 to my users and everything can be automated except this one setting which sticks out like a sore thumb and I now need to add this to the guide for project setup.So far users never had to care knowing anything about addressables. Please bring an API for this setting!
     
  6. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,816
    I'll flag this for the team to review.
     
    ImpossibleRobert likes this.
  7. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,816
    Team are looking at ways to make this more flexible, and have made it a higher priority for you guys. :)
     
  8. gnp89

    gnp89

    Joined:
    Jun 25, 2012
    Posts:
    36
    any news about this feature? Is there some place where we can track that issue/ticket?
     
    ImpossibleRobert likes this.
  9. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,816
    Currently no, but it is in the team's "high bucket" of things to do. Holidays are slowing things up a bit.
     
    ImpossibleRobert likes this.
  10. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    521
    I checked the 1.17.0-preview as it states the option is now in "settings". This is correct, but still inaccessible due to being marked internal.
     
  11. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    762
    So currently we only have it exposed through the UI but are going to expose it further with our next minor version bump (should be 1.18.0-preview).
     
    ImpossibleRobert likes this.
  12. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    521
    I just tried the 1.17.2-preview and Eureka! It works great now and at least for me no issues so far. Thanks a lot for adding so many items to the public API.
     
    futurlab_peterh and TreyK-47 like this.