2023-10-13 20:44:34 +09:00
|
|
|
#!/usr/bin/julia
|
|
|
|
project_path = joinpath(homedir(), ".julia", "environments", "nvim-lspconfig")
|
|
|
|
cd(project_path)
|
|
|
|
@info "now at " pwd()
|
|
|
|
run(`julia --project=. -e 'using Pkg; Pkg.update()'`)
|
2024-04-09 08:47:08 +09:00
|
|
|
compile_traces = Iterators.filter(eachline("tracecompile.jl")) do line
|
2024-06-25 19:37:11 +09:00
|
|
|
# Remove anonymous functions from compile trace
|
2024-10-22 18:15:48 +09:00
|
|
|
!startswith(line, '#') && !occursin(r"\#\d+\#\d+", line) && !occursin(r"\#\#printstyled\#", line)
|
2024-04-09 08:47:08 +09:00
|
|
|
end |> join
|
|
|
|
read("precompile_exec_head.jl", String) * compile_traces |> (b -> write("precompile_exec.jl", b))
|
2023-10-13 20:44:34 +09:00
|
|
|
@info "compiling sysimage..."
|
|
|
|
run(`julia --project=. -e 'using PackageCompiler; create_sysimage(["LanguageServer"], sysimage_path = "sys-ls.so", precompile_execution_file = ["precompile_exec.jl"])'`)
|
|
|
|
@info "post precompile"
|
|
|
|
run(`julia --project=. -J sys-ls.so -e 'using Pkg; Pkg.precompile()'`)
|
|
|
|
|