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

[SR-6180] Foundation build is not incremental #3798

Closed
ankitspd opened this issue Oct 18, 2017 · 7 comments
Closed

[SR-6180] Foundation build is not incremental #3798

ankitspd opened this issue Oct 18, 2017 · 7 comments

Comments

@ankitspd
Copy link
Member

Previous ID SR-6180
Radar rdar://problem/35057628
Original Reporter @aciidb0mb3r
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee None
Priority Medium

md5: d0e998118cb0e130e383e00c78c0268f

relates to:

  • SR-11411 GettingStarted.md of swift-corelibs-foundation should be updated

Issue Description:

The foundation sources are recompiled every time from scratch. This is obviously not a good workflow for contributors.

@ankitspd
Copy link
Member Author

@swift-ci create

@alblue
Copy link
Contributor

alblue commented Oct 19, 2017

The Docs/GettingStarted.md contains this instruction:

-~~~~8<~~~~-

The default build script does not include Foundation. To build Foundation and XC
Test as well, pass `--xctest --foundation` to the build script.

```
swift/utils/build-script --xctest --foundation -t
```

This will build and run the Foundation tests, in the Debug configuration.

After the complete Swift build has finished, you can iterate quickly on Foundati
on itself by simply invoking `ninja` in the Foundation directory.

@alblue
Copy link
Contributor

alblue commented Oct 19, 2017

Note that also on Darwin, you can iterate quickly on Foundation using Xcode, which allows for incremental development and testing.

However, with the move of everything to CMake files, perhaps creating a CMake build system for Foundation would be a possible approach? Right now, the top-level configuration script builds everything, but that's a function of how it's implemented rather than a necessity.

@ankitspd
Copy link
Member Author

The above two approaches work when you're just developing on Foundation but not when you need to invoke swift's build script multiple times. Due to this, we end up recompiling SwiftPM as well. We should definitely try to move to CMake given all other projects are doing so and we can solve the incremental build issue.

@belkadan
Copy link

Right. Foundation is non-incremental today because you'd need to specify dependencies on both Swift itself and any libraries it imports (the stdlib and Dispatch). We don't have a good way to do that in the separated build-script-based build, but if we get everything in one big CMake umbrella then we've got a chance.

@ankitspd
Copy link
Member Author

That sounds promising!

@spevans
Copy link
Collaborator

spevans commented Feb 13, 2020

swift-corelibs-foundation now uses CMake for an incremental build. https://github.com/apple/swift-corelibs-foundation/blob/master/Docs/GettingStarted.md has been updated to show how to use the build-script to do the initial configure and then iterate using cmake.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants