GNOME Bugzilla – Bug 779240
build preferences changes are not saved
Last modified: 2017-05-18 01:41:45 UTC
Changes made in Build Preferences (Alt-,) seems not saved. I tried to change the Runtime from 'Host operating system' to 'Jhbuild' and restarted gnome-builder. The Runtime have reset to 'Host operating system'. I'm running gnome-builder using jhbuild, if that matters. Thanks
When changing build settings, I get the following log in terminal when run as -vvvv: 12:34:08.0437 ide-build-manager[9070]: MESSAGE: Failed to locate runtime: Operation was cancelled 12:34:09.0225 ide-build-manager[9070]: DEBUG: Cancelling build due to user request 12:34:09.0230 ide-build-manager[9070]: DEBUG: Cancelling build due to user request Thanks
If the configuration you're using is based on a .buildconfig file or a flatpak manifest, it will be persisted by writing back to the respective file. Otherwise it doesn't persist (for example with the Default config).
We should try to persist the fallback configuration to .buildconfig at least. Otherwise there is no way to create an initial .buildconfig.
But only persist if it has been changed, of course. we don't want to start creating those files in everyones project unless they specifically request it.
Created attachment 352049 [details] [review] configuration: Make the default config persist When the build configuration management changed to using IdeConfigurationProviders rather than doing everything in IdeConfigurationManager, the default configuration stopped persisting to the disk (so changes made are only effective during a session). This is because the configuration was being added by the manager as an IdeConfiguration rather than an IdeBuildconfigConfiguration, and IdeBuildconfigConfigurationProvider knows how to read and write ".buildconfig" files. The most obvious solution, creating the default configuration in the IdeBuildconfigConfigurationProvider's load function, doesn't work because the loads are asynchronous and there has to be at least one configuration when the IdeConfigurationManager finishes initializing (otherwise the IdeBuildPipeline will fail to initialize). Instead, the load interface for IdeConfigurationProviders was changed to an async/finish pair, so the IdeConfigurationManager knows when the loads finish. At that point, it can check if a configuration was restored from a .buildconfig file (in which case nothing needs to be done) or if the default configuration was added by the IdeConfigurationManager (in which case the buildconfig provider needs to be informed of it so it can be persisted when changes are made).
Review of attachment 352049 [details] [review]: LGTM. In the future, I hope we can come up with a strategy for adding configurations and then mostly drop the "default" configuration stuff. But this is good.
Pushed as commit 39997b296