secs_server: relative-path defaults so the binary runs outside docker
tests / build-and-test (push) Successful in 2m7s
tests / thread-sanitizer (push) Successful in 2m33s
tests / tshark-dissector (push) Successful in 2m15s
tests / secs4j-interop (push) Failing after 1s
tests / libfuzzer (push) Successful in 3m7s

Previously --config / --state-table / --pj-state-table /
--cj-state-table defaulted to /app/data/..., which only resolves
inside the docker image.  A host build run from the repo root
errored out unless every flag was passed explicitly.

Switch to data/equipment.yaml (and siblings) relative to CWD —
docker still works because WORKDIR=/app puts /app/data/... at the
same relative location, and host builds run from the repo root
resolve to <repo>/data/....  Existing callers that pass explicit
paths (the proof commands, tshark_validate.sh, secs4j_validate.sh,
docker compose) are unaffected.

Verified --validate-config under docker still finds all four YAMLs
and the tshark proof still passes (69 frames, 0 malformed).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 19:00:45 +02:00
parent b031f057af
commit c8e8e80735
+8 -4
View File
@@ -54,12 +54,16 @@ void refresh(gem::EquipmentDataModel& m, const gem::ControlStateMachine& sm) {
int main(int argc, char** argv) {
const auto port = static_cast<uint16_t>(std::stoi(arg(argc, argv, "--port", "5000")));
const auto equipment_yaml = arg(argc, argv, "--config", "/app/data/equipment.yaml");
const auto state_yaml = arg(argc, argv, "--state-table", "/app/data/control_state.yaml");
// Defaults are relative to the current working directory so the
// binary works both inside the docker image (WORKDIR=/app) and on a
// host build run from the repo root. Pass explicit --config etc.
// when running from anywhere else.
const auto equipment_yaml = arg(argc, argv, "--config", "data/equipment.yaml");
const auto state_yaml = arg(argc, argv, "--state-table", "data/control_state.yaml");
const auto pj_state_yaml = arg(argc, argv, "--pj-state-table",
"/app/data/process_job_state.yaml");
"data/process_job_state.yaml");
const auto cj_state_yaml = arg(argc, argv, "--cj-state-table",
"/app/data/control_job_state.yaml");
"data/control_job_state.yaml");
const auto spool_dir = arg(argc, argv, "--spool-dir", "");
const bool validate_only = has_flag(argc, argv, "--validate-config");