-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[CMake] Fix dependency on the build directory #32870
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
Conversation
@swift-ci please smoke test |
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'm not sure if anyone is relying on the ability to run the test suite with prebuilt binaries (I could see that being useful for running the standard library tests).
If we are removing the use of the prebuilt path, assuming that no one is relying on that quirk, I am not sure I understand why this is better than say replacing L117-L125 with L120. That actually will have CMake generate the proper dependency and we don't need to worry about the path computation or string operations and is much simpler.
CC: @drexin
@compnerd – Unless I'm missing something, this only changes how build target dependencies are calculated. Without this change, the testing targets fail due to a missing build target. |
Correct, it changes how the build target dependencies are calculated. But, why calculate the dependencies manually when CMake can do it for us? I'm saying that we can just take the path that is currently marked as the Xcode path and get the same behaviour in a concise and consistent manner. Does that not accomplish the same thing that your change does? The second point is related to the fact that the lit effectively uses |
I think that the comment is outdated, but, yes, that was exactly what I meant. The code change itself looks good to me. Might be a good idea to double check with others that no one is relying on the custom |
Others? Who do you have in mind? Can CC them or should I post in the forums? |
I'm not personally using SWIFT_NATIVE_SWIFT_TOOLS_PATH, but I think it's an important feature for anyone working on the stdlib. Does this PR make it impossible to run the tests from a standalone stdlib build? |
This patch only changes CMake's target dependency generation. |
Thinking more about this ... the changes here should only impact the build times, not the workflow itself. We should keep the dependencies correct and we can always find a way to alleviate that if it is a true problem. Id say ping @gottesmm, but otherwise, I think that it is probably better to merge sooner rather than later. |
SWIFT_NATIVE_SWIFT_TOOLS_PATH can be set to a path outside of the build directory and the Xcode approach is simplier anyway.
Fixed the comment. I'd like to point out that this does not "only impact the build times". If one sets SWIFT_NATIVE_SWIFT_TOOLS_PATH then the build will fail because a bogus dependency on a non-existent build target will be created and @swift-ci please smoke test |
I haven't looked into exactly how this affects using a prebuilt Swift compiler to build a standalone stdlib and test it- which "sets |
@buttaface – As I wrote earlier in this PR, this change only affects how build system dependencies are generated. If I might repeat myself with different words: the current behavior is bogus. If one sets |
@davezarzycki the reason people are asking is that the diff appears to remove a special case that was deliberately added to support the native tools use case. So we'll just need to take your word that it still(?) works, or maybe continues to not work.. I can't tell |
I just tested this pull by building and testing the standalone stdlib and that still works, as that preset disables @davezarzycki, any idea what scenario this was added to support originally? |
Sorry for the earlier deleted comment. I'm not in front of my computer. If I had to wager, then I'd bet that somebody just searched for SWIFT_RUNTIME_OUTPUT_INTDIR and replaced with SWIFT_NATIVE_SWIFT_TOOLS_PATH without thinking deeply about each replaced variable use and whether it worked by accident or by design. |
Now that I'm in front of my computer, I dug through the source history and unfortunately the history wasn't preserved across Swift being open sourced. Maybe somebody at Apple can dig further? |
@davezarzycki, @buttaface already confirmed that the standalone preset+tests still works. I think that's all that matters aside from the change generally making sense, which it does. |
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.
Yep.
Thank you everybody for the feedback |
SWIFT_NATIVE_SWIFT_TOOLS_PATH can be set to a path outside of the build directory whereas SWIFT_RUNTIME_OUTPUT_INTDIR always points to the build directory.