Skip to content

Commit

Permalink
feat(deep-semgrep)!: Pass max-memory to deep-semgrep (semgrep#6703)
Browse files Browse the repository at this point in the history
Allow users to call deep-semgrep with a `--max-memory` field. This
will break `semgrep --deep` for users who haven't upgraded.

Also fix the path used in `dump_command_for_core`

Test plan for the latter `semgrep --config <config> --deep . -d`
Test plan for the rest is in the deep-semgrep PR
  • Loading branch information
emjin authored Dec 15, 2022
1 parent 67b9938 commit 9ace517
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cli/src/semgrep/core_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -855,8 +855,8 @@ def _run_rules_direct_to_semgrep_core_helper(
# str(self._timeout),
# "--timeout_threshold",
# str(self._timeout_threshold),
# "--max_memory",
# str(self._max_memory),
"--max_memory",
str(self._max_memory),
]

stderr: Optional[int] = subprocess.PIPE
Expand All @@ -872,7 +872,9 @@ def _run_rules_direct_to_semgrep_core_helper(
# to copy+paste it to a shell. (The real command is
# still visible in the log message above.)
printed_cmd = cmd.copy()
printed_cmd[0] = SemgrepCore.executable_path()
printed_cmd[0] = (
deep_path if deep_path and deep else SemgrepCore.executable_path()
)
print(" ".join(printed_cmd))
sys.exit(0)

Expand Down

0 comments on commit 9ace517

Please sign in to comment.