After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 779240 - build preferences changes are not saved
build preferences changes are not saved
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: preferences
3.23.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-02-26 02:32 UTC by Mohammed Sadiq
Modified: 2017-05-18 01:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
configuration: Make the default config persist (27.22 KB, patch)
2017-05-17 23:15 UTC, Matthew Leeds
accepted-commit_now Details | Review

Description Mohammed Sadiq 2017-02-26 02:32:14 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
Comment 1 Mohammed Sadiq 2017-03-13 07:05:30 UTC
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
Comment 2 Matthew Leeds 2017-03-14 02:51:03 UTC
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).
Comment 3 Christian Hergert 2017-03-14 04:28:25 UTC
We should try to persist the fallback configuration to .buildconfig at least. Otherwise there is no way to create an initial .buildconfig.
Comment 4 Christian Hergert 2017-03-14 04:29:06 UTC
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.
Comment 5 Matthew Leeds 2017-05-17 23:15:05 UTC
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).
Comment 6 Christian Hergert 2017-05-18 00:03:00 UTC
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.
Comment 7 Matthew Leeds 2017-05-18 01:41:45 UTC
Pushed as commit 39997b296