Skip to content

Commit

Permalink
gcc: use csgrep --file-glob while processing SARIF
Browse files Browse the repository at this point in the history
... to avoid exceeding maximum command line length

Depends-on: csutils/csdiff#212
  • Loading branch information
kdudka committed Oct 15, 2024
1 parent 793b83b commit 2f33f97
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions py/plugins/gcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,10 @@ def create_gcc_results_dir_hook(_, mock):
props.copy_out_files += [GCC_RESULTS_DIR]

# process all captured SARIF files
# TODO: avoid exceeding maximum command line length
def filter_hook(results):
src = os.path.join(results.dbgdir_raw, GCC_RESULTS_DIR[1:])
dst = os.path.join(results.dbgdir_uni, "gcc-results.json")
cmd = f"cd {src} && {FILTER_CMD} *.sarif > {dst}"
cmd = f'{FILTER_CMD} --file-glob "{src}/*.sarif" > "{dst}"'
return results.exec_cmd(cmd, shell=True)
props.post_process_hooks += [filter_hook]

Expand Down

0 comments on commit 2f33f97

Please sign in to comment.