Skip to content

Conversation

jsternberg
Copy link
Collaborator

@jsternberg jsternberg commented Jul 31, 2025

When a copy has no real parent, we add an annotation of the name
com.docker.dap.v1.hints.noparent=true to the node to signal to DAP that the LLB node
has no real parent so it doesn't follow the first index assuming that
index is the direct ancestor.

if d.state.Output() == nil {
// Give a hint to DAP that this copy has no real parent.
fileOpt = append(fileOpt, llb.WithDescription(map[string]string{
"dap.hint.noparent": "true",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be generic for the key and use the same format as

return llb.WithDescription(map[string]string{
"com.docker.dockerfile.v1.command": cmdStr,
})

Maybe:

Suggested change
"dap.hint.noparent": "true",
"com.docker.dockerfile.v1.copy.noparent": "true",

Copy link
Collaborator Author

@jsternberg jsternberg Aug 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main reason for the specific annotation was because I thought this might be a generic annotation for DAP that other frontends could implement. I like the naming here, but it also means it's very specific to dockerfile and the DAP adapter would have to be changed to look for it instead of the other way around.

Maybe com.docker.dap.v1.hint.noparent?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this might be a generic annotation for DAP that other frontends could implement.
...
I like the naming here, but it also means it's very specific to dockerfile

I think it's specific to the dockerfile frontend as it lies in its own package imo but I understand the intent.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes don't look related

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea I was just fixing the compose file to remove a bunch of cruft at the same time. Do you want me to separate it into a different PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah if you can, I was just confused 😅

Also I found the collector quite useful in the compose file from last time I used it. Are there any issues with this stack?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll separate that out into a separate PR. I think the current compose file is broken so it needs some work.

When a copy has no real parent, we add an annotation of the name
`com.docker.dap.v1.hint.noparent=true` to the node to signal to DAP that
the LLB node has no real parent so it doesn't follow the first index
assuming that index is the direct ancestor.

Signed-off-by: Jonathan A. Sternberg <[email protected]>
@github-actions github-actions bot removed the area/hack building buildkit itself label Aug 4, 2025
@jsternberg
Copy link
Collaborator Author

This is unneeded since this can be done in a way that already exists. @tonistiigi pointed this out to me in a recent conversation so I'm going to close this.

The proper solution to this is here.

@jsternberg jsternberg closed this Aug 14, 2025
@jsternberg jsternberg deleted the dap-hint-noparent branch August 14, 2025 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants