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

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)

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…

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

  • Project settings belong to ProjectSettings/*
  • User facing settings in the GUI should be accessible via API as well
1 Like

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: Unity's addressables project config API is private. This hack provides a public API for some parts of the ProjectConfigData and can be easily extended. · GitHub )

2 Likes

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 @davidla_unity 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.

2 Likes

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.

2 Likes

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!

I’ll flag this for the team to review.

1 Like

Team are looking at ways to make this more flexible, and have made it a higher priority for you guys. :slight_smile:

4 Likes

any news about this feature? Is there some place where we can track that issue/ticket?

1 Like

Currently no, but it is in the team’s “high bucket” of things to do. Holidays are slowing things up a bit.

1 Like

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.

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).

1 Like

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.

2 Likes