Build systems are a fundamental part of software construction, but their correctness has received comparatively little attention, relative to more prominent parts of the toolchain. In this paper, we address the correctness of \emph{forward build systems}, which automatically determine the dependency structure of the build, rather than having it specified by the programmer. We first define what it means for a forward build system to be correct -- it must behave identically to simply executing the programmer-specified commands in order. Of course, realistic build systems avoid repeated work, stop early when possible, and run commands in parallel, and we prove that these optimizations, as embodied in the recent forward build system \textsc{Rattle}, preserve our definition of correctness. Along the way, we show that other forward build systems, such as \textsc{Fabricate} and \textsc{Memoize}, are also correct. We carry out all of our work in \Agda, and describe in detail the assumptions underlying both \textsc{Rattle} itself and our modeling of it.
翻译:构建系统是软件构建的一个基本部分, 但相对于工具链中更为突出的部分而言, 其正确性相对而言受到的关注相对较少。 在本文中, 我们处理的就是 \ emph{forward building systems} 的正确性, 它自动决定了构建的依附结构, 而不是由程序员指定。 我们首先定义了前建系统要正确意味着什么 -- 它的行为必须与仅仅执行程序员指定命令的正确性完全相同。 当然, 现实的构建系统避免重复工作, 尽早停止操作, 并平行运行命令, 我们证明这些优化, 体现在最近的前建系统 \ textsc{ Rattle} 中, 保存了我们对正确性的定义。 沿着这条路, 我们展示了其他前建系统, 如\ textsc{fabrc} 和\ textsc{Memolize} 也是正确的。 我们在\ Agda 中完成我们的全部工作, 并详细描述构成\ texts{rttle) 本身及其模型的假设 。