Skip to content

Commit 2ec6d1c

Browse files
committed
[lldb/test] Fix libcxx configuration handling for remote platforms (llvm#172761)
When using --platform remote-* options, explicitly clear the libcxx configuration variables instead of just warning and continuing with potentially set values. This prevents the test suite from attempting to use custom libcxx paths on remote platforms where they're not applicable. Also initialize libcxx variables to None when not specified, ensuring a clean state regardless of how the arguments are parsed. Signed-off-by: Med Ismail Bennani <[email protected]> (cherry picked from commit f8377f5)
1 parent 8f5f263 commit 2ec6d1c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lldb/packages/Python/lldbsuite/test/dotest.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,15 +289,25 @@ def parseOptionsAndInitTestdirs():
289289
logging.warning(
290290
"Custom libc++ is not supported for remote runs: ignoring --libcxx arguments"
291291
)
292+
# Don't set libcxx paths for remote platforms - use SDK's libc++ instead
293+
configuration.libcxx_include_dir = None
294+
configuration.libcxx_include_target_dir = None
295+
configuration.libcxx_library_dir = None
292296
elif not (args.libcxx_include_dir and args.libcxx_library_dir):
293297
logging.error(
294298
"Custom libc++ requires both --libcxx-include-dir and --libcxx-library-dir"
295299
)
296300
sys.exit(-1)
297301
else:
302+
# Use custom libcxx for local runs
298303
configuration.libcxx_include_dir = args.libcxx_include_dir
299304
configuration.libcxx_include_target_dir = args.libcxx_include_target_dir
300305
configuration.libcxx_library_dir = args.libcxx_library_dir
306+
else:
307+
# No custom libcxx specified
308+
configuration.libcxx_include_dir = None
309+
configuration.libcxx_include_target_dir = None
310+
configuration.libcxx_library_dir = None
301311

302312
configuration.cmake_build_type = args.cmake_build_type.lower()
303313

@@ -311,7 +321,7 @@ def parseOptionsAndInitTestdirs():
311321
lldbtest_config.out_of_tree_debugserver = args.out_of_tree_debugserver
312322

313323
# Set SDKROOT if we are using an Apple SDK
314-
if args.sysroot is not None:
324+
if args.sysroot:
315325
configuration.sdkroot = args.sysroot
316326
elif platform_system == "Darwin" and args.apple_sdk:
317327
configuration.sdkroot = seven.get_command_output(

0 commit comments

Comments
 (0)