[Notes] [Git][BuildStream/buildstream][bschubert/pipeline] 2 commits: fixup! fixup! fixup! fixup! fixup! fixup! WIP: notes



Title: GitLab

Benjamin Schubert pushed to branch bschubert/pipeline at BuildStream / buildstream

Commits:

6 changed files:

Changes:

  • buildstream/_pipeline.py
    ... ... @@ -135,9 +135,6 @@ class Pipeline():
    135 135
                     # Preflight
    
    136 136
                     element._preflight()
    
    137 137
     
    
    138
    -                # Determine initial element state.
    
    139
    -                element._update_state()
    
    140
    -
    
    141 138
         # dependencies()
    
    142 139
         #
    
    143 140
         # Generator function to iterate over elements and optionally
    

  • buildstream/_scheduler/queues/buildqueue.py
    ... ... @@ -106,11 +106,6 @@ class BuildQueue(Queue):
    106 106
             # Inform element in main process that assembly is done
    
    107 107
             element._assemble_done()
    
    108 108
     
    
    109
    -        if element.is_workspaced:
    
    110
    -            # Update the state of all reverse dependencies
    
    111
    -            for reverse_dependency in element.reverse_build_dependencies(recurse=True):
    
    112
    -                reverse_dependency._update_state()
    
    113
    -
    
    114 109
             # This has to be done after _assemble_done, such that the
    
    115 110
             # element may register its cache key as required
    
    116 111
             #
    

  • buildstream/_scheduler/queues/fetchqueue.py
    ... ... @@ -69,7 +69,7 @@ class FetchQueue(Queue):
    69 69
             if status == JobStatus.FAIL:
    
    70 70
                 return
    
    71 71
     
    
    72
    -        element._update_state()
    
    73
    -
    
    72
    +        element._fetch_done()
    
    73
    +        
    
    74 74
             # Successful fetch, we must be CACHED now
    
    75 75
             assert element._get_consistency() == Consistency.CACHED

  • buildstream/_scheduler/queues/trackqueue.py
    ... ... @@ -59,6 +59,3 @@ class TrackQueue(Queue):
    59 59
                 source._save_ref(new_ref)
    
    60 60
     
    
    61 61
             element._tracking_done()
    62
    -
    
    63
    -        for rdep in element.reverse_build_dependencies(recurse=True):
    
    64
    -            rdep._update_state()

  • buildstream/_stream.py
    ... ... @@ -1018,17 +1018,6 @@ class Stream():
    1018 1018
     
    
    1019 1019
             _, status = self._scheduler.run(self.queues)
    
    1020 1020
     
    
    1021
    -        # Force update element states after a run, such that the summary
    
    1022
    -        # is more coherent
    
    1023
    -        try:
    
    1024
    -            for element in self.total_elements:
    
    1025
    -                element._update_state()
    
    1026
    -        except BstError as e:
    
    1027
    -            self._message(MessageType.ERROR, "Error resolving final state", detail=str(e))
    
    1028
    -            set_last_task_error(e.domain, e.reason)
    
    1029
    -        except Exception as e:   # pylint: disable=broad-except
    
    1030
    -            self._message(MessageType.BUG, "Unhandled exception while resolving final state", detail=str(e))
    
    1031
    -
    
    1032 1021
             if status == SchedStatus.ERROR:
    
    1033 1022
                 raise StreamError()
    
    1034 1023
             elif status == SchedStatus.TERMINATED:
    

  • buildstream/element.py
    ... ... @@ -454,13 +454,13 @@ class Element(Plugin):
    454 454
                 yield from self.__reverse_build_dependencies
    
    455 455
                 return
    
    456 456
     
    
    457
    -        visited = set()
    
    457
    +        # visited = set()
    
    458 458
     
    
    459 459
             def recurse_rdeps(element):
    
    460
    -            if element in visited:
    
    461
    -                return
    
    460
    +            # if element in visited:
    
    461
    +                # return
    
    462 462
     
    
    463
    -            visited.add(element)
    
    463
    +            # visited.add(element)
    
    464 464
     
    
    465 465
                 yield element
    
    466 466
     
    
    ... ... @@ -1311,6 +1311,9 @@ class Element(Plugin):
    1311 1311
             for source in self.sources():
    
    1312 1312
                 source._preflight()
    
    1313 1313
     
    
    1314
    +        # Determine initial element state.
    
    1315
    +        self._update_state()
    
    1316
    +
    
    1314 1317
         # _schedule_tracking():
    
    1315 1318
         #
    
    1316 1319
         # Force an element state to be inconsistent. Any sources appear to be
    
    ... ... @@ -1338,6 +1341,9 @@ class Element(Plugin):
    1338 1341
     
    
    1339 1342
             self._update_state()
    
    1340 1343
     
    
    1344
    +        for rdep in self.reverse_build_dependencies(recurse=True):
    
    1345
    +            rdep._update_state()
    
    1346
    +
    
    1341 1347
         # _track():
    
    1342 1348
         #
    
    1343 1349
         # Calls track() on the Element sources
    
    ... ... @@ -1533,10 +1539,16 @@ class Element(Plugin):
    1533 1539
     
    
    1534 1540
             self.__assemble_scheduled = False
    
    1535 1541
             self.__assemble_done = True
    
    1536
    -
    
    1542
    +        # FIXME: only if workspaced
    
    1537 1543
             self._update_state()
    
    1538 1544
     
    
    1539
    -        if self._get_workspace() and self._cached_success():
    
    1545
    +        if self.is_workspaced:
    
    1546
    +
    
    1547
    +            # Update the state of all reverse dependencies
    
    1548
    +            for reverse_dependency in self.reverse_build_dependencies(recurse=True):
    
    1549
    +                reverse_dependency._update_state()
    
    1550
    +
    
    1551
    +        if self.is_workspaced and self._cached_success():
    
    1540 1552
                 assert utils._is_main_process(), \
    
    1541 1553
                     "Attempted to save workspace configuration from child process"
    
    1542 1554
                 #
    
    ... ... @@ -2069,6 +2081,9 @@ class Element(Plugin):
    2069 2081
                     source._fetch(previous_sources)
    
    2070 2082
                 previous_sources.append(source)
    
    2071 2083
     
    
    2084
    +    def _fetch_done(self):
    
    2085
    +        self._update_state()
    
    2086
    +
    
    2072 2087
         #############################################################
    
    2073 2088
         #                   Private Local Methods                   #
    
    2074 2089
         #############################################################
    



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