-
Notifications
You must be signed in to change notification settings - Fork 19
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
swift code being compiled 3 times #33
Comments
By "incremental builds", do you mean that it doesn't happen in a full build? It shouldn't compile 3 times, unless you build your target for more than one platform (for instance, iOS and watchOS). You can pass |
I was doing tests with incremental builds but it happens in clean/full builds too, sorry for that. i am compiling only for one platform (iOS) and it happens to all my swift targets, I did an small example reproducing it using one of our dependencies (Apollo) and here is the output of bazel build with
Here is the example project ready to run: |
Interesting find - thanks for the report. This is probably related to this bug in Bazel. I'll try to find a way to work around it. We build the |
ios_static_framework rule directly Address #33 for the Swift-only targets.
@omarzl Can you try again with the latest version of |
Hello @thii!
We migrated all our project and its dependencies to bazel but we can't reduce the build time in incremental builds for swift targets.
I added the profiling flag to bazel build command and here are the results loaded in chrome, as you can see there are three "Compiling Swift module Apollo" steps in different threads.
And if I use the official Bazel rule there is only one "Compiling Swift module Apollo" step
So I think that the swift module is being compile 3 times, I tried to modify the swift_static_framework.bzl without success, as far as I understand I guess that it is compiling 3 times because of the 3 header maps (public, private, private angled), each one compiles a swift module?
Do you have the same behavior with Line's dependencies?
Here is the target definition:
And the trace files:
traces.zip
The text was updated successfully, but these errors were encountered: