-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support -incremental mode #48
Comments
Are there any related issues elsewhere about supporting the Swift-style incremental compilation model? It sounds like kotlin and rust might also benefit from support for this in bazel, although I'm not 100% sure they use exactly the same model. |
bazel-discuss using a stateful compiler with Bazel rules_scala Should we re-consider zinc's incremental compilation? I helped author https://github.com/andyscott/rules_scala_annex which implements Zinc (stateful incremental Scala compiler). There, the stateful incrementality is an opt-in for workers. |
Thanks for the references @pauldraper. |
Posted the first blocker we hit while working on the persistent worker approach here bazelbuild/bazel#6223 |
In bazelbuild/rules_apple#21 (comment), @dmishe listed two approaches: a non-sandbox approach (persisting incremental artifacts in the file system), and a persistent worker approach. What are the trade-offs between the two alternative options? |
Posted another blocker we hit bazelbuild/bazel#6230 in theory we could work around this by using a list for building the linker arguments, but being able to combine Args objects seems reasonable to solve this as well. |
Both cases are fairly similar to implement, as I imagine(?) the worker will still persist files on disk. The ergonomics of selecting incremental compilation can differ. Note you will still want to make sure a non-worker, sandboxed, non-incremental fully deterministic method exists. For reference, this is how https://github.com/andyscott/rules_scala_annex works: If the compiler worker receives a My own use:
Devs get rapid incremental builds. CI gets assuredly deterministic builds (plus, the "previous build" is not always clear anyway). Multiples workers on a dev machine share the same analysis store. And devs can use CI's cache because Philosophically, I view stateful compilation as a worker-ish thing. The purpose of workers is to reuse expensive state from one action to the next -- typically JIT. Stateful compilation is simply additional state that the worker reuses. |
@pauldraper thanks for all the context here. I noticed that you're using a hidden directory inside the execution root? Is this required? It looks like in my testing it is, and if it isn't hidden bazel wipes it out between builds, is that your understanding as well? |
I believe it can be any name, so long as it doesn't conflict with existing paths (packages). There wasn't a strong reason to make it hidden. |
We may be able to do this with a Bazel persistent worker, which would let us non-hermetically collect the outputs of a library's previous compilations and feed them back in as inputs to future compilations, so that the driver can detect whether they have changed.
However, this is more complicated than simply flipping on a flag—we'll need to design and build a local server that is used as the worker process.
The text was updated successfully, but these errors were encountered: