-
Notifications
You must be signed in to change notification settings - Fork 140
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
Split swiftmodule and object generation #241
Comments
This is definitely something I've thought about. My latest focus has been on improving incremental compilation, though. Do you know how this split mode would interact with If it's not compatible with incremental mode, then that poses a slight problem because there's no way for the build rules to know at analysis time whether Bazel is going to be running the action in worker mode or not (the strategy decision isn't made until execution time, after the actions have already been registered). That means that users would have to keep two different flags in sync—the |
There's a bug that blocks this. Passing |
Wow I didn't even know incremental builds would work with bazel. I have looked at your commit about incremental mode: c197356 . So if I understand it correctly you are maintaining a separate file tree which you redirect compiler outputs and you copy necessary files from there to bazel needed paths. In my view splitting Though I am not very knowledgable about compilers and these stuff and could be missing some important parts.
I see, agreed.
well that's bad :( I don't know most of those modes. We use this with btw, im living in European time and sorry for my late responses. |
but with incremental we will have more compile commands with less number of source files right? Maybe it wouldn't be helpful but it would work with incremental mode. Is incremental build only for local builds(i guess) or both local and remote execution? If it is only for local, splitting should help in remote execution |
Please try this out with the new |
I have read the code a bit. Right now we are calling one compile action for a
swift_library
which produces bothobject
andswiftmodule
files. Then we propagateswift_module
files with providers and we registerobject
file to be linked.Given that
swift_library
rules only depend onswiftmodule
files andswiftmodule
generation is taking roughly half the time of generatingobject
files. We can run 2 compilation actions perswift_library
. One to generateswiftmodule
and one to generateobject
files. And we can unlock dependentswift_library
rules once theswiftmodule
is generated.We added this to buckbuild swift rules and we have seen roughly 15% speed increase in our swift builds with the 6 core mac minis. Since it doubles the number of actions advantage of this increases with the number of processes we can run concurrently. And if we are using remote execution this should help much more than with 6 core mac minis.
This can be optional with a config to turn on/off
The text was updated successfully, but these errors were encountered: