-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[Windows] Run swift-format tests from build.ps1 #76900
Conversation
2d21e53
to
b719297
Compare
https://github.com/swiftlang/swift-format @swift-ci Please build toolchain Windows |
@swift-ci Please build toolchain Windows |
SwiftFormat.dll no longer exists after swiftlang/swift#76900.
swiftlang/swift-format#841 @swift-ci Please build toolchain Windows |
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.
Please provide a before and after comparison for the file sizes. This was a HUGE regression the last time I checked. It was about 50MiB larger.
Sure
We cannot do this yet. SPM does not properly link the binary, so there are still issues with it and until that is fixed, I don't think that we should be shipping the SPM built version. |
b719297
to
5ad83bd
Compare
Sorry, I meant to include these but then forgot. For a local toolchain build I get
I don’t know where the difference between my local toolchain build and the toolchain downloaded from CI comes from but the gist is that sizes are very comparable (65KB increase in downloaded toolchains size, 411KB size reduction in local builds). Note that we are not rebuilding and statically linking all the dependencies here. We are only building swift-format and dynamically linking against the already built versions of swift-syntax, swift-markdown etc.
Can you clarify what you mean by SwiftPM not linking correctly? From what I’ve tested so far |
swiftlang/swift-format#841 @swift-ci Please build toolchain Windows |
This is ... unexpected. How do we accomplish this? I'd love to see this adopted in SPM as well!
Sure - the linker spew that you get when building is due to the binary being miscompiled but the linker workaround it. This is something that @dschaefer2 is planning on looking into and I think that we should wait for that. |
Yup, working on that right now. Almost have clean linking happening :). |
I am manually specifying all the search paths with which SwiftPM can find the dynamic libraries built by the previous build stages and explicitly remove all explicit dependencies from swift-format’s package manifest through an environment variable. |
5ad83bd
to
f1bbfc8
Compare
The basic idea is that we build all libraries for the executable that will be included in the toolchain using CMake. swift-format then has a mode in its Package manifest that allows it to build just the test and test support targets, requiring all search paths to find those libraries to be passed in. We use that to only build swift-format's test using SwiftPM and re-use all the libraries that were already built using CMake.
f1bbfc8
to
bb217a3
Compare
I pivoted the approach around a little. Let’s decouple the discussion about how to build the I updated this PR to rely on CMake building everything needed for the toolchain. We then only build the test and test support targets in swift-format using SwiftPM with various search paths to make SwiftPM pick up the pre-built modules and libraries. |
@swift-ci Please test Windows |
@swift-ci Please smoke test macOS |
@swift-ci Please smoke test Linux |
Merging this so we get test coverage for swift-format on Windows and because this has no risk to the toolchain build because it doesn’t change how |
The basic idea is that we build all libraries for the executable that will be included in the toolchain using CMake. swift-format then has a mode in its Package manifest that allows it to build just the test and test support targets, requiring all search paths to find those libraries to be passed in. We use that to only build swift-format's test using SwiftPM and re-use all the libraries that were already built using CMake.
Building the test targets and running the tests takes about 1 minute locally on my machine.