Skip to content
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

Allow Swift to enable LLDB tests in Windows CI #9513

Merged

Conversation

weliveindetail
Copy link
Member

This is the companion PR with all the llvm-project changes for swiftlang/swift#76894

JDevlieghere and others added 13 commits November 27, 2024 12:24
…lvm#111729)

Use SEND_ERROR (continue processing, but skip generation) instead of
FATAL_ERROR (stop processing and generation). This means that developers
get to see all errors at once, instead of seeing just the first error
and having to reconfigure to discover the next one.
Many LLDB's dotest.py based tests require the `make` tool. If it's not found in Path, they fail with an obscure error and show up as `UNRESOLVED`. On Windows, llvm-lit takes care of MSYS based testing tools like cat, printf, etc., but `make` is not part of that. Let's catch the situation early and check for it at configuration time.

This error isn't fatal: It should fail the build, but not immediately stop the configuration process. There might be other issues further down the line that can be caught in the same buildbot run.
…m#112342)

In recent PR llvm#111531 for
Windows support, we enabled tests that require the `make` tool. On
Windows, default install directories likely contain spaces, in this case
e.g. `C:\Program Files (x86)\GnuWin32\bin\make.exe`. It's typically
handled well by CMake, so that today invocations from `dotest.py` don't
cause issues. However, we also have nested invocations from a number of
Makefiles themselves. These still failed if the path to the `make` tool
contains spaces.

This patch attempts to fix the functionalities/completion test by adding
quotes in the respective Makefile. If it keeps passing on the bots, we can
roll out the fix to all affected tests.
…m#112360)

Following up from llvm#112342, we
roll out the fix and quote nested `make` invocations in all API tests.
We need the manual lookup in lldb/source/Host/windows/HostInfoWindowsSwift.cpp to succeed.
Otherwise SwiftASTContext::CreateInstance() fails with: Cannot create Swift scratch context (couldn't load the Swift stdlib)
…lit config

These binaries only exists if the Swift runtime was built correctly.
We cannot check them at configuration time, because they might not exist yet.
This adds a minor change to command-expr-diagnostics.test to make
it pass on windows. Clang produces PDB on windows by default which
was ignoring main symbol due to optimization. The problem is fixed
by adding -gdwarf to commandline, making sure dwarf debug info gets
generated on both Windows and Linux.
…2109)"

This reverts commit eca3206.

This broke LLDB Linux bot for no apparent reason. I ll post a more
suitable fix later. Disabled command-expr-diagnostics.test on
windows for now.
…5716)

Since the remote Shell test execution feature was added, these tests
should now be disabled on Windows target instead of Windows host.

It should fix failures on
https://lab.llvm.org/staging/#/builders/197/builds/76.
This patch removes XFAIL decorators from tests that are passing on x86
Windows.

Corresponding XFAILs for AArch64 were removed here 7daa9a9.
@hjyamauchi
Copy link

@swift-ci please test

llvm#111531)

Bot maintainers should be aware and it became too much of a burden
for developers. In particular on Windows, where make.exe won't be
found in Path typically.
@weliveindetail
Copy link
Member Author

Build failed because make wasn't found. We don't have detection for it until the swift PR lands and I missed the cherry-pick that turns it into a warning.

@compnerd
Copy link
Member

compnerd commented Dec 4, 2024

@swift-ci please test

@hjyamauchi
Copy link

@swift-ci please test Windows Platform

@weliveindetail
Copy link
Member Author

Windows platform failed due to an unrelated build error. LLDB was building fine. We didn't get to the test stage.

@compnerd
Copy link
Member

compnerd commented Dec 5, 2024

@swift-ci please test Windows platform

Comment on lines +201 to +218
# Since Python3.8 the Windows runtime loads dependent DLLs only from the directory of the binary
# itself (and not Path). Windows has no RPATHs, so we must copy all DLLs that we depend on into
# the Python package.
if (WIN32)
# TARGET_RUNTIME_DLLS is supported in CMake 3.21+
if ("${CMAKE_VERSION}" VERSION_LESS "3.21.0")
if (LLDB_INCLUDE_TESTS)
message(SEND_ERROR
"Your CMake version is ${CMAKE_VERSION}. In order to run LLDB tests "
"on Windows please upgrade to 3.21.0 at least (or disable tests with "
"LLDB_INCLUDE_TESTS=Off)")
endif()
else()
add_custom_command(TARGET ${swig_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy -t ${lldb_python_target_dir} $<TARGET_RUNTIME_DLLS:liblldb>
COMMAND_EXPAND_LISTS)
endif()
endif()

Choose a reason for hiding this comment

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

Any reason this can't go upstream? Or is this a cherrypick?

Copy link
Member Author

@weliveindetail weliveindetail Dec 5, 2024

Choose a reason for hiding this comment

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

In upstream LLVM liblldb has no dependent DLLs (except Python itself) so there was no case for it. And yes, it's a cherry-pick from #9370

Copy link

@JDevlieghere JDevlieghere left a comment

Choose a reason for hiding this comment

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

LGTM. Most of these are cherrypicks from upstream and everything else is Swift specific. Thanks @weliveindetail!

@JDevlieghere JDevlieghere merged commit 8ff38c7 into swiftlang:stable/20240723 Dec 11, 2024
3 checks passed
@weliveindetail weliveindetail deleted the lldb-tests-20240723 branch December 11, 2024 14:32
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.

6 participants