[Lldb-commits] [lldb] [lldb] Inherit Host::GetEnvironment() when launching a wasm runtime (PR #190476)
Maarten Steevens via lldb-commits
lldb-commits at lists.llvm.org
Sat Apr 4 11:10:52 PDT 2026
https://github.com/MaartenS11 created https://github.com/llvm/llvm-project/pull/190476
Some WebAssembly runtimes might use environment variables such as `HOME` or `XDG_CONFIG_HOME` to store configuration files, additionally some VMs might allow wasm modules to read environment variables from the host. Currently, if a runtime is launched using the WebAssembly platform it doesn't inherit the environment. As a result wasm runtimes and modules are unable to read from environment variables and might even fail to launch (if the config file is required).
>From 609d6543185531d9a211a5b9d4fbe7b8bd425423 Mon Sep 17 00:00:00 2001
From: MaartenS11 <maarten.steevens at gmail.com>
Date: Sat, 4 Apr 2026 19:52:07 +0200
Subject: [PATCH] [lldb] Inherit Host::GetEnvironment() when launching a wasm
runtime
---
lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.cpp b/lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.cpp
index fb52e48850cb9..a7c60aec98670 100644
--- a/lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.cpp
+++ b/lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.cpp
@@ -176,6 +176,7 @@ lldb::ProcessSP PlatformWasm::DebugProcess(ProcessLaunchInfo &launch_info,
launch_info.SetArguments(args, true);
launch_info.SetLaunchInSeparateProcessGroup(true);
launch_info.GetFlags().Clear(eLaunchFlagDebug);
+ launch_info.GetEnvironment() = Host::GetEnvironment();
auto exit_code = std::make_shared<std::optional<int>>();
launch_info.SetMonitorProcessCallback(
More information about the lldb-commits
mailing list