fix socket handling during copy#1581
Conversation
f680d09 to
ed029cf
Compare
|
@alexcb Are you working on a fix or do you want us to take over from here? |
|
@tonistiigi I haven't started on any fix. I'm fairly new to buildkit, so it might take me a while to figure out what needs fixing. If you have time and it's any easy fix then I would gladly let you take over. |
|
I discovered one of the |
cache/contenthash/filehash.go
Outdated
| } | ||
|
|
||
| // Clear the socket bit since archive/tar.FileInfoHeader does not handle it | ||
| stat.Mode &^= uint32(os.ModeSocket) |
There was a problem hiding this comment.
would this make more sense inside NewFromStat ?
There was a problem hiding this comment.
If you think that's a better place we can definitely move it there.
in NewFromStat(stat *fstypes.Stat) stat is passed as a pointer, would it be fine to modify the contents, or would it be better to make a copy of it so it's essentially passed in as a const?
There was a problem hiding this comment.
I'm fine with the current as it is a trivial case, but if you want to be more correct you could check it the socket bit exists and only do copy then.
7c5a106 to
1a5fbb3
Compare
|
LGTM but please squash the commits so it doesn't cause issues for |
This fix is similar to the fix in moby#1144; but was hit in a different code path. Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
1a5fbb3 to
5382a20
Compare
|
squashed! thanks for the help with the PR. |
|
that's odd the tests passed before my squash, but after the squash it panicked in a different part of the code: |
|
@alexcb That is unrelated. Restarted and will fix that in separate PR |
An issue in buildkit caused a "tar/archive: sockets not supported" error while building the dot net example; this issue has been fixed upstream in buildkit ( see moby/buildkit#1581 ), and we can now remove this work-around.
An issue in buildkit caused a "tar/archive: sockets not supported" error while building the dot net example; this issue has been fixed upstream in buildkit ( see moby/buildkit#1581 ), and we can now remove this work-around. Co-authored-by: Alex Couture-Beil <alex@earthly.dev>
This reproduces an error with tar trying to archive a socket, which is similar to the one that was fixed in #1144