@@ -49,6 +49,9 @@ CSMOCK_DATADIR = "/usr/share/csmock"
4949
5050CWE_MAP_FILE = CSMOCK_DATADIR + "/cwe-map.csv"
5151
52+ # path to the csgrep-static executable
53+ CSGREP_STATIC = "/usr/libexec/csgrep-static"
54+
5255CSMOCK_SCRIPTS = CSMOCK_DATADIR + "/scripts"
5356
5457CHROOT_FIXUPS = CSMOCK_SCRIPTS + "/chroot-fixups"
@@ -958,8 +961,8 @@ exceeds the specified limit (defaults to 1024).")
958961 props .kfp_git_url = args .kfp_git_url
959962
960963 if props .embed_context > 0 :
961- # we need ' csgrep --embed-context' to work in the chroot for --embed-context
962- props .install_opt_pkgs += ["csdiff" ]
964+ # we need csgrep-static in the chroot for --embed-context
965+ props .copy_in_files += [CSGREP_STATIC ]
963966
964967 if args .warning_rate_limit > 0 :
965968 props .results_limits_opts += [f"--warning-rate-limit={ args .warning_rate_limit } " ]
@@ -1289,7 +1292,7 @@ cd %%s*/ || cd *\n\
12891292 if props .embed_context > 0 :
12901293 # embed context lines from source program files
12911294 tmp_file = f"{ all_file } .tmp"
1292- csgrep_cmd = f"csgrep --mode=json --embed-context { props .embed_context } "
1295+ csgrep_cmd = f"{ CSGREP_STATIC } --mode=json --embed-context { props .embed_context } "
12931296
12941297 if props .results_limits_opts :
12951298 # apply results limits already while embedding context to avoid creating excessively huge output
0 commit comments