-
-
Save aplavin/3f8490c7b944da86f9f1271c8cefaa7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
code = """ | |
import Pkg | |
@showtime Pkg.instantiate() | |
@showtime Pkg.precompile() | |
@showtime using Tables, StructArrays, CSV, FlexiGroups | |
@showtime tbl = CSV.read(IOBuffer("a,b,c\n1,2.0,abc"), columntable) |> StructArray | |
@showtime groupmap(x -> x.a, length, tbl) | |
""" | |
projecttoml = """ | |
[deps] | |
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" | |
FlexiGroups = "1e56b746-2900-429a-8028-5ec1f00612ec" | |
StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" | |
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" | |
""" | |
for jl in [`julia`, `julia-19`] | |
@info "" jl ver=read(`$jl -E 'VERSION'`, String) |> strip | |
mktempdir() do depot | |
mkdir(joinpath(depot, "registries")) | |
cp(expanduser("~/.julia/registries/General"), joinpath(depot, "registries/General")) | |
# alternatively: | |
# run(addenv(`$jl -e 'using Pkg; pkg"registry add https://github.com/JuliaRegistries/General"'`, Dict("JULIA_DEPOT_PATH" => depot))) | |
for (i, date) in enumerate(["2023-01-01", "2023-01-10", "2023-01-20"]) | |
cd(joinpath(depot, "registries/General")) do | |
commit = read(`git rev-list -n 1 --first-parent --before=$date master`, String) |> strip | |
run(`git checkout $commit`) | |
end | |
mktempdir() do env | |
cd(env) | |
write("Project.toml", projecttoml) | |
write("script.jl", code) | |
# if i == 1 | |
# @info "Initial run in depot" | |
# run(addenv(`$jl --project script.jl`, Dict("JULIA_DEPOT_PATH" => depot))) | |
# end | |
@info "$i-th run in depot" | |
run(addenv(`$jl --project script.jl`, Dict("JULIA_DEPOT_PATH" => depot))) | |
end | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment