author | Dario Sestito <darios@symbian.org> |
Thu, 02 Sep 2010 11:48:45 +0100 | |
changeset 290 | 2ca4533db9fe |
parent 267 | a02973783e64 |
permissions | -rw-r--r-- |
176 | 1 |
# Copyright (c) 2009 Symbian Foundation Ltd |
2 |
# This component and the accompanying materials are made available |
|
3 |
# under the terms of the License "Eclipse Public License v1.0" |
|
4 |
# which accompanies this distribution, and is available |
|
5 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
6 |
# |
|
7 |
# Initial Contributors: |
|
8 |
# Symbian Foundation Ltd - initial contribution. |
|
9 |
# |
|
10 |
# Contributors: |
|
236
08436a227940
Add author information. Reviewed descriptions
Dario Sestito <darios@symbian.org>
parents:
230
diff
changeset
|
11 |
# Dario Sestito <darios@symbian.org> |
176 | 12 |
# |
13 |
# Description: |
|
14 |
# Raptor parser module. |
|
15 |
# Extract, analyzes and dumps raptor recipes i.e. content of <recipe> tags from a raptor log file |
|
16 |
||
17 |
package RaptorRecipe; |
|
18 |
||
19 |
use strict; |
|
20 |
use RaptorCommon; |
|
21 |
||
22 |
our $reset_status = {}; |
|
23 |
my $buildlog_status = {}; |
|
24 |
my $buildlog_recipe_status = {}; |
|
25 |
my $buildlog_recipe_status_status = {}; |
|
26 |
||
27 |
$reset_status->{name} = 'reset_status'; |
|
28 |
$reset_status->{next_status} = {buildlog=>$buildlog_status}; |
|
29 |
||
30 |
$buildlog_status->{name} = 'buildlog_status'; |
|
31 |
$buildlog_status->{next_status} = {recipe=>$buildlog_recipe_status}; |
|
32 |
$buildlog_status->{on_start} = 'RaptorRecipe::on_start_buildlog'; |
|
33 |
$buildlog_status->{on_end} = 'RaptorRecipe::on_end_buildlog'; |
|
34 |
||
35 |
$buildlog_recipe_status->{name} = 'buildlog_recipe_status'; |
|
36 |
$buildlog_recipe_status->{next_status} = {status=>$buildlog_recipe_status_status}; |
|
37 |
$buildlog_recipe_status->{on_start} = 'RaptorRecipe::on_start_buildlog_recipe'; |
|
38 |
$buildlog_recipe_status->{on_end} = 'RaptorRecipe::on_end_buildlog_recipe'; |
|
39 |
$buildlog_recipe_status->{on_chars} = 'RaptorRecipe::on_chars_buildlog_recipe'; |
|
40 |
||
41 |
$buildlog_recipe_status_status->{name} = 'buildlog_recipe_status_status'; |
|
42 |
$buildlog_recipe_status_status->{next_status} = {}; |
|
43 |
$buildlog_recipe_status_status->{on_start} = 'RaptorRecipe::on_start_buildlog_recipe_status'; |
|
44 |
||
45 |
||
46 |
my $filename = ''; |
|
47 |
||
48 |
my $recipe_info = {}; |
|
49 |
||
50 |
my $characters = ''; |
|
51 |
||
52 |
my $CATEGORY_RECIPEFAILURE = 'recipe_failure'; |
|
53 |
my $CATEGORY_RECIPEFAILURE_ARMCC_CANNOTOPENSOURCEINPUTFILE = 'armcc_cannot_open_source_input_file'; |
|
54 |
my $CATEGORY_RECIPEFAILURE_ARMLINK_COULDNOTOPENFILE = 'armlink_could_not_open_file'; |
|
55 |
my $CATEGORY_RECIPEFAILURE_ELF2E32_COULDNOTOPENFILE = 'elf2e32_could_not_open_file'; |
|
56 |
my $CATEGORY_RECIPEFAILURE_ARMAR_FILEDOESNOTEXIST = 'armar_file_does_not_exist'; |
|
57 |
my $CATEGORY_RECIPEFAILURE_ARMCC_CONTROLLINGEXPRESSIONISCONSTANT = 'armcc_controlling_expression_is_constant'; |
|
58 |
my $CATEGORY_RECIPEFAILURE_ARMCC_INTERNALFAULT = 'armcc_internal_fault'; |
|
59 |
my $CATEGORY_RECIPEFAILURE_ARMCC_MODIFIERNOTALLOWED = 'armcc_modifier_not_allowed'; |
|
60 |
my $CATEGORY_RECIPEFAILURE_ARMCC_GENERICWARNINGSERRORS = 'armcc_generic_warnings_errors'; |
|
61 |
my $CATEGORY_RECIPEFAILURE_ELF2E32_SYMBOLMISSINGFROMELFFILE = 'elf2e32_symbol_missing_from_elf_file'; |
|
62 |
my $CATEGORY_RECIPEFAILURE_MWCCSYM2_FILECANNOTBEOPENED = 'mwccsym2_file_cannot_be_opened'; |
|
246
0a0ad5daa2f9
Add new categories: mwldsym2_undefined_symbol and makedef_frozen_export_missing for recipe failures
Dario Sestito <darios@symbian.org>
parents:
238
diff
changeset
|
63 |
my $CATEGORY_RECIPEFAILURE_MWLDSYM2_UNDEFINEDSYMBOL = 'mwldsym2_undefined_symbol'; |
183
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
64 |
my $CATEGORY_RECIPEFAILURE_BINSH_COMMANDNOTFOUND = 'binsh_command_not_found'; |
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
65 |
my $CATEGORY_RECIPEFAILURE_AS_ERROR = 'as_error'; |
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
66 |
my $CATEGORY_RECIPEFAILURE_GPP_ERROR = 'g++_error'; |
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
67 |
my $CATEGORY_RECIPEFAILURE_GPP_WARNING = 'g++_warning'; |
246
0a0ad5daa2f9
Add new categories: mwldsym2_undefined_symbol and makedef_frozen_export_missing for recipe failures
Dario Sestito <darios@symbian.org>
parents:
238
diff
changeset
|
68 |
my $CATEGORY_RECIPEFAILURE_MAKEDEF_FROZENEXPORTMISSING = 'makedef_frozen_export_missing'; |
176 | 69 |
|
70 |
my $mmp_with_issues = {}; |
|
71 |
||
72 |
||
73 |
sub process |
|
74 |
{ |
|
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
75 |
my ($text, $config, $component, $mmp, $phase, $recipe, $file) = @_; |
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
76 |
|
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
77 |
my $dumped = 1; |
176 | 78 |
|
79 |
my $category = $CATEGORY_RECIPEFAILURE; |
|
80 |
my $severity = ''; |
|
81 |
my $subcategory = ''; |
|
82 |
||
83 |
# if mmp is defined assign severity=MAJOR for the first failure |
|
84 |
# then severity=MINOR to all other (for each logfile) |
|
85 |
if ($mmp and defined $mmp_with_issues->{$::current_log_file}->{$mmp}) |
|
86 |
{ |
|
87 |
$severity = $RaptorCommon::SEVERITY_MINOR; |
|
88 |
} |
|
89 |
elsif ($mmp) |
|
90 |
{ |
|
91 |
$mmp_with_issues->{$::current_log_file} = {} if (!defined $mmp_with_issues->{$::current_log_file}); |
|
92 |
$mmp_with_issues->{$::current_log_file}->{$mmp} = 1; |
|
93 |
$severity = $RaptorCommon::SEVERITY_MAJOR; |
|
94 |
} |
|
95 |
else |
|
96 |
{ |
|
97 |
$severity = $RaptorCommon::SEVERITY_MAJOR; |
|
98 |
} |
|
99 |
||
100 |
||
101 |
if ($text =~ m,Error: #5: cannot open source input file .*: No such file or directory,) |
|
102 |
{ |
|
103 |
my $subcategory = $CATEGORY_RECIPEFAILURE_ARMCC_CANNOTOPENSOURCEINPUTFILE; |
|
249
06db82e8efc6
Raised to critical the categories: armcc_cannot_open_source_input_file, mwccsym2_file_cannot_be_opened, cpp_exe_no_such_file_or_directory
Dario Sestito <darios@symbian.org>
parents:
246
diff
changeset
|
104 |
# set severity as critical, |
06db82e8efc6
Raised to critical the categories: armcc_cannot_open_source_input_file, mwccsym2_file_cannot_be_opened, cpp_exe_no_such_file_or_directory
Dario Sestito <darios@symbian.org>
parents:
246
diff
changeset
|
105 |
# but leave alone failures which are minor (for the chronological rule) |
06db82e8efc6
Raised to critical the categories: armcc_cannot_open_source_input_file, mwccsym2_file_cannot_be_opened, cpp_exe_no_such_file_or_directory
Dario Sestito <darios@symbian.org>
parents:
246
diff
changeset
|
106 |
$severity = $RaptorCommon::SEVERITY_CRITICAL if ($severity eq $RaptorCommon::SEVERITY_MAJOR); |
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
107 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $config, $component, $mmp, $phase, $recipe, $file); |
176 | 108 |
} |
109 |
elsif ($text =~ m,Fatal error: L6002U: Could not open file .*: No such file or directory,) |
|
110 |
{ |
|
111 |
my $subcategory = $CATEGORY_RECIPEFAILURE_ARMLINK_COULDNOTOPENFILE; |
|
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
112 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $config, $component, $mmp, $phase, $recipe, $file); |
176 | 113 |
} |
114 |
elsif ($text =~ m,elf2e32 : Error: E1001: Could not open file : .*.,) |
|
115 |
{ |
|
116 |
my $subcategory = $CATEGORY_RECIPEFAILURE_ELF2E32_COULDNOTOPENFILE; |
|
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
117 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $config, $component, $mmp, $phase, $recipe, $file); |
176 | 118 |
} |
119 |
elsif ($text =~ m,elf2e32 : Error: E1036: Symbol .* Missing from ELF File,) |
|
120 |
{ |
|
121 |
my $subcategory = $CATEGORY_RECIPEFAILURE_ELF2E32_SYMBOLMISSINGFROMELFFILE; |
|
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
122 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $config, $component, $mmp, $phase, $recipe, $file); |
176 | 123 |
} |
124 |
elsif ($text =~ m,Error: L6833E: File '.*' does not exist,) |
|
125 |
{ |
|
126 |
my $subcategory = $CATEGORY_RECIPEFAILURE_ARMAR_FILEDOESNOTEXIST; |
|
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
127 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $config, $component, $mmp, $phase, $recipe, $file); |
176 | 128 |
} |
129 |
elsif ($text =~ m,: Warning: #236-D: controlling expression is constant,) |
|
130 |
{ |
|
131 |
my $subcategory = $CATEGORY_RECIPEFAILURE_ARMCC_CONTROLLINGEXPRESSIONISCONSTANT; |
|
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
132 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $config, $component, $mmp, $phase, $recipe, $file); |
176 | 133 |
} |
134 |
elsif ($text =~ m,/armcc.exe , and $text =~ m,Internal fault: ,) |
|
135 |
{ |
|
136 |
my $subcategory = $CATEGORY_RECIPEFAILURE_ARMCC_INTERNALFAULT; |
|
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
137 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $config, $component, $mmp, $phase, $recipe, $file); |
176 | 138 |
} |
139 |
elsif ($text =~ m,/armcc.exe , and $text =~ m,Error: #655-D: the modifier ".*" is not allowed on this declaration,) |
|
140 |
{ |
|
141 |
my $subcategory = $CATEGORY_RECIPEFAILURE_ARMCC_MODIFIERNOTALLOWED; |
|
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
142 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $config, $component, $mmp, $phase, $recipe, $file); |
176 | 143 |
} |
183
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
144 |
elsif ($text =~ m,^\+.*/make.exe .*\n/bin/sh: .*: command not found,m) |
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
145 |
{ |
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
146 |
$severity = $RaptorCommon::SEVERITY_CRITICAL; |
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
147 |
my $subcategory = $CATEGORY_RECIPEFAILURE_BINSH_COMMANDNOTFOUND; |
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
148 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $config, $component, $mmp, $phase, $recipe, $file); |
183
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
149 |
} |
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
150 |
elsif ($text =~ m,^\+.*/arm-none-symbianelf-as\.exe .*^Error: .*,ms) |
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
151 |
{ |
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
152 |
my $subcategory = $CATEGORY_RECIPEFAILURE_AS_ERROR; |
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
153 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $config, $component, $mmp, $phase, $recipe, $file); |
183
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
154 |
} |
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
155 |
elsif ($text =~ m,^\+.*/arm-none-symbianelf-g\+\+\.exe .*:\d+: [Ee]rror: .*,ms) |
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
156 |
{ |
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
157 |
my $subcategory = $CATEGORY_RECIPEFAILURE_GPP_ERROR; |
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
158 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $config, $component, $mmp, $phase, $recipe, $file); |
183
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
159 |
} |
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
160 |
elsif ($text =~ m,^\+.*/arm-none-symbianelf-g\+\+\.exe .*:\d+: [Ww]arning: .*,ms) |
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
161 |
{ |
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
162 |
my $subcategory = $CATEGORY_RECIPEFAILURE_GPP_WARNING; |
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
163 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $config, $component, $mmp, $phase, $recipe, $file); |
183
38468523076d
Add more categories for recipe failures
Dario Sestito <darios@symbian.org>
parents:
176
diff
changeset
|
164 |
} |
176 | 165 |
# the following captures generic armcc error/warnings, not captured by regexps above |
166 |
elsif ($text =~ m,/armcc.exe , and $text =~ m,: \d+ warnings\, \d+ errors$,) |
|
167 |
{ |
|
168 |
my $subcategory = $CATEGORY_RECIPEFAILURE_ARMCC_GENERICWARNINGSERRORS; |
|
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
169 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $config, $component, $mmp, $phase, $recipe, $file); |
176 | 170 |
} |
171 |
elsif ($text =~ m,mwccsym2.exe , and $text =~ m,: the file '.*' cannot be opened,) |
|
172 |
{ |
|
173 |
my $subcategory = $CATEGORY_RECIPEFAILURE_MWCCSYM2_FILECANNOTBEOPENED; |
|
249
06db82e8efc6
Raised to critical the categories: armcc_cannot_open_source_input_file, mwccsym2_file_cannot_be_opened, cpp_exe_no_such_file_or_directory
Dario Sestito <darios@symbian.org>
parents:
246
diff
changeset
|
174 |
# set severity as critical, |
06db82e8efc6
Raised to critical the categories: armcc_cannot_open_source_input_file, mwccsym2_file_cannot_be_opened, cpp_exe_no_such_file_or_directory
Dario Sestito <darios@symbian.org>
parents:
246
diff
changeset
|
175 |
# but leave alone failures which are minor (for the chronological rule) |
06db82e8efc6
Raised to critical the categories: armcc_cannot_open_source_input_file, mwccsym2_file_cannot_be_opened, cpp_exe_no_such_file_or_directory
Dario Sestito <darios@symbian.org>
parents:
246
diff
changeset
|
176 |
$severity = $RaptorCommon::SEVERITY_CRITICAL if ($severity eq $RaptorCommon::SEVERITY_MAJOR); |
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
177 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $config, $component, $mmp, $phase, $recipe, $file); |
176 | 178 |
} |
246
0a0ad5daa2f9
Add new categories: mwldsym2_undefined_symbol and makedef_frozen_export_missing for recipe failures
Dario Sestito <darios@symbian.org>
parents:
238
diff
changeset
|
179 |
elsif ($text =~ m,mwldsym2\.exe: Undefined symbol: '.*',) |
0a0ad5daa2f9
Add new categories: mwldsym2_undefined_symbol and makedef_frozen_export_missing for recipe failures
Dario Sestito <darios@symbian.org>
parents:
238
diff
changeset
|
180 |
{ |
0a0ad5daa2f9
Add new categories: mwldsym2_undefined_symbol and makedef_frozen_export_missing for recipe failures
Dario Sestito <darios@symbian.org>
parents:
238
diff
changeset
|
181 |
my $subcategory = $CATEGORY_RECIPEFAILURE_MWLDSYM2_UNDEFINEDSYMBOL; |
0a0ad5daa2f9
Add new categories: mwldsym2_undefined_symbol and makedef_frozen_export_missing for recipe failures
Dario Sestito <darios@symbian.org>
parents:
238
diff
changeset
|
182 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $config, $component, $mmp, $phase, $recipe, $file); |
0a0ad5daa2f9
Add new categories: mwldsym2_undefined_symbol and makedef_frozen_export_missing for recipe failures
Dario Sestito <darios@symbian.org>
parents:
238
diff
changeset
|
183 |
} |
0a0ad5daa2f9
Add new categories: mwldsym2_undefined_symbol and makedef_frozen_export_missing for recipe failures
Dario Sestito <darios@symbian.org>
parents:
238
diff
changeset
|
184 |
elsif ($text =~ m,MAKEDEF ERROR: \d+ Frozen Export\(s\) missing from object files,) |
0a0ad5daa2f9
Add new categories: mwldsym2_undefined_symbol and makedef_frozen_export_missing for recipe failures
Dario Sestito <darios@symbian.org>
parents:
238
diff
changeset
|
185 |
{ |
0a0ad5daa2f9
Add new categories: mwldsym2_undefined_symbol and makedef_frozen_export_missing for recipe failures
Dario Sestito <darios@symbian.org>
parents:
238
diff
changeset
|
186 |
my $subcategory = $CATEGORY_RECIPEFAILURE_MAKEDEF_FROZENEXPORTMISSING; |
0a0ad5daa2f9
Add new categories: mwldsym2_undefined_symbol and makedef_frozen_export_missing for recipe failures
Dario Sestito <darios@symbian.org>
parents:
238
diff
changeset
|
187 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $config, $component, $mmp, $phase, $recipe, $file); |
0a0ad5daa2f9
Add new categories: mwldsym2_undefined_symbol and makedef_frozen_export_missing for recipe failures
Dario Sestito <darios@symbian.org>
parents:
238
diff
changeset
|
188 |
} |
176 | 189 |
else # log everything by default |
190 |
{ |
|
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
191 |
RaptorCommon::dump_fault($category, $subcategory, $severity, $config, $component, $mmp, $phase, $recipe, $file); |
176 | 192 |
} |
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
193 |
|
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
194 |
return $dumped; |
176 | 195 |
} |
196 |
||
197 |
sub on_start_buildlog |
|
198 |
{ |
|
199 |
#print FILE "line,layer,component,name,armlicence,platform,phase,code,bldinf,mmp,target,source,\n"; |
|
200 |
||
201 |
RaptorCommon::init(); |
|
202 |
} |
|
203 |
||
204 |
sub on_start_buildlog_recipe |
|
205 |
{ |
|
206 |
my ($el) = @_; |
|
207 |
||
208 |
#print "on_start_buildlog_recipe\n"; |
|
209 |
||
210 |
$recipe_info = {}; |
|
211 |
||
212 |
my $attributes = $el->{Attributes}; |
|
213 |
for (keys %{$attributes}) |
|
214 |
{ |
|
215 |
$recipe_info->{$attributes->{$_}->{'LocalName'}} = $attributes->{$_}->{'Value'}; |
|
216 |
#print "$_ -> $attributes->{$_}->{'Value'}\n"; |
|
217 |
} |
|
218 |
} |
|
219 |
||
220 |
sub on_chars_buildlog_recipe |
|
221 |
{ |
|
222 |
my ($ch) = @_; |
|
223 |
||
224 |
#print "on_chars_buildlog_recipe\n"; |
|
225 |
||
226 |
$characters .= $ch->{Data}; |
|
227 |
||
228 |
#print "characters is now -->$characters<--\n"; |
|
229 |
} |
|
230 |
||
231 |
sub on_start_buildlog_recipe_status |
|
232 |
{ |
|
233 |
my ($el) = @_; |
|
234 |
||
235 |
my $attributes = $el->{Attributes}; |
|
236 |
for (keys %{$attributes}) |
|
237 |
{ |
|
238 |
if ($attributes->{$_}->{'LocalName'} eq 'code') |
|
239 |
{ |
|
240 |
$recipe_info->{$attributes->{$_}->{'LocalName'}} = $attributes->{$_}->{'Value'}; |
|
241 |
} |
|
242 |
elsif ($attributes->{$_}->{'LocalName'} eq 'exit') |
|
243 |
{ |
|
244 |
$recipe_info->{$attributes->{$_}->{'LocalName'}} = $attributes->{$_}->{'Value'}; |
|
245 |
} |
|
246 |
elsif ($attributes->{$_}->{'LocalName'} eq 'attempt') |
|
247 |
{ |
|
248 |
$recipe_info->{$attributes->{$_}->{'LocalName'}} = $attributes->{$_}->{'Value'}; |
|
249 |
} |
|
190
890789575604
Recipes with exit=retry and forcesuccess=FORCESUCCESS must be considered as failed
Dario Sestito <darios@symbian.org>
parents:
185
diff
changeset
|
250 |
elsif ($attributes->{$_}->{'LocalName'} eq 'forcesuccess') |
890789575604
Recipes with exit=retry and forcesuccess=FORCESUCCESS must be considered as failed
Dario Sestito <darios@symbian.org>
parents:
185
diff
changeset
|
251 |
{ |
890789575604
Recipes with exit=retry and forcesuccess=FORCESUCCESS must be considered as failed
Dario Sestito <darios@symbian.org>
parents:
185
diff
changeset
|
252 |
$recipe_info->{$attributes->{$_}->{'LocalName'}} = $attributes->{$_}->{'Value'}; |
890789575604
Recipes with exit=retry and forcesuccess=FORCESUCCESS must be considered as failed
Dario Sestito <darios@symbian.org>
parents:
185
diff
changeset
|
253 |
} |
176 | 254 |
} |
255 |
} |
|
256 |
||
257 |
sub on_end_buildlog_recipe |
|
258 |
{ |
|
230
f593b7acdb37
Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents:
190
diff
changeset
|
259 |
if ($recipe_info->{bldinf}) |
f593b7acdb37
Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents:
190
diff
changeset
|
260 |
{ |
f593b7acdb37
Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents:
190
diff
changeset
|
261 |
$::allbldinfs->{$recipe_info->{bldinf}} = 1; |
f593b7acdb37
Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents:
190
diff
changeset
|
262 |
} |
f593b7acdb37
Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents:
190
diff
changeset
|
263 |
else |
f593b7acdb37
Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents:
190
diff
changeset
|
264 |
{ |
f593b7acdb37
Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents:
190
diff
changeset
|
265 |
$::allbldinfs->{'/unknown/unknown'} = 1; |
f593b7acdb37
Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents:
190
diff
changeset
|
266 |
} |
176 | 267 |
|
190
890789575604
Recipes with exit=retry and forcesuccess=FORCESUCCESS must be considered as failed
Dario Sestito <darios@symbian.org>
parents:
185
diff
changeset
|
268 |
if ($recipe_info->{exit} =~ /failed/i || $recipe_info->{exit} =~ /retry/i && $recipe_info->{forcesuccess} =~ /FORCESUCCESS/i) |
176 | 269 |
{ |
230
f593b7acdb37
Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents:
190
diff
changeset
|
270 |
#print "2 normalizing bldinf: $recipe_info->{bldinf} \n"; |
267
a02973783e64
Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents:
249
diff
changeset
|
271 |
RaptorCommon::normalize_bldinf_path(\$recipe_info->{bldinf}); |
176 | 272 |
|
273 |
my $package = ''; |
|
267
a02973783e64
Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents:
249
diff
changeset
|
274 |
$package = RaptorCommon::get_package_subpath($recipe_info->{bldinf}); |
a02973783e64
Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents:
249
diff
changeset
|
275 |
$package =~ s,/,_,g; |
a02973783e64
Extend UH parser to cope with tools build
Dario Sestito <darios@symbian.org>
parents:
249
diff
changeset
|
276 |
if (!$package) |
176 | 277 |
{ |
230
f593b7acdb37
Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents:
190
diff
changeset
|
278 |
#print "WARNING: can't understand bldinf attribute of recipe: $recipe_info->{bldinf}. Won't dump to failed recipes file.\n"; |
f593b7acdb37
Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents:
190
diff
changeset
|
279 |
$package = 'unknown_unknown'; |
176 | 280 |
} |
281 |
||
282 |
# also normalize mmp path if this exists |
|
283 |
if ($recipe_info->{mmp}) |
|
284 |
{ |
|
285 |
$recipe_info->{mmp} = lc($recipe_info->{mmp}); |
|
286 |
$recipe_info->{mmp} =~ s,^[A-Za-z]:,,; |
|
287 |
$recipe_info->{mmp} =~ s,[\\],/,g; |
|
288 |
} |
|
289 |
||
290 |
$characters =~ s,^[\r\n]*,,; |
|
291 |
$characters =~ s,[\r\n]*$,,; |
|
292 |
||
293 |
if ($package) |
|
294 |
{ |
|
295 |
$filename = "$::raptorbitsdir/$package.txt"; |
|
296 |
if (!-f$filename) |
|
297 |
{ |
|
298 |
print "Writing recipe file $filename\n"; |
|
299 |
open(FILE, ">$filename"); |
|
300 |
close(FILE); |
|
301 |
} |
|
230
f593b7acdb37
Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents:
190
diff
changeset
|
302 |
|
f593b7acdb37
Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents:
190
diff
changeset
|
303 |
my $bldinf_arg = '/unknown/unknown'; |
f593b7acdb37
Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents:
190
diff
changeset
|
304 |
$bldinf_arg = $recipe_info->{bldinf} if ($recipe_info->{bldinf}); |
f593b7acdb37
Fix: some heuristically determined components are wrong. Fix: recipe failures without bldinf attribute are lost
Dario Sestito <darios@symbian.org>
parents:
190
diff
changeset
|
305 |
my $dumped = process($characters, $recipe_info->{config}, $bldinf_arg, $recipe_info->{mmp}, $recipe_info->{phase}, $recipe_info->{name}, "$package.txt"); |
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
306 |
|
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
307 |
if ($dumped) |
176 | 308 |
{ |
185
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
309 |
open(FILE, ">>$filename"); |
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
310 |
print FILE "---failure_item_$::failure_item_number\---\n"; |
b76adfbc6648
Don't dump failures which aren't reported
Dario Sestito <darios@symbian.org>
parents:
183
diff
changeset
|
311 |
print FILE "$characters\n\n"; |
176 | 312 |
close(FILE); |
313 |
} |
|
314 |
} |
|
315 |
} |
|
316 |
||
317 |
$characters = ''; |
|
318 |
} |
|
319 |
||
320 |
sub on_end_buildlog |
|
321 |
{ |
|
322 |
} |
|
323 |
||
324 |
||
325 |
1; |