Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPL start time fix #20

Merged
merged 5 commits into from
Dec 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ os:

julia:
- 1.0
- 1.3

before_script:
# Every 30 seconds, look for the build log file. If it exists, then
Expand Down
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
PackageCompiler = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d"
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
7 changes: 7 additions & 0 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ include("deps.jl")
include("../src/install.jl")
enable_mkl_startup(libmkl_rt)

try
julia_ = joinpath(Sys.BINDIR, Base.julia_exename())
cmd = `$julia_ fix_repl.jl`
run(cmd)
catch
@warn "Rebuilding system image with precompiling failed. This may lead to REPL latency."
end
16 changes: 16 additions & 0 deletions deps/fix_repl.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using PackageCompiler

jl_dev_ver = length(VERSION.prerelease) == 2 && (VERSION.prerelease)[1] == "DEV" # test if running nightly/unreleased version
jl_gh_tag = jl_dev_ver ? "master" : "release-$(VERSION.major).$(VERSION.minor)"
prec_jl_url = "https://raw.githubusercontent.com/JuliaLang/julia/$jl_gh_tag/contrib/generate_precompile.jl"

@info "getting precompile script from: $prec_jl_url"

prec_jl_fn = "generate_precompile.jl"
download(prec_jl_url, prec_jl_fn)
prec_jl_content = read(prec_jl_fn, String)
open(prec_jl_fn, "w") do f
write(f, replace(prec_jl_content, "@assert n_succeeded > 3500" => raw"println(\"processed: $n_succeeded\") # @assert n_succeeded > 3500"))
end

PackageCompiler.build_sysimg(PackageCompiler.default_sysimg_path(), prec_jl_fn, verbose=true, cpu_target="native", release=true)