Skip to content

Truly independent web browser

LibWebView: Keep the unwind panic test's Rust runtime private

Andreas Kling7818002bb2ae
diff --git a/Tests/LibWebView/CMakeLists.txt b/Tests/LibWebView/CMakeLists.txt
index 1ba641dacb6..64ec79a0ee3 100644
--- a/Tests/LibWebView/CMakeLists.txt
+++ b/Tests/LibWebView/CMakeLists.txt
@@ -100,6 +100,12 @@ if (APPLE OR LINUX)
add_custom_target(${ARG_CRATE_NAME}_build DEPENDS "${rust_test_library}")
ladybird_test(TestRustCrashReport.cpp LibWebView NAME TestRustCrashReport_${panic_strategy}
LIBS LibWebView "${rust_test_library}")
+ if (LINUX AND panic_strategy STREQUAL "unwind")
+ # Keep the fixture's Rust standard library private to the test executable. Exported, it would take the
+ # place of the copies in Ladybird's shared libraries, which then install their panic hooks into it.
+ get_filename_component(rust_test_library_name "${rust_test_library}" NAME)
+ target_link_options(TestRustCrashReport_${panic_strategy} PRIVATE "LINKER:--exclude-libs,${rust_test_library_name}")
+ endif()
set_tests_properties(TestRustCrashReport_${panic_strategy} PROPERTIES TIMEOUT 60)
add_dependencies(TestRustCrashReport_${panic_strategy} ${ARG_CRATE_NAME}_build)
if (panic_strategy STREQUAL "unwind")