Skip to content

Commit

Permalink
Report time spent in set-up.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Dec 16, 2024
1 parent 725956c commit 3de6a20
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions scripts/evaluate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ println("Package evaluation of $(pkg.name) on Julia $VERSION ($(Base.GIT_VERSION

print("\n\n", '#'^80, "\n# Set-up\n#\n\n")

# we install PkgEval dependencies in a separate environment
Pkg.activate("pkgeval"; shared=true)
t0 = cpu_time()

deps = String[]

Expand Down Expand Up @@ -40,6 +39,27 @@ if config.rr == RREnabled
end
end

if !isempty(deps)
# we install PkgEval dependencies in a separate environment
Pkg.activate("pkgeval"; shared=true)

io = IOBuffer()
Pkg.DEFAULT_IO[] = io
try
println("Installing PkgEval dependencies...")
Pkg.add(deps)
println()
catch
# something went wrong installing PkgEval's dependencies
println(String(take!(io)))
rethrow()
finally
Pkg.DEFAULT_IO[] = nothing
end

Pkg.activate()
end

# generating package images is really expensive, without much benefit (for PkgEval)
# so determine here if we need to disable them using additional CLI args
# (we can't do this externally because of JuliaLang/Pkg.jl#3737)
Expand Down Expand Up @@ -70,21 +90,7 @@ end
append!(julia_args, config.julia_args)
julia_args = Cmd(julia_args)

io = IOBuffer()
Pkg.DEFAULT_IO[] = io
try
println("Installing PkgEval dependencies...")
Pkg.add(deps)
println()
catch
# something went wrong installing PkgEval's dependencies
println(String(take!(io)))
rethrow()
finally
Pkg.DEFAULT_IO[] = nothing
end

Pkg.activate()
println("\nSet-up completed after $(elapsed(t0))")


print("\n\n", '#'^80, "\n# Installation\n#\n\n")
Expand Down

0 comments on commit 3de6a20

Please sign in to comment.