From 1579bfeb4b08be810d5960dd98689a26d9deff77 Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Mon, 25 Sep 2023 12:44:29 +0200 Subject: [PATCH] ci --- fuzzers/aflplusplus_fishfuzz/fuzzer.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/fuzzers/aflplusplus_fishfuzz/fuzzer.py b/fuzzers/aflplusplus_fishfuzz/fuzzer.py index f87aba5b9..ccb200c25 100755 --- a/fuzzers/aflplusplus_fishfuzz/fuzzer.py +++ b/fuzzers/aflplusplus_fishfuzz/fuzzer.py @@ -30,13 +30,16 @@ def get_uninstrumented_build_directory(target_directory): """Return path to CmpLog target directory.""" return os.path.join(target_directory, 'uninstrumented') + def prepare_tmp_files(tmp_dir): + """ Prepare tmp files.""" if not os.path.isdir(tmp_dir) or os.path.exists(tmp_dir): os.mkdir(tmp_dir) - os.mkdir('%s/idlog' % (tmp_dir)) - os.mkdir('%s/cg' % (tmp_dir)) - os.mkdir('%s/fid' % (tmp_dir)) - os.system('touch %s/idlog/fid %s/idlog/targid' % (tmp_dir, tmp_dir)) + os.mkdir(f'%s/idlog' % (tmp_dir)) + os.mkdir(f'%s/cg' % (tmp_dir)) + os.mkdir(f'%s/fid' % (tmp_dir)) + os.system(f'touch %s/idlog/fid %s/idlog/targid' % (tmp_dir, tmp_dir)) + def set_ff_env(): # set FishFuzz Env before build @@ -44,6 +47,7 @@ def set_ff_env(): os.environ['FF_TMP_DIR'] = os.environ['OUT'] + '/TEMP' prepare_tmp_files(os.environ['TMP_DIR']) + def build(*args): # pylint: disable=too-many-branches,too-many-statements """Build benchmark.""" # BUILD_MODES is not already supported by fuzzbench, meanwhile we provide @@ -173,7 +177,7 @@ def build(*args): # pylint: disable=too-many-branches,too-many-statements if 'eclipser' in build_modes: os.environ['FUZZER_LIB'] = '/libStandaloneFuzzTarget.a' else: - os.environ['FUZZER_LIB'] = '/FishFuzz/afl_driver.o' # '/libAFLDriver.a' + os.environ['FUZZER_LIB'] = '/FishFuzz/afl_driver.o' # Some benchmarks like lcms. (see: # https://github.com/mm2/Little-CMS/commit/ab1093539b4287c233aca6a3cf53b234faceb792#diff-f0e6d05e72548974e852e8e55dffc4ccR212) @@ -252,12 +256,12 @@ def build(*args): # pylint: disable=too-many-branches,too-many-statements tmp_dir_dst = os.environ['OUT'] + '/TEMP' print('[post_build] generating distance files') - # python3 /Fish++/distance/match_function.py -i $FF_TMP_DIR - # python3 /Fish++/distance/merge_callgraph.py -i $FF_TMP_DIR - # python3 /Fish++/distance/calculate_distance.py -i $FF_TMP_DIR - os.system('python3 /FishFuzz/distance/match_function.py -i %s' % (tmp_dir_dst)) - os.system('python3 /FishFuzz/distance/merge_callgraph.py -i %s' % (tmp_dir_dst)) - os.system('python3 /FishFuzz/distance/calculate_distance.py -i %s' % (tmp_dir_dst)) + os.system('python3 /FishFuzz/distance/match_function.py -i %s' % + (tmp_dir_dst)) + os.system('python3 /FishFuzz/distance/merge_callgraph.py -i %s' % + (tmp_dir_dst)) + os.system('python3 /FishFuzz/distance/calculate_distance.py -i %s' % + (tmp_dir_dst)) # pylint: disable=too-many-arguments