harbor run -t openthoughts/tasktrove-exp-rpt-issue-issue-4559harbor download openthoughts/tasktrove-exp-rpt-issue-issue-4559title: Self-contained build-phase benchmark: autoconf-like flow vs GNU Make flow
Description You need to implement a self-contained tiny Linux workspace that emulates a typical build-context and phase flow used by small C projects. The runner must support two build paths:
Deliverables to implement under /app/ (in a new benchmark_build/ tree):
benchmark_build/src/bench.c: a minimal program that prints a version string sourced from a generated header.
benchmark_build/configure: a shell script that writes benchmark_build/include/config.h with BENCH_VERSION.
benchmark_build/Makefile: a simple Makefile that builds bench from bench.c and uses the include header for the version macro.
benchmark_build/build_runner.sh: a phase-driven orchestrator implementing distclean, clean, prepare, config, build, install. The runner should:
benchmark_build/logs/build.log: generated by the runner during execution.
benchmark_build/bin/bench: the installed binary produced by the run (will be created when you run the runner).
How to implement and verify
Concrete file templates you should provide in benchmark_build/
benchmark_build/src/bench.c
#include <stdio.h>
#include "config.h"
int main(void) {
printf("Hello, Benchmark %s\n", BENCH_VERSION);
return 0;
}
benchmark_build/configure
#!/bin/sh
set -e
mkdir -p include
cat > include/config.h << 'EOF'
#define BENCH_VERSION "1.0"
EOF
chmod 644 include/config.h
benchmark_build/Makefile
CC = gcc
CFLAGS = -Iinclude
SRC = src/bench.c
BIN = bin/bench
all: $(BIN)
$(BIN): $(SRC)
$(CC) $(CFLAGS) -o $(BIN) $(SRC)
clean:
rm -f $(BIN)
install: $(BIN)
install -D -m 755 $(BIN) bin/bench
benchmark_build/build_runner.sh
benchmark_build/logs/build.log
benchmark_build/bin/bench
Before state (pre-fix) The repository currently does not contain a self-contained six-phase runner or the tiny benchmark project described above. The files are missing or incomplete. The following placeholders illustrate the intended files before you implement them.
/* placeholder - bench.c not yet implemented */
#include <stdio.h>
int main(void) {
// This program will be generated by the configuration step.
fprintf(stderr, "bench not built yet\n");
return 1;
}
#!/bin/sh
# placeholder configure script (pre-fix)
set -e
echo "No real configure step implemented yet"
# placeholder Makefile (pre-fix)
all:
\t@echo "No build configured yet"
#!/bin/sh
# placeholder runner (pre-fix)
echo "Runner not implemented yet"
What to create/modify in /app/
Create the directory /app/benchmark_build with the following files and structure:
Ensure the following permissions:
After implementing, run the runner and verify:
Notes