Skip to content

[build.ps1] Support llvm-lit tests with REQUIRES: native condition on Windows #77005

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

weliveindetail
Copy link
Member

@weliveindetail weliveindetail commented Oct 14, 2024

lit adds the native item in available_features, if the target-triple and host-triple strings are equivalent. While we hardcode LLVM_DEFAULT_TARGET_TRIPLE to x86_64-unknown-windows-msvc in the CMake cache file, LLVM_HOST_TRIPLE is inferred automatically, which results in x86_64-pc-windows-msvc.

These triples are compatible, but not string-equivalent and so lit skips all related tests. Let's fix by setting LLVM_HOST_TRIPLE explicitly. We cannot do it in the cache file, because we have to consider cross-compilation.

lit adds the 'native' item in available_features, if the target-triple and host-triple strings are equivalent.
While we hardcode LLVM_DEFAULT_TARGET_TRIPLE to x86_64-unknown-windows-msvc in the CMake cache file, LLVM_HOST_TRIPLE was inferred as x86_64-pc-windows-msvc automatically.
These triples are compatible, but not string-equivalent and so lit skipped all related tests. Let's fix it and also set LLVM_HOST_TRIPLE explicitly.
@hyp
Copy link
Contributor

hyp commented Oct 15, 2024

Seems reasonable to me!

@weliveindetail
Copy link
Member Author

Thanks for reviewing @hyp, I think this is ready t land.

@weliveindetail weliveindetail changed the title [lldb] Support llvm-lit tests with REQUIRES: native condition [lldb] Support llvm-lit tests with REQUIRES: native condition on Windows Oct 16, 2024
@hyp
Copy link
Contributor

hyp commented Oct 16, 2024

@swift-ci please test

@weliveindetail
Copy link
Member Author

On macOS the lang/swift/enums/decoding_error/TestSwiftDecodingErrorEnum.py test failed unexpectedly. This is certainly unrelated to my change.

The Windows build was skipped apparently. Maybe at some point we try again:

@swift-ci please test windows platform

@weliveindetail weliveindetail changed the title [lldb] Support llvm-lit tests with REQUIRES: native condition on Windows [build.ps1] Support llvm-lit tests with REQUIRES: native condition on Windows Oct 18, 2024
@weliveindetail
Copy link
Member Author

Since this patch only touches build.ps1, Windows tests should be sufficient. #77070 unblocked the bot.

@hyp Can we try@swift-ci please test windows platform please?

@weliveindetail
Copy link
Member Author

Let's land this together with the overall PR for LLDB testing.

@weliveindetail weliveindetail deleted the lldb-tests-requires-native branch October 25, 2024 11:00
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