fresh-mechanic-68429
02/05/2024, 7:44 PM--debug
support for our test target (working on a dotnet plugin), and for whatever reason I’m unable to successfully attach to the process from my IDEs. Its unclear to me if this is being caused by the sandboxing or notgorgeous-winter-99296
02/05/2024, 8:06 PMgorgeous-winter-99296
02/05/2024, 8:07 PMrun --debug
works but test --debug
doesn't the most likely candidate I believe would be environment vars. run
doesn't strip the host environment, while test
does.fresh-mechanic-68429
02/05/2024, 8:32 PMrun_in_workspace=True
which I found interesting
return TestDebugRequest(InteractiveProcess(
argv=argv,
env=env,
run_in_workspace=True,
forward_signals_to_process=True,
restartable=True,
))
fresh-mechanic-68429
02/05/2024, 8:33 PMgorgeous-winter-99296
02/05/2024, 8:36 PMchroot
in process code, but I've never observed it to behave like an actual chroot.gorgeous-winter-99296
02/05/2024, 8:36 PMgorgeous-winter-99296
02/05/2024, 8:37 PMfails to attach
, how is the mechanic for this defined? With python debugging the Python process starts and waits for the debugger to connect via network, which is an active action on the part of the user (or a tool like vscode driving both).fresh-mechanic-68429
02/05/2024, 9:03 PMwhile (!Debugger.IsAttached)
{
Thread.Sleep(1000);
}
inside the code that waits for the debugger to attach to the process. I don’t know enough about the mechanics of the dotnet internals yet to understand how this is implemented. I believe its similar (network based) but haven’t confirmed yetgorgeous-winter-99296
02/05/2024, 9:12 PMpants --keep-sandboxes=always
and then manually running the binary outside of Pants. If you can debug then, you've got a good case for it something related to how the binary is launched with Pants. There should be a __run.sh
script in the sandbox that gives a fairly accurate mimicry of how Pants executes the process.fresh-mechanic-68429
02/05/2024, 9:13 PMgorgeous-winter-99296
02/05/2024, 9:15 PMgorgeous-winter-99296
02/05/2024, 9:15 PMfresh-mechanic-68429
02/05/2024, 9:21 PMBinaryPathRequest
and its running it like
await Get(FallibleProcessResult, Process, process)
(debug is slightly different because it uses InteractiveProcess, but its the same idea)gorgeous-winter-99296
02/05/2024, 9:22 PMfresh-mechanic-68429
02/05/2024, 9:22 PMgorgeous-winter-99296
02/05/2024, 9:23 PMfresh-mechanic-68429
02/05/2024, 11:55 PM__run.sh
was a good lead, was able to easily reproduce outside of pants. For whatever reason its the env var TMPDIR
🤷 I guess the debugger needs it to write temporary files or something