Skip to content

Conversation

@charles-zablit
Copy link
Contributor

@charles-zablit charles-zablit commented Oct 22, 2025

We cannot break upstream lldb tests from swiftlang/swift. This patch adds the check-lldb-swift target through the lldb-swift test, which will only check the swift subset of lldb tests.

rdar://162128596

@charles-zablit
Copy link
Contributor Author

@swift-ci please test windows

utils/build.ps1 Outdated
LLVM_UNITTEST_LINK_FLAGS = "$(Get-SwiftSDK -OS Windows -Identifier Windows)\usr\lib\swift\windows\$($Platform.Architecture.LLVMName)\swiftCore.lib";
}

if ($env:ONLY_SWIFT_LLDB_TESTS -eq '1') {
Copy link
Member

Choose a reason for hiding this comment

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

I really would rather not introduce this type of behaviour in build.ps1. Can we sink this check into lit itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would using the check-lldb-swift target be better? https://github.com/swiftlang/llvm-project/blob/b6f1a41420ebffc7f043b16080ef0e8afde4d2cc/lldb/test/CMakeLists.txt#L302-L306

we could have lldb and lldb-swift in the list of tests that build.ps1 supports

@charles-zablit
Copy link
Contributor Author

charles-zablit commented Oct 24, 2025

I opened an alternative PR here: swiftlang/llvm-project#11695

@charles-zablit charles-zablit force-pushed the charles-zablit/windows/lldb-only-run-swift-test-subset branch from 2be681e to 5e5b70e Compare October 24, 2025 16:51
utils/build.ps1 Outdated
DownloadAndVerify $PinnedBuild "$BinaryCache\$PinnedToolchain.exe" $PinnedSHA256

if ($Test -contains "lldb") {
if ($Test -contains "lldb" || $Test -contains "lldb-swift") {
Copy link
Member

Choose a reason for hiding this comment

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

I think that -Or is the preferred spelling here (-Or is the Boolean check, || is the chained operation check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, thanks!

utils/build.ps1 Outdated
Install-PythonModule "packaging" # For building LLVM 18+
Install-PythonModule "setuptools" # Required for SWIG support
if ($Test -contains "lldb") {
if ($Test -contains "lldb" | $Test -contains "lldb-swift") {
Copy link
Member

Choose a reason for hiding this comment

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

This is wrong - -Or should be preferred, || is acceptable. This is going a bit operation :(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry about that, I think I did an incorrect copy paste when rebasing. I switched to using -or and -and.

utils/build.ps1 Outdated
if ($TestLLDB) {
$Targets += @("check-lldb")
if ($TestLLDB || $TestLLDBSwift) {
if (($TestLLDB && $TestLLDBSwift) || $TestLLDB) {
Copy link
Member

Choose a reason for hiding this comment

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

I'd like this to be simpler:
-TestLLDB: check-lldb
-TestLLDBSwift: check-lldb-swift

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to match that pattern, please let me know what you think.

Copy link
Member

Choose a reason for hiding this comment

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

I think that there shouldn't be any other conditions - if you specify -TestSwiftLLDB it should run check-lldb-swift. If you specify -TestLLDB, it should run check-lldb. Either we make this fragile or push the check into the build system. We shouldn't be doing any filtering in this script.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we do this, it means build.ps1 runs the Swift subset of test twice by default. check-lldb runs the entirety of the lldb test suite (including the swift tests) whereas check-lldb-swift is equivalent to check-lldb --filter='swift'.

We shouldn't be doing any filtering in this script.

We can't refactor the behavior of check-lldb to exclude swift tests as per Adrian's comment.

We can't add the env variable check in lit either because the config is evaluated after the tests have been filtered out.

If we can't add this small extra bit of logic in build.ps1, I'm not sure where we could add it.

I don't think running the swift subset of tests twice by default is a good change either.

@charles-zablit charles-zablit force-pushed the charles-zablit/windows/lldb-only-run-swift-test-subset branch from 5e5b70e to 1a1a180 Compare October 27, 2025 21:24
@charles-zablit charles-zablit force-pushed the charles-zablit/windows/lldb-only-run-swift-test-subset branch from 1a1a180 to 3df36f4 Compare October 28, 2025 23:40
@charles-zablit
Copy link
Contributor Author

With the latest changes, by default, following the discussion in this thread, we run the Swift subset of lldb tests twice: once in check-lldb and once in check-lldb-swift. It's up to the user and the CI to make sure to exclude either lldb or lldb-swift from the list of tests.

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