Skip to content

fix(exec): reject empty command before executor setup#467

Merged
not-matthias merged 2 commits into
mainfrom
cod-3225-exec-empty-command-fail-fast
Jul 27, 2026
Merged

fix(exec): reject empty command before executor setup#467
not-matthias merged 2 commits into
mainfrom
cod-3225-exec-empty-command-fail-fast

Conversation

@not-matthias

@not-matthias not-matthias commented Jul 23, 2026

Copy link
Copy Markdown
Member

codspeed exec with no command — and codspeed run with an empty or whitespace-only exec config target — built a BenchmarkTarget::Exec with an empty command. That empty target survived the full orchestrator (memtrack install, eBPF/libc uprobe attach, exec-harness spawn) before exec-harness rejected it with Empty command in stdin input, surfaced at the top level as the cryptic failed to execute memory tracker process: exit status: 1 after a ~2.3s probe detach.

The command is only ever supplied at two origins, so each is now validated up front — before any setup work:

  • CLI (codspeed exec): the positional command is now clap-required, so a missing command fails immediately at arg-parse with a usage message.
  • Config (codspeed run): build_benchmark_targets bails when a config exec command parses to zero words, naming the offending target.

Fixes COD-3225

@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown

Greptile Summary

Adds early validation for missing or blank exec commands before executor setup, with regression tests covering CLI and configuration inputs.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failures remain.

Important Files Changed

Filename Overview
src/cli/exec/mod.rs Requires a CLI command and validates every Exec target’s executable before constructing the orchestrator.

Reviews (4): Last reviewed commit: "fix(exec): reject whitespace-only execut..." | Re-trigger Greptile

Comment thread src/cli/exec/multi_targets.rs Outdated
@codspeed-hq

codspeed-hq Bot commented Jul 23, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 17 untouched benchmarks


Comparing cod-3225-exec-empty-command-fail-fast (c8d44ca) with main (8611106)

Open in CodSpeed

@not-matthias
not-matthias force-pushed the cod-3225-exec-empty-command-fail-fast branch from 80723f5 to c4f262e Compare July 23, 2026 16:50
Comment thread src/cli/exec/mod.rs Outdated
`codspeed exec` with no command, and `codspeed run` with an empty or
whitespace-only `exec` target, built a BenchmarkTarget with an empty
command that only failed deep inside exec-harness ("Empty command in
stdin input"), surfaced as the cryptic "failed to execute memory
tracker process: exit status: 1" after a full memtrack probe attach.

Enforce a non-empty command at each origin: mark the exec positional
clap-required, and bail in build_benchmark_targets when a config exec
command parses to zero words.
@not-matthias
not-matthias force-pushed the cod-3225-exec-empty-command-fail-fast branch from 825e87c to c8d44ca Compare July 27, 2026 10:43
@not-matthias
not-matthias merged commit d8be722 into main Jul 27, 2026
23 checks passed
@not-matthias
not-matthias deleted the cod-3225-exec-empty-command-fail-fast branch July 27, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants