From c0b441f8fde516e714586d85603d8a25aea1d4e8 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Sun, 30 Mar 2025 00:42:59 +0100 Subject: [PATCH] [skip ci] Fix valgrind benchmark diff output Don't print command when searching benchmarked commit, as this breaks the markdown summary. --- benchmark/generate_diff.php | 6 +++++- benchmark/shared.php | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/benchmark/generate_diff.php b/benchmark/generate_diff.php index 3a1e0d7b137..94c020df4b9 100644 --- a/benchmark/generate_diff.php +++ b/benchmark/generate_diff.php @@ -73,7 +73,11 @@ function find_benchmarked_commit_hash(string $repo, string $commitHash): ?string if (file_exists($summaryFile)) { break; } - $commitHash = trim(runCommand(['git', 'rev-parse', $commitHash . '^'], dirname(__DIR__))->stdout); + $commitHash = trim(runCommand( + ['git', 'rev-parse', $commitHash . '^'], + dirname(__DIR__), + printCommand: false, + )->stdout); } return $commitHash; diff --git a/benchmark/shared.php b/benchmark/shared.php index 450101770b2..0f58a2a1bf8 100644 --- a/benchmark/shared.php +++ b/benchmark/shared.php @@ -5,12 +5,14 @@ class ProcessResult { public $stderr; } -function runCommand(array $args, ?string $cwd = null): ProcessResult { +function runCommand(array $args, ?string $cwd = null, bool $printCommand = true): ProcessResult { $cmd = implode(' ', array_map('escapeshellarg', $args)); $pipes = null; $result = new ProcessResult(); $descriptorSpec = [0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w']]; - fwrite(STDOUT, "> $cmd\n"); + if ($printCommand) { + fwrite(STDOUT, "> $cmd\n"); + } $processHandle = proc_open($cmd, $descriptorSpec, $pipes, $cwd ?? getcwd(), null); $stdin = $pipes[0];