Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/programbench/eval/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading