From 0473f48fb7343b4251af43d9f92561ec3d86d917 Mon Sep 17 00:00:00 2001 From: Aaron Po Date: Fri, 3 Jul 2026 02:27:00 -0400 Subject: [PATCH] fix mock-only builds --- tooling/pipeline/includes/biergarten_pipeline.h | 4 ++++ tooling/pipeline/src/main.cc | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/tooling/pipeline/includes/biergarten_pipeline.h b/tooling/pipeline/includes/biergarten_pipeline.h index 4c63cba..f9061fd 100644 --- a/tooling/pipeline/includes/biergarten_pipeline.h +++ b/tooling/pipeline/includes/biergarten_pipeline.h @@ -16,8 +16,10 @@ // --- data_generation --- #include "data_generation/data_generator.h" #include "data_generation/json_grammars.h" +#ifndef BIERGARTEN_MOCK_ONLY #include "data_generation/llama_generator.h" #include "data_generation/llama_generator_helpers.h" +#endif #include "data_generation/mock_generator.h" #include "data_generation/prompt_formatting/gemma4_jinja_prompt_formatter.h" #include "data_generation/prompt_formatting/prompt_formatter.h" @@ -31,7 +33,9 @@ #include "services/curated_data/curated_json_data_service.h" // --- llama backend --- +#ifndef BIERGARTEN_MOCK_ONLY #include "llama_backend_state.h" +#endif // --- services: curated_data --- #include "services/curated_data/curated_data_service.h" diff --git a/tooling/pipeline/src/main.cc b/tooling/pipeline/src/main.cc index 9d33b8d..3086ff6 100644 --- a/tooling/pipeline/src/main.cc +++ b/tooling/pipeline/src/main.cc @@ -174,6 +174,14 @@ int main(const int argc, char** argv) { return std::make_unique(); } +#ifdef BIERGARTEN_MOCK_ONLY + // Unreachable: ParseArguments requires --mocked when + // BIERGARTEN_MOCK_ONLY is compiled in, so LlamaGenerator is + // never constructed and is not linked into this binary. + throw std::runtime_error( + "LlamaGenerator is unavailable in a BIERGARTEN_MOCK_ONLY " + "build"); +#else log_producer->Log( {.level = LogLevel::Info, .phase = PipelinePhase::Startup, @@ -187,6 +195,7 @@ int main(const int argc, char** argv) { options, model_path, log_producer, inj.template create>(), std::move(prompt_directory)); +#endif })); const auto orchestrator =