File tree 1 file changed +31
-1
lines changed
1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change 23
23
QVariant ,
24
24
)
25
25
from time import sleep
26
+ from traceback import print_exc
26
27
27
28
28
29
class LinkerType (IntEnum ):
@@ -81,9 +82,38 @@ def _run(self: Self) -> int:
81
82
82
83
if result .returncode == 0 :
83
84
output : str = result .stdout .decode ('utf-8' ).strip ()
84
- [data_size , _ , _ ] = parse ("{} + {} = {}" , output )
85
+ data_size : Optional [float ] = None
86
+ parsed : bool = False
87
+
88
+ # Attempt to parse Cold output format.
89
+ try :
90
+ [data_size , _ , _ ] = parse (
91
+ "{} + {} = {}" ,
92
+ output ,
93
+ )
94
+ parsed = True
95
+ except :
96
+ pass
97
+
98
+ # Attempt to parse Crinkler output format.
99
+ lines : List [str ] = list (filter (
100
+ lambda line : line .lstrip ().startswith ("Ideal compressed size of data:" ),
101
+ output .splitlines (),
102
+ ))
103
+ if len (lines ) != 0 :
104
+ [data_size ] = parse (
105
+ "Ideal compressed size of data: {}" ,
106
+ lines [0 ].lstrip ().rstrip (),
107
+ )
108
+ parsed = True
109
+
110
+ if not parsed :
111
+ print ("Could not parse build output:" )
112
+ print (output )
113
+
85
114
self ._versions [hash ] = data_size
86
115
except :
116
+ print_exc ()
87
117
self ._versions [hash ] = 'Errored'
88
118
self .built .emit (self )
89
119
You can’t perform that action at this time.
0 commit comments