Conversation
|
Ok, so the new test passes: But it looks like it broke other tests, all related to symlinks; e.g.; |
|
@thaJeztah do you still plan to get this in? Would be great to have this in a release. :-) |
|
I can do a quick rebase of this PR, but haven't had time to look at the failing tests (to verify if the tests make the wrong assumption, or if the failures are legit) Help on verifying that would be appreciated 🤗 (as I'm not sure when I come round to doing that) 😅 |
addresses moby#35699 Before this patch: DOCKER_BUILDKIT=0 docker build --no-cache -<<'EOF' FROM alpine RUN apk add --no-cache attr RUN touch /testfile \ && setfattr -n user.pax.flags -v ok /testfile RUN test "$(getfattr -n user.pax.flags --only-values testfile)" = "ok" EOF getfattr: testdir/testfile: No such file or directory The command '/bin/sh -c test "$(getfattr -n user.pax.flags --only-values testdir/testfile)" = "ok"' returned a non-zero code: 1 With this patch: DOCKER_BUILDKIT=0 docker build --no-cache -<<'EOF' FROM alpine RUN apk add --no-cache attr RUN touch /testfile \ && setfattr -n user.pax.flags -v ok /testfile RUN test "$(getfattr -n user.pax.flags --only-values testfile)" = "ok" EOF Successfully built 5ecde85b467d Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
f25a3bb to
c5b229b
Compare
|
I had a look at the failing tests. The problem is caused by the unix.Listxattr() function that follows symlinks. Symlink's target isn't found (different layer) and getXattrByPrefix() returns an error. I changed it to Llistxattr() - version that lists xattrs for the source file. I also added ReadSecurityXattrToTarHeader() to CopyFileWithTar() in containerfs/archiver - that fixes the legacy builder in terms of preserving xattrs. Besides that, I thought it may be useful to use PAXRecords from the tar header, given that Xattrs field is deprecated. I pushed all changes here: Hope that it helps. @thaJeztah It would be great if this pull request can make it upstream. |
|
@kstruczy Thanks for looking! I don't think I'll find time soon to work on this; could you open your changes as a new PR perhaps? Feel free to "squash" my commit into your commits if needed |
|
closing as this was carried as #40855 |
addresses #35699
Before this patch:
With this patch:
Signed-off-by: Sebastiaan van Stijn github@gone.nl
- What I did
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)