arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2108.12469cs.PLcs.SE
收藏

LaForge:从简单的规格实现始终正确的快速增量构建

LaForge: Always-Correct and Fast Incremental Builds from Simple Specifications

Charlie Curtsinger, Daniel W. Barowy

摘要:

开发人员依靠构建系统从代码生成软件。至少,构建系统应该从代码的干净副本中生成构建目标。但是,开发人员很少从干净的签出工作。相反,他们会重复地重建软件,有时一天要重建数百次。为了保持快速重建,构建系统以增量方式运行,仅在无法重用构建状态时才执行命令。现有的工具,如使目前的用户与权衡。简单的构建规范很容易编写,但限制了增量工作。更复杂的构建规范产生更快的增量构建,但是编写它们是劳动密集型的并且容易出错。这项工作表明,没有这样的权衡是必要的;构建规范可以既简单又快速。我们介绍LaForge,一种新颖的构建工具,它消除了指定依赖关系或增量构建步骤的需要。LaForge构建很容易指定;开发人员编写一个简单的脚本来运行完整的构建。即使是像gcc src/*.c这样的命令也足够了。LaForge跟踪构建的执行并生成TraceIR语言的记录。在以后的构建中,LaForge会评估TraceIR记录以检测更改并执行高效的增量重建,自动捕获所有构建依赖项。我们通过构建14个软件包来评估LaForge,包括LLVM和memcached。我们的研究结果表明,LaForge自动生成高效的构建从简单的构建规范。与项目的默认完整构建相比,LaForge的完整构建的平均开销为16.1%。LaForge的增量构建始终运行更少的命令,并且大多数比手动指定的增量构建花费不到3.08秒的时间。最后,LaForge总是正确的。

英文摘要:

Developers rely on build systems to generate software from code. At a minimum, a build system should produce build targets from a clean copy of the code. However, developers rarely work from clean checkouts. Instead, they rebuild software repeatedly, sometimes hundreds of times a day. To keep rebuilds fast, build systems run incrementally, executing commands only when built state cannot be reused. Existing tools like make present users with a tradeoff. Simple build specifications are easy to write, but limit incremental work. More complex build specifications produce faster incremental builds, but writing them is labor-intensive and error-prone. This work shows that no such tradeoff is necessary; build specifications can be both simple and fast. We introduce LaForge, a novel build tool that eliminates the need to specify dependencies or incremental build steps. LaForge builds are easy to specify; developers write a simple script that runs a full build. Even a single command like gcc src/*.c will suffice. LaForge traces the execution of the build and generates a transcript in the TraceIR language. On later builds, LaForge evaluates the TraceIR transcript to detect changes and perform an efficient incremental rebuild that automatically captures all build dependencies. We evaluate LaForge by building 14 software packages, including LLVM and memcached. Our results show that LaForge automatically generates efficient builds from simple build specifications. Full builds with LaForge have a median overhead of 16.1% compared to a project's default full build. LaForge's incremental builds consistently run fewer commands, and most take less than 3.08s longer than manually-specified incremental builds. Finally, LaForge is always correct.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑