update: julials: automatically create tracecompile.jl file at setup

This commit is contained in:
qwjyh 2024-06-25 19:37:11 +09:00
parent 6fb7a8f544
commit d104726b73
2 changed files with 2 additions and 0 deletions

View file

@ -4,6 +4,7 @@ if !ispath(project_path)
try try
mkdir(project_path) mkdir(project_path)
@info "Created $(project_path)" @info "Created $(project_path)"
touch(joinpath(project_path, "tracecompile.jl"))
catch e catch e
@error e @error e
@error dump(e) @error dump(e)

View file

@ -4,6 +4,7 @@ cd(project_path)
@info "now at " pwd() @info "now at " pwd()
run(`julia --project=. -e 'using Pkg; Pkg.update()'`) run(`julia --project=. -e 'using Pkg; Pkg.update()'`)
compile_traces = Iterators.filter(eachline("tracecompile.jl")) do line compile_traces = Iterators.filter(eachline("tracecompile.jl")) do line
# Remove anonymous functions from compile trace
!startswith(line, '#') && !occursin(r"\#\d+\#\d+", line) !startswith(line, '#') && !occursin(r"\#\d+\#\d+", line)
end |> join end |> join
read("precompile_exec_head.jl", String) * compile_traces |> (b -> write("precompile_exec.jl", b)) read("precompile_exec_head.jl", String) * compile_traces |> (b -> write("precompile_exec.jl", b))