@@ -746,6 +746,18 @@ def gather_results_for_task(self, task):
746
746
747
747
return result
748
748
749
+ def create_stripped_elf (self , path , bin_prefix = "arm-none-eabi" ):
750
+ stripped_path = f"{ path } -stripped"
751
+ shutil .copy (path , stripped_path )
752
+
753
+ strip = "strip"
754
+ if bin_prefix is not None :
755
+ strip = "-" .join ([bin_prefix , strip ])
756
+
757
+ self .run_program ("strip" , [strip , stripped_path ])
758
+
759
+ return stripped_path
760
+
749
761
def compare_results (self , result_master , result_branch ):
750
762
ret = {}
751
763
for vehicle in result_master ["vehicle" ].keys ():
@@ -760,14 +772,21 @@ def compare_results(self, result_master, result_branch):
760
772
new_path = os .path .join (new_bin_dir , bin_filename )
761
773
master_size = os .path .getsize (master_path )
762
774
new_size = os .path .getsize (new_path )
775
+ identical = self .files_are_identical (master_path , new_path )
763
776
except FileNotFoundError :
764
777
elf_filename = result_master ["vehicle" ][vehicle ]["elf_filename" ]
765
778
master_path = os .path .join (master_bin_dir , elf_filename )
766
779
new_path = os .path .join (new_bin_dir , elf_filename )
767
780
master_size = os .path .getsize (master_path )
768
781
new_size = os .path .getsize (new_path )
769
782
770
- identical = self .files_are_identical (master_path , new_path )
783
+ identical = self .files_are_identical (master_path , new_path )
784
+ if not identical :
785
+ # try stripping the files and *then* comparing.
786
+ # This treats symbol renames as then "identical".
787
+ master_path_stripped = self .create_stripped_elf (master_path )
788
+ new_path_stripped = self .create_stripped_elf (new_path )
789
+ identical = self .files_are_identical (master_path_stripped , new_path_stripped )
771
790
772
791
board = result_master ["board" ]
773
792
ret [vehicle ] = SizeCompareBranchesResult (board , vehicle , new_size - master_size , identical )
0 commit comments