JuliaIO / Tar.jl

TAR files: create, list, extract them in pure Julia
MIT License
79 stars 19 forks source link

convert output of `readbytes!` to `Int` #141

Closed ranocha closed 2 years ago

ranocha commented 2 years ago

This improves type stability and fixes some invalidations when loading ArrayInterface.jl. It follows the approach of #112 to cast the optional argument of readbytes! to an Int and fixes additional invalidations not covered by #138, #139.

I built Julia from the current release-1.8 branch with

julia$ git diff release-1.8
diff --git a/stdlib/Tar.version b/stdlib/Tar.version
index b7ee00e5a2..7835dfb18f 100644
--- a/stdlib/Tar.version
+++ b/stdlib/Tar.version
@@ -1,4 +1,4 @@
-TAR_BRANCH = master
-TAR_SHA1 = 0f8a73d5cd4b0c8f1f3c36799c96e9515e9dc595
-TAR_GIT_URL := https://github.com/JuliaIO/Tar.jl.git
-TAR_TAR_URL = https://api.github.com/repos/JuliaIO/Tar.jl/tarball/$1
+TAR_BRANCH = hr/fix_invalidations
+TAR_SHA1 = f63d9034a30171962de52c375572a310e1dffd2c
+TAR_GIT_URL := https://github.com/ranocha/Tar.jl.git
+TAR_TAR_URL = https://api.github.com/repos/ranocha/Tar.jl/tarball/$1

Then, I get no invalidations from loading ArrayInterface.jl anymore:

julia> using Pkg; Pkg.activate(temp=true); Pkg.add("ArrayInterface")

julia> using SnoopCompileCore; invalidations = @snoopr(using ArrayInterface); using SnoopCompile

julia> trees = invalidation_trees(invalidations);

julia> import Tar; ftrees = filtermod(Tar, trees)
SnoopCompile.MethodInvalidations[]
codecov[bot] commented 2 years ago

Codecov Report

Merging #141 (f63d903) into master (c887de7) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #141   +/-   ##
=======================================
  Coverage   97.29%   97.29%           
=======================================
  Files           4        4           
  Lines         775      775           
=======================================
  Hits          754      754           
  Misses         21       21           
Impacted Files Coverage Δ
src/create.jl 100.00% <100.00%> (ø)
src/extract.jl 98.11% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.