https://pantsbuild.org/ logo
t

thousands-plumber-33255

02/14/2023, 12:33 PM
Is it possible to use the
--debug-adapter
when running the target in a
docker_environment
?
b

bitter-ability-32190

02/14/2023, 1:37 PM
If the correct port is open, it actually might work. I never tested it 🤔
t

thousands-plumber-33255

02/14/2023, 3:27 PM
b

bitter-ability-32190

02/14/2023, 3:28 PM
Ah, well then that solves that 😅 Feel free to file an issue with detailed info if one doesn't already exist.
Others can chime in on whether that's feasible and if its safe to do so
t

thousands-plumber-33255

02/14/2023, 3:31 PM
And what about running the Dockerfile with debug-adapter, e.g.
./pants run --debug-adapter src/Dockerfile
? Where the Dockerfile uses a PEX
b

bitter-ability-32190

02/14/2023, 3:32 PM
Wouldn't work, The DAP is ecosystem-specific. In this case if you're running the dockerfile it'd be equivalent to asking for a Docker-based DAP-application.
You could easily instrument your code to import
debugpy
and call the relevant function (i forget the name,
wait_for_connection
or something). That's what we did pre-
--debug-adapter
)
t

thousands-plumber-33255

02/14/2023, 3:33 PM
Yes I am aware of that. Thank you for the explanation!
🙌 1
b

bitter-ability-32190

02/14/2023, 3:33 PM
Of course ❤️
😊 1
6 Views