Commit Graph
3421 Commits
Author SHA1 Message Date
Jonathan A. Sternberg 1e3c44709d dap: refactor how step in/step out works
Change how breakpoints and stepping works. These now work more how you
would expect another programming language to work. Breakpoints happen
before the step has been invoked rather than after which means you can
inspect the state before the command runs.

This has the advantage of being more intuitive for someone familiar with
other debuggers. The negative is that you can't run to after a certain
step as easily as you could before. Instead, you would run to that stage
and then use next to go to the step directly afterwards.

Step in and out also now have different behaviors. When a step has
multiple inputs, the inputs of non-zero index are considered like
"function calls". The most common cause of this is to use `COPY --from`
or a bind mount. Stepping into these will cause it to jump to the
beginning of the call chain for that branch. Using step out will exit
back to the location where step in was used.

This change also makes it so some steps may be invoked multiple times in
the callgraph if multiple steps depend on them. The reused steps will
still be cached, but you may end up stepping through more lines than the
previous implementation.

Stack traces now represent where these step in and step out areas
happen rather than the previous steps. This can help you know from where
a certain step is being used.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-07-23 17:10:40 -05:00
Jonathan A. Sternberg fea53ad1f8 dap: return error from evaluate command in repl context
In the repl context, we will now return the error instead of directly
printing it. We also suppress reporting errors from cobra. The logic
flow has also been changed to prevent returning errors from cobra unless
there was something related to the command line invocation so usage will
only be printed when a command was typed wrong and it will not show up
for every error.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-07-23 13:51:03 -05:00
CrazyMaxandGitHub a1ca46e85e Merge pull request #3334 from glours/bump-compose-go-v2.8.0
bump compose-go to v2.8.0
2025-07-23 14:53:21 +02:00
Guillaume Lours 19304c0c54 bump compose-go to v2.8.0
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
2025-07-23 13:16:22 +02:00
Tõnis TiigiandGitHub 7d0efdc50e Merge pull request #3330 from crazy-max/history-build-name-override
history: use built-in build-arg to override the build name
2025-07-22 16:33:21 -07:00
Tõnis TiigiandGitHub f0d16f5914 Merge pull request #3329 from crazy-max/fix-compose-validation
bake: fix compose files validation
2025-07-22 08:09:08 -07:00
CrazyMax 7e11d3601e history: use built-in build-arg to override the build name
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-22 14:34:36 +02:00
CrazyMax 98f04b1290 bake: fix compose files validation
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-22 10:18:14 +02:00
CrazyMaxandGitHub 3f4bf829d8 Merge pull request #3324 from thaJeztah/no_pkg_homedir
driver/kubernetes: remove uses of pkg/homedir
2025-07-21 15:35:10 +02:00
Sebastiaan van Stijn 3f725bf4d8 driver/kubernetes: remove uses of pkg/homedir
Create a local fork to keep the existing behavior.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-21 14:46:45 +02:00
CrazyMaxandGitHub dcd113370e Merge pull request #3322 from ndeloof/validateComposeFile
do not assume input is a compose file on .env parsing error
2025-07-21 09:33:12 +02:00
Nicolas De Loof 08e74f8b62 do not assume intput is a compose file on .env parsing error
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2025-07-21 09:02:10 +02:00
Tõnis TiigiandGitHub a894a678f1 Merge pull request #3308 from jsternberg/dap-docs
docs: add docs related to dap
2025-07-15 09:18:29 -07:00
Tõnis TiigiandGitHub 32a9b908cc Merge pull request #3257 from jsternberg/dap-invoke
dap: support evaluate request to invoke a container
2025-07-15 09:17:37 -07:00
Jonathan A. Sternberg ac9050261e docs: add docs related to dap
Adds some entry-level and developer-friendly docs for the debug adapter.
The one in `docs/dap.md` is meant for someone trying to use the debugger
while the one in `docs/reference/buildx_dap_build.md` is more focused on
documenting the command to be integrated in a debugger extension.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-07-15 10:58:01 -05:00
Jonathan A. Sternberg 3453f3b00a dap: support evaluate request to invoke a container
Supports using the `evaluate` request in REPL mode to start a container
with the `exec` command. Presently doesn't support any arguments.

This improves the dap server so it is capable of sending reverse
requests and receiving the response. It also adds a hidden command
`dap attach` that attaches to the socket created by `evaluate`.

This requires the client to support `runInTerminal`.

Likely needs some additional work to make sure resources are cleaned up
cleanly especially when the build is unpaused or terminated, but it
should work as a decent base.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-07-15 10:45:25 -05:00
Tõnis TiigiandGitHub d5b9564c04 Merge pull request #3185 from crazy-max/bump-semver
vendor: github.com/Masterminds/semver/v3 v3.4.0
2025-07-15 08:43:08 -07:00
CrazyMaxandGitHub 6241ce056e Merge pull request #3317 from crazy-max/docker-28.3.2
vendor: github.com/docker/cli and github.com/docker/docker v28.3.2
2025-07-15 17:02:38 +02:00
CrazyMax d418737c98 vendor: github.com/docker/cli and github.com/docker/docker v28.3.2
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-15 15:41:42 +02:00
CrazyMax 8c34ab52c0 vendor: github.com/Masterminds/semver/v3 v3.4.0
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-15 15:36:39 +02:00
CrazyMaxandGitHub 92a4783070 Merge pull request #3316 from tonistiigi/containerd-v2.1.3
vendor: update containerd to v2.1.3 to fix registry issues
2025-07-15 09:36:54 +02:00
Tonis Tiigi eed5fa80c2 vendor: update containerd to v2.1.3 to fix registry issues
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-07-14 23:44:31 -07:00
Tõnis TiigiandGitHub c027db2446 Merge pull request #3315 from jsternberg/dap-target-launch-config
dap: correctly set the target when provided by the launch config
2025-07-14 17:20:55 -07:00
Tõnis TiigiandGitHub 9a2207a692 Merge pull request #3313 from jsternberg/dap-variable-reference-fix
dap: do not modify variable references on variables that are zero
2025-07-14 13:33:22 -07:00
Tõnis TiigiandGitHub 60d96d3495 Merge pull request #3314 from jsternberg/dap-error-fail-on-next
dap: always return the error from execution if we paused on an error and resume
2025-07-14 13:32:31 -07:00
Jonathan A. Sternberg e7b8de2b0c dap: correctly set the target when provided by the launch config
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-07-14 14:51:05 -05:00
Jonathan A. Sternberg e9d4b86161 dap: always return the error from execution if we paused on an error and resume
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-07-14 14:00:02 -05:00
Jonathan A. Sternberg 7925996c0c dap: do not modify variable references on variables that are zero
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-07-14 13:57:26 -05:00
Tõnis TiigiandGitHub ebe66f6922 Merge pull request #3309 from jsternberg/dap-step-into
dap: alias step into to next and step out to continue
2025-07-14 09:55:27 -07:00
Tõnis TiigiandGitHub 272bcb43fe Merge pull request #3307 from jsternberg/dap-variables
dap: implement variable references
2025-07-14 09:54:48 -07:00
Jonathan A. Sternberg 0a78659776 dap: alias step into to next and step out to continue
Step into and step out are required by the UI for DAP. We don't have a
way to implement these in a logical manner but they need to exist. We'll
discuss in further iterations how these might differ from next and
continue, but for now, we just need some implementation for the UI.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-07-14 11:00:33 -05:00
Jonathan A. Sternberg 1886e232c5 dap: implement variable references
Implement variable references to inspect the state of a stack frame.

Variable reference ids are composed of two sections. A thread mask that
is the first 8 bytes and the remainder is an increasing number that gets
reset each time a thread is resumed. This allows the adapter to know
which thread to delegate the variables request to and allows the
variable references to still remain confined to each thread. An int32 is
used for this because variable references need to be in the range of
(0, 2^32).

At the moment, only the platform variables and some of the exec
operations for an operation. These are labeled as "arguments" to the
stack frame.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-07-14 10:59:05 -05:00
Tõnis TiigiandGitHub 266db938a7 Merge pull request #3302 from jsternberg/dap-breakpoints
dap: implement first pass at breakpoints
2025-07-14 08:58:12 -07:00
Jonathan A. Sternberg 0dddf0a7b8 dap: implement first pass at breakpoints
Implement the first iteration of breakpoints. When a breakpoint is set,
it starts unverified. When a thread begins evaluation, it tries to see
if a breakpoint corresponds to one of the parsed instructions and will
verify it.

Breakpoints work when continue is used.

At the current moment, setting breakpoints while a thread is currently
running doesn't work. Breakpoints are rechecked each time execution is
about to restart.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-07-14 09:19:17 -05:00
Tõnis TiigiandGitHub f6d2c5ed7a Merge pull request #3292 from crazy-max/compose-filtered-spec
bake: ignore unrelated fields when parsing compose files
2025-07-13 23:36:05 -07:00
Tõnis TiigiandGitHub 661a1593f6 Merge pull request #3289 from crazy-max/bake-stdlib-description
bake: set missing stdlib functions description
2025-07-11 17:27:15 -07:00
Tõnis TiigiandGitHub 9a07004534 Merge pull request #3290 from thaJeztah/fix_lint
fix some linting issues
2025-07-10 08:30:29 -07:00
Tõnis TiigiandGitHub 39ee904262 Merge pull request #3298 from crazy-max/cmd-fix-duplicated-usage
cmd: fix duplicated commands description
2025-07-09 17:44:46 -07:00
Tõnis TiigiandGitHub e3eb64e73d Merge pull request #3294 from jsternberg/dap-stop-on-entry
dap: support stopOnEntry to configure behavior when starting the debugger
2025-07-09 13:05:41 -07:00
Tõnis TiigiandGitHub d902b19e61 Merge pull request #3305 from crazy-max/build-cache-docs
docs: update links and add missing type for build cache exporters
2025-07-09 10:25:41 -07:00
CrazyMaxandGitHub 84f188a035 Merge pull request #3304 from crazy-max/update-readme
chore: readme cleanup
2025-07-09 12:43:15 +02:00
CrazyMax 42dcd3c655 docs: update links and add missing type for build cache exporters
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-09 12:32:04 +02:00
CrazyMax 20e99f69cf chore: readme cleanup
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-09 12:17:25 +02:00
Tõnis TiigiandGitHub 3b452204b0 Merge pull request #3300 from crazy-max/history-bootstrap
history: bootstrap builder
2025-07-08 16:22:09 -07:00
CrazyMax af0090e434 history: bootstrap builder
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-08 11:11:37 +02:00
Jonathan A. Sternberg a291698eaf dap: support stopOnEntry to configure behavior when starting the debugger
This will configure the default behavior when beginning to evaluate a
build target. When `stopOnEntry` is used, it will default to `stepNext`.
Otherwise, `stepContinue` will be used.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-07-07 09:39:23 -05:00
CrazyMax b6cd86e068 cmd: fix duplicated commands description
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-07 11:58:45 +02:00
CrazyMax c124b14978 bake: ignore unrelated fields when parsing compose files
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-04 08:09:14 +02:00
Tõnis TiigiandGitHub 0c747263ef Merge pull request #3279 from jsternberg/dap-step
dap: add stack traces with next and continue functionality
2025-07-03 18:13:13 -07:00
Jonathan A. SternbergandGitHub 3a3fc54e33 Merge pull request #3293 from jsternberg/dap-adapter-test-flaky
dap: increase timeout for receiving configuration done in adapter test
2025-07-03 09:47:42 -05:00