-
Notifications
You must be signed in to change notification settings - Fork 125
[CMake] Remove unused dependency on Foundation build directory #1260
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
base: main
Are you sure you want to change the base?
Conversation
@swift-ci test |
I thought these linker flags were necessary, so if your investigation leads you to believe we should remove them, please elaborate since I don't quite understand all the factors involved here. I skimmed the linked Swift PR but it looks like it's gone in a few different directions so I'm unclear where things stand there, currently. |
My understanding is that these flags add a dependency to the CMake target, which is in the Foundation build directory, eg Of course, this didn't break anything so it was fine so far, but my linked frontend pull enforces that the compiler looks in the passed in
Note how it gets confused between the SDK path and the module map files from the source directories that these CMake targets are transitively adding. Basically, the Windows CI was mixing and matching files from the build directories, the source directories, and the final installed SDK directory to build each new core library like Foundation or XCTest. Once my frontend pull makes sure non-Darwin platforms use only the installed SDK directory, these flags broke the Windows CI, because it is the only platform CI that uses that SDK directory very early on with the I went ahead and got rid of it for linux and other |
Good news is that previously failing command now passed on the Windows CI with my frontend pull, bad news is the CI now can't find |
@compnerd Please review when @finagolfin is ready. |
This passed the linux CI and has no effect on the mac CI, now to see if I can get it working on Windows. |
As explained above, these removed lines add CMake dependencies that are unneeded by the current On the other hand, leaving this in also doesn't break anything anymore, both with my linked pull and obviously for trunk. So it's now just a question of removing superfluous config, will leave that up to @rintaro and @stmontgomery to decide, as they originally added these lines, plus @compnerd's input is welcome. |
Can you run a toolchain build with this PR? If it passes, I have no problem taking the change. |
(I think you ran something but it's been decached already.) |
Ran the toolchain builds, no problem. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the successful toolchain builds this seems fine to me. I'd love for @compnerd to comment as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we should prefer to leave this as is. This is ensuring that we are properly declaring the dependencies and thus the build graph. Additionally, when find_package(Foundation)
is present, this allows for tracking inter-project dependencies.
CC: @etcwilde
I agree with @compnerd that we should not be removing real dependency edges and hoping that people "do the right thing". This looks like a bug in the Just posted these two PRs that should fix this issue: |
@finagolfin Given @etcwilde's diagnosis, does it make sense to close this PR? |
Not sure what you mean, are you suggesting that any arbitrary Swift repo that imports Foundation should always explicitly list Foundation in its CMake config? The whole point of shipping Foundation as a Swift runtime library is that it's assumed that it's there. Since Testing is now always built on the CI only after the platform SDK for non-Darwin platforms has been built and locally installed, these dependencies on the Foundation build directory are useless, which is why all the toolchain builds passed.
No idea what this refers to, as this pull does not touch those module maps and everything works with or without this pull. The reason to remove these lines is because these dependencies are completely unnecessary on the CI, because the host platform SDK is always assembled on the CI before building Testing. That is not the case for XCTest and other corelibs, which is where this dependency was likely copied from, so they need the dependency to find the Foundation build directory to build against. This library doesn't. |
The failure you're reporting is because the compiler is seeing re-definitions of the |
@etcwilde, ah, I see, you are referring to my original comment from two months ago, when I needed this change for Windows alone with my frontend pull, but since then Saleem changed how Testing is built on the Windows CI and this pull, whether it is applied or not, no longer has any effect, as I noted yesterday. Thanks for those Foundation module map pulls: I don't know enough about that aspect, but if that helps in other ways, great. Since these dependencies I am removing here have zero effect, as my successful toolchain builds on the CI show, I am proposing removing them. |
See if this helps with swiftlang/swift#79621