#pragma once #include #include #include #include #include #include #include #include #include namespace vls::modules { struct ModuleCommand { std::filesystem::path working_directory; // Absolute compiler path first. Arguments must not depend on the caller's // working directory: the work runs in a private directory. std::vector arguments; }; using ModuleCommandLookup = std::function(const Build::ContextKey &)>; struct GccArtifactOptions { std::chrono::milliseconds deadline{60000}; std::size_t max_output_bytes{64 * 1024 * 1024}; std::size_t max_artifact_bytes{512 * 1024 * 1024}; }; // Real GCC module artifact production for one planned unit: runs the looked-up // command in a private working directory with a private module cache, requires // exactly one verified CMI and copies it to `output`. Tool authority, the // command's environment and its provenance are the caller's responsibility. [[nodiscard]] ArtifactWork gcc_module_artifact_work(ModuleCommandLookup lookup, GccArtifactOptions options = GccArtifactOptions{}); } // namespace vls::modules