-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: package hash bug #17094
fix: package hash bug #17094
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -608,6 +608,20 @@ fn fetchAndUnpack( | |
// I have not checked what buffer sizes the xz decompression implementation uses | ||
// by default, so the same logic applies for buffering the reader as for gzip. | ||
try unpackTarball(gpa, prog_reader.reader(), tmp_directory.handle, std.compress.xz); | ||
|
||
tmp_directory = d: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Definitely need an explainer comment detailing why this is needed (and that it's effectively a workaround for a potential IterableDir.Iterator/Walker bug). |
||
const path = try global_cache_directory.join(gpa, &.{tmp_dir_sub_path}); | ||
errdefer gpa.free(path); | ||
|
||
const iterable_dir = try global_cache_directory.handle.makeOpenPathIterable(tmp_dir_sub_path, .{}); | ||
errdefer iterable_dir.close(); | ||
|
||
break :d .{ | ||
.path = path, | ||
.handle = iterable_dir.dir, | ||
}; | ||
}; | ||
defer tmp_directory.closeAndFree(gpa); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Won't this double |
||
} else if (ascii.eqlIgnoreCase(content_type, "application/octet-stream")) { | ||
// support gitlab tarball urls such as https://gitlab.com/<namespace>/<project>/-/archive/<sha>/<project>-<sha>.tar.gz | ||
// whose content-disposition header is: 'attachment; filename="<project>-<sha>.tar.gz"' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why only reopen in the
application/x-xz
case? Wouldn't this affect all the other cases too?