Skip to content

Specify missing dependencies on swift_static .swiftmodule files #41320

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

Merged
merged 1 commit into from
Feb 12, 2022

Conversation

kubamracek
Copy link
Contributor

@kubamracek kubamracek commented Feb 10, 2022

Apparently, the .swiftmodule files in "lib/swift_static" (as opposed to "lib/swift") do not get incrementally rebuilt on changes to .swift source code in the stdlib. I think I understand CMake less and less, if someone could explain to me why this is needed I would be forever grateful :)

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is desired behaviour! There is no reason for regenerating the swiftmodule, the custom command has no dependency on the sources, so if the sources changes, there is no change to the swift module as far as you have informed CMake. This is the same as having a Makefile rule that generates a file but does not depend on its inputs - it would never change. This is why explicitly listing source files in add_library and add_executable is important - it ensures that any change will re-trigger the target to be built.

I would say that it's the homegrown build system written in CMake that you don't understand rather than CMake, CMake is not really meant to be used this way.

@kubamracek
Copy link
Contributor Author

I guess the part that surprises me is this (and please correct me if my understanding is wrong): If the specified dependency is on a file, it behaves differently from a dependency on another target. A change of the file triggers a rebuild, but a "rebuild" of target dependency does not trigger a rebuild. In that sense, the dependency-rebuilding behavior is not transitive (as I had naively expected).

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek kubamracek merged commit 9b661aa into swiftlang:main Feb 12, 2022
@kubamracek kubamracek deleted the deps-for-static branch February 12, 2022 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants