Uh oh!
There was an error while loading. Please reload this page.
Trim file type bits from mode header - #77151
Conversation
ghost
commented
Oct 18, 2022
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsFixes #77107. Depends on dotnet/runtime-assets#279.
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
tmds
commented
Oct 18, 2022
am11
commented
Oct 18, 2022
Yes, fixed. Too many tabs and PRs are opened. 😅 |
adamsitnik
commented
Oct 18, 2022
Merged ;) |
adamsitnik
left a comment
There was a problem hiding this comment.
LGTM, thank you very much for your help @am11 !
am11
commented
Oct 19, 2022
@danmoseley, can we backport to 7.0? (bugfix in new library) |
@am11 I moved to the ASPNET team so it's not my call. Generally test coverage doesn't need any special approvals to back port though. 7.0 branch might be closed for a bit for GA. |
danmoseley
commented
Oct 19, 2022
Oh this is a product change. It would need all the regular process. The bar is roughly the servicing bar right now. It would be up to the folks in this repo though. |
am11
commented
Oct 19, 2022
@danmoseley this is the fix for the issue #77096 in which you were coordinating with the author. Seeing other fixes being backported to 7.0, so there may still be some time. |
Yup, but this is @adamsitnik / @jeffhandley area now. The test failure is another hit on #77087 00 (Inline) -------- coreclr!WKS::gc_heap::mark_array_marked+0x1a [D:\a_work\1\s\src\coreclr\gc\gc.cpp @ 8471] |
| set | ||
| { | ||
| if ((int)value is < 0 or > 4095) // 4095 in decimal is 7777 in octal | ||
| if ((value & ~TarHelpers.ValidUnixFileModes) != 0) // throw on invalid UnixFileModes |
There was a problem hiding this comment.
nit: There's another reference to 4095 on the tests which we could change to a const UnixFileMode ValidUnixFileModes.
There was a problem hiding this comment.
Currently we don't have access to the helpers in the tests.
There was a problem hiding this comment.
I was suggesting copying the const to the tests, not making the one on src accessible to tests. Is just a nit, so you can disregard it.
| // Some paths do not use the setter, and we want to return valid UnixFileMode. | ||
| // This mask only keeps the least significant 12 bits. |
There was a problem hiding this comment.
I wonder if not using the setter everywhere is correct. it seems somewhat inconsistent and we could've thrown earlier.
There was a problem hiding this comment.
Good point, I am not sure if this is intentional. I didn't wanted to go for larger refactoring at this point. There is also an existing helper:
which takes care of permissions but for some reason we don't use it in the path OP was hitting the exception.| } | ||
| [Fact] | ||
| public async Task ExtractEntry_DockerImageTarWithFileTypeInDirectoriesInMode_SuccessfullyExtracts_Async() |
There was a problem hiding this comment.
I would also include a version of this test using a compressed archive since that's what the customer reported. Also, add the sync test. But this is up to you, not a big deal tbh.
There was a problem hiding this comment.
That will require setting up token to fetch gzipped tar archive from docker api and posting a PR like dotnet/runtime-assets#279. I don't have access to those tokens (and don't think it is super important for 7.0 minimal fix).
jozkee
commented
Oct 20, 2022
Thanks. |
am11
commented
Oct 21, 2022
@jozkee, thanks. Can you please backport it to 7.0? This is matching the behavior of other tar reader implementations ( |
jeffhandley
commented
Oct 28, 2022
@am11 I'm going to initiate the backport. This will put the fix into consideration for a servicing release--most of the other backports you've observed have also been for the first servicing release. Thanks for this fix! |
jeffhandley
commented
Oct 28, 2022
/backport to release/7.0 |
Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3347871693 |
@jeffhandley backporting to release/7.0 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: Trim file type bits from mode header
Applying: Define and use ValidUnixFileModes
Applying: Rev System.Formats.Tar.TestData version
Using index info to reconstruct a base tree...
M eng/Version.Details.xml
M eng/Versions.props
Falling back to patching base and 3-way merge...
Auto-merging eng/Versions.props
CONFLICT (content): Merge conflict in eng/Versions.props
Auto-merging eng/Version.Details.xml
CONFLICT (content): Merge conflict in eng/Version.Details.xml
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0003 Rev System.Formats.Tar.TestData version
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
* Trim file type bits from mode header * Define and use ValidUnixFileModes * Rev System.Formats.Tar.TestData version * Move ValidUnixFileModes to shared helpers
* Trim file type bits from mode header (#77151) * Trim file type bits from mode header * Define and use ValidUnixFileModes * Rev System.Formats.Tar.TestData version * Move ValidUnixFileModes to shared helpers * Bump package version for TAR test assets Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com> Co-authored-by: Carlos Sanchez <1175054+carlossanlop@users.noreply.github.com>
Fixes#77096.
Depends on dotnet/runtime-assets#279.