diff --git a/src/programbench/eval/eval.py b/src/programbench/eval/eval.py index ba1f692c..2f17b8cd 100644 --- a/src/programbench/eval/eval.py +++ b/src/programbench/eval/eval.py @@ -492,6 +492,19 @@ def _compile_executable(self, env: ContainerEnvironment, log_buf: list[dict]) -> assert self.submission_archive is not None env.copy_in_tar(self.submission_archive, f"{WORKSPACE_DIR}/") self._remove_hashed_files(env, log_buf) + # Remove any ./executable shipped in the submission archive so the + # build must produce a fresh binary. The workspace wipe above runs + # *before* the tar is extracted, so a prebuilt executable smuggled + # into the submission would otherwise survive into the compile step + # and be stashed as if the build had produced it (a stub/no-op + # compile.sh would then "pass"). _remove_hashed_files only catches + # byte-for-byte copies of the gold binary, not arbitrary prebuilts. + self._run_step( + "rm -f ./executable", + env=env, + log_buf=log_buf, + step_name="clear_stale_executable", + ) # Seed a synthetic git repo if the submission didn't ship one. Build # scripts that depend on a working tree (jq submodules, calcurse's # autopoint, cargo+vergen, ...) succeed against this synthetic repo.