[gnome-builder] cargo: create new build target each time



commit 85e9bebb0e3529dfaa1999b7d20538a99e818d19
Author: Christian Hergert <chergert redhat com>
Date:   Wed Feb 6 13:23:16 2019 -0800

    cargo: create new build target each time
    
    We don't control how this is used, or where it is attached to the object
    tree, so just allow the consumer to manage that.
    
    Fixes #802

 src/plugins/cargo/cargo_plugin.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/cargo/cargo_plugin.py b/src/plugins/cargo/cargo_plugin.py
index 248b8e42b..ea2b6e5e9 100644
--- a/src/plugins/cargo/cargo_plugin.py
+++ b/src/plugins/cargo/cargo_plugin.py
@@ -172,7 +172,7 @@ class CargoBuildTarget(Ide.Object, Ide.BuildTarget):
         return 'rust'
 
     def do_get_argv(self):
-        context = self.get_context()
+        context = self.ref_context()
         config_manager = Ide.ConfigManager.from_context(context)
         config = config_manager.get_current()
         cargo = locate_cargo_from_config(config)
@@ -201,7 +201,7 @@ class CargoBuildTargetProvider(Ide.Object, Ide.BuildTargetProvider):
                                          code=Gio.IOErrorEnum.NOT_SUPPORTED))
             return
 
-        task.targets = [build_system.ensure_child_typed(CargoBuildTarget)]
+        task.targets = [CargoBuildTarget()]
         task.return_boolean(True)
 
     def do_get_targets_finish(self, result):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]