Found while investigating #317.
What happens: on the ruby launch path, env passed via dapLaunchArgs is silently dropped. RubyDebugAdapter.buildAdapterCommand builds the spawn environment solely from {...process.env, RUBY_DEBUG_DAP_SHOW_PROTOCOL} and never reads config.launchConfig.env. The value does survive transformLaunchConfig into the DAP launch request args, but that's a dead end: with rdbg --open -c -- ruby <script> the debuggee process is already running by the time the DAP launch request arrives, so rdbg's launch response is effectively an ack and the env is never applied.
Expected: launchConfig.env merged into the spawn env of the rdbg child (e.g. {...process.env, ...launchConfig.env, <adapter-managed vars>}), so users can set env for the debuggee the same way as other adapters. Merge order matters — an explicit user value should win over inherited process.env, and adapter-managed vars should be composed rather than clobbered.
Contrast: attach mode does forward env (if (config.env) attachConfig.env = config.env in transformAttachConfig), and other adapters pass user env through their spawn paths.
Where: packages/adapter-ruby/src/ruby-debug-adapter.ts — buildAdapterCommand (env literal) and buildTargetCommand.
Environment: main, all platforms (structural, not platform-specific).
Found while investigating #317.
What happens: on the ruby launch path,
envpassed viadapLaunchArgsis silently dropped.RubyDebugAdapter.buildAdapterCommandbuilds the spawn environment solely from{...process.env, RUBY_DEBUG_DAP_SHOW_PROTOCOL}and never readsconfig.launchConfig.env. The value does survivetransformLaunchConfiginto the DAP launch request args, but that's a dead end: withrdbg --open -c -- ruby <script>the debuggee process is already running by the time the DAPlaunchrequest arrives, so rdbg's launch response is effectively an ack and the env is never applied.Expected:
launchConfig.envmerged into the spawn env of the rdbg child (e.g.{...process.env, ...launchConfig.env, <adapter-managed vars>}), so users can set env for the debuggee the same way as other adapters. Merge order matters — an explicit user value should win over inheritedprocess.env, and adapter-managed vars should be composed rather than clobbered.Contrast: attach mode does forward env (
if (config.env) attachConfig.env = config.envintransformAttachConfig), and other adapters pass user env through their spawn paths.Where:
packages/adapter-ruby/src/ruby-debug-adapter.ts—buildAdapterCommand(env literal) andbuildTargetCommand.Environment: main, all platforms (structural, not platform-specific).