Skip to content
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

Superfluous rebuilds for Skip apps containing multiple targets #372

Open
marcprux opened this issue Mar 18, 2025 · 1 comment
Open

Superfluous rebuilds for Skip apps containing multiple targets #372

marcprux opened this issue Mar 18, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@marcprux
Copy link
Contributor

A Skip-enabled app that contains multiple targets, such as the https://github.com/skiptools/skipapp-weather.git sample app (which contains a separate SkipWeather and SkipWeatherModel targets), can sometimes be slow to rebuild, even if no changes have been made. Other times, the build results are cached and the build is very fast.

This isn't the case for a Skip app that contains only a single target, such as https://github.com/skiptools/skipapp-hello.git. In those cases, rebuilds are always very fast.

To illustrate, see the following series of build logs there are taken from 3 subsequent builds (with no changes in between). The first (leftmost build) takes 47.5 seconds, the second (middle) takes 5.8 seconds, and then the third (rightmost) takes 43.1 seconds:

Image

Whether it takes 5 seconds or 45 seconds is random, but a correlating factor can be seen by scrolling to the top of the build log and observing that the slow builds correspond to a message about "Removed stale file…" during the "Prepare build" phase:

Image

This is random, but it is speculated that it has to do with a timing issue around the generation of the plugin scripts for projects that contain more than one target. Since unnecessary rebuild will result in the skipstone plugin being run on every dependent package – resulting in the parsing of every single .swift file in those dependencies – this bug can lead to extremely slow build times even for projects that haven't made any changes at all to any of their source files.

@marcprux
Copy link
Contributor Author

This is a bug in Xcode and swift-build: swiftlang/swift-build#312. It can be reproduced using any build plugin, not just Skip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant