From fc512ae4c80751a0d92bd091536f7b564b9beff9 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sat, 25 Nov 2017 09:28:46 -0500 Subject: [PATCH 01/10] enable precompile for Base64 --- stdlib/Base64/src/Base64.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/Base64/src/Base64.jl b/stdlib/Base64/src/Base64.jl index d6176e6e47e90..cc2fed61cc0a8 100644 --- a/stdlib/Base64/src/Base64.jl +++ b/stdlib/Base64/src/Base64.jl @@ -1,5 +1,7 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license +__precompile__(true) + module Base64 export From 94345185c8d362f079a2409b97a6157f19aac016 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sat, 25 Nov 2017 09:29:52 -0500 Subject: [PATCH 02/10] enable precompile for Dates --- stdlib/Dates/src/Dates.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/Dates/src/Dates.jl b/stdlib/Dates/src/Dates.jl index 6001e4d60d28b..c326dca5fb692 100644 --- a/stdlib/Dates/src/Dates.jl +++ b/stdlib/Dates/src/Dates.jl @@ -1,5 +1,7 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license +__precompile__(true) + """ Dates From e54d42b973a08da72bc3d8dbab4473feca2bfb48 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sat, 25 Nov 2017 09:30:28 -0500 Subject: [PATCH 03/10] enable precompile for FileWatching --- stdlib/FileWatching/src/FileWatching.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/FileWatching/src/FileWatching.jl b/stdlib/FileWatching/src/FileWatching.jl index a8f91228f138b..1945fbd29e9b7 100644 --- a/stdlib/FileWatching/src/FileWatching.jl +++ b/stdlib/FileWatching/src/FileWatching.jl @@ -1,5 +1,7 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license +__precompile__(true) + """ Utilities for monitoring files and file descriptors for events. """ From 1e82f573a61a1216d57b3f40d9cb35a2c6cce760 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sat, 25 Nov 2017 09:31:09 -0500 Subject: [PATCH 04/10] enable precompile for Profile --- stdlib/Profile/src/Profile.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/Profile/src/Profile.jl b/stdlib/Profile/src/Profile.jl index a6837d525f78d..2b08db5d73d9b 100644 --- a/stdlib/Profile/src/Profile.jl +++ b/stdlib/Profile/src/Profile.jl @@ -1,5 +1,7 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license +__precompile__(true) + """ Profiling support, main entry point is the [`@profile`](@ref) macro. """ From 73567c7697c9c629f2db49062e9de54eb5a44c96 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sat, 25 Nov 2017 09:31:46 -0500 Subject: [PATCH 05/10] enable precompile for SuiteSparse --- stdlib/SuiteSparse/src/SuiteSparse.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/SuiteSparse/src/SuiteSparse.jl b/stdlib/SuiteSparse/src/SuiteSparse.jl index e233ef24f8482..87073f010de7c 100644 --- a/stdlib/SuiteSparse/src/SuiteSparse.jl +++ b/stdlib/SuiteSparse/src/SuiteSparse.jl @@ -1,5 +1,7 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license +__precompile__(true) + module SuiteSparse import Base: At_ldiv_B, Ac_ldiv_B, A_ldiv_B! From afc642234171a820046b8be6f92dd7c918e2b263 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sat, 25 Nov 2017 09:32:56 -0500 Subject: [PATCH 06/10] enable precompile for CRC32c --- stdlib/CRC32c/src/CRC32c.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stdlib/CRC32c/src/CRC32c.jl b/stdlib/CRC32c/src/CRC32c.jl index 49ea0d384923c..5ba27801a4ffb 100644 --- a/stdlib/CRC32c/src/CRC32c.jl +++ b/stdlib/CRC32c/src/CRC32c.jl @@ -1,3 +1,6 @@ + +__precompile__(true) + """ Standard library module for computing the CRC-32c checksum. From fe3fe8f401ab742d94f4fa7cdbe29212a2a8c4ea Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sat, 25 Nov 2017 09:33:42 -0500 Subject: [PATCH 07/10] enable precompile for Mmap --- stdlib/Mmap/src/Mmap.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/Mmap/src/Mmap.jl b/stdlib/Mmap/src/Mmap.jl index 93eff5569c325..739955b0a6e8c 100644 --- a/stdlib/Mmap/src/Mmap.jl +++ b/stdlib/Mmap/src/Mmap.jl @@ -1,5 +1,7 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license +__precompile__(true) + """ Low level module for mmap (memory mapping of files). """ From 1562e5d2ba7f25f8e88d0168c180a22ad78ff053 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sat, 25 Nov 2017 09:34:18 -0500 Subject: [PATCH 08/10] enable precompile for SharedArrays --- stdlib/SharedArrays/src/SharedArrays.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/SharedArrays/src/SharedArrays.jl b/stdlib/SharedArrays/src/SharedArrays.jl index c5ac5ce01ae60..57922d582e69a 100644 --- a/stdlib/SharedArrays/src/SharedArrays.jl +++ b/stdlib/SharedArrays/src/SharedArrays.jl @@ -1,5 +1,7 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license +__precompile__(true) + """ Provide the [`SharedArray`](@ref) type. It represents an array, which is shared across multiple processes, on a single machine. """ From c9ea9aebbe6b20852f73358988cacdcc72d07240 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sat, 25 Nov 2017 09:38:38 -0500 Subject: [PATCH 09/10] bake stdlib into sysimage --- base/sysimg.jl | 11 +++++++++-- test/compile.jl | 5 +++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/base/sysimg.jl b/base/sysimg.jl index a17c8ec4f05d4..c3903d93a807b 100644 --- a/base/sysimg.jl +++ b/base/sysimg.jl @@ -485,10 +485,17 @@ using Base unshift!(Base._included_files, (@__MODULE__, joinpath(@__DIR__, "sysimg.jl"))) # load some stdlib packages but don't put their names in Main -Base.require(:DelimitedFiles) -Base.require(:Test) +Base.require(:Base64) +Base.require(:CRC32c) Base.require(:Dates) +Base.require(:DelimitedFiles) +Base.require(:FileWatching) +Base.require(:Mmap) +Base.require(:Profile) +Base.require(:SharedArrays) Base.require(:SuiteSparse) +Base.require(:Test) + empty!(LOAD_PATH) diff --git a/test/compile.jl b/test/compile.jl index bd8109142bda1..0a78df05b63cc 100644 --- a/test/compile.jl +++ b/test/compile.jl @@ -215,10 +215,11 @@ try modules, deps1 = Base.cache_dependencies(cachefile) @test modules == merge(Dict(s => Base.module_uuid(getfield(Foo, s)) for s in - [:Base, :Core, Foo2_module, FooBase_module, :Main, :Test]), + [:Base, :Core, Foo2_module, FooBase_module, :Main]), # plus modules included in the system image Dict(s => Base.module_uuid(Base.root_module(s)) for s in - [:DelimitedFiles, :Mmap, :Base64, :Dates, :SuiteSparse])) + [:Base64, :CRC32c, :Dates, :DelimitedFiles, :FileWatching, :Mmap, + :Profile, :SharedArrays, :SuiteSparse, :Test])) @test discard_module.(deps) == deps1 @test current_task()(0x01, 0x4000, 0x30031234) == 2 From 006e77a56f6dd9d44ab880395acb181ed5cb93ab Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sat, 25 Nov 2017 10:00:01 -0500 Subject: [PATCH 10/10] rebuild sysimg when stdlib files change --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5e8024f60e7dd..91a0b70b12401 100644 --- a/Makefile +++ b/Makefile @@ -199,6 +199,7 @@ CORE_SRCS := $(addprefix $(JULIAHOME)/, \ base/reflection.jl \ base/tuple.jl) BASE_SRCS := $(sort $(shell find $(JULIAHOME)/base -name \*.jl) $(shell find $(BUILDROOT)/base -name \*.jl)) +STDLIB_SRCS := $(sort $(shell find $(JULIAHOME)/stdlib/*/src -name \*.jl)) $(build_private_libdir)/inference.ji: $(CORE_SRCS) | $(build_private_libdir) @$(call PRINT_JULIA, cd $(JULIAHOME)/base && \ @@ -208,7 +209,7 @@ $(build_private_libdir)/inference.ji: $(CORE_SRCS) | $(build_private_libdir) RELBUILDROOT := $(shell $(JULIAHOME)/contrib/relative_path.sh "$(JULIAHOME)/base" "$(BUILDROOT)/base/") COMMA:=, define sysimg_builder -$$(build_private_libdir)/sys$1.o: $$(build_private_libdir)/inference.ji $$(JULIAHOME)/VERSION $$(BASE_SRCS) +$$(build_private_libdir)/sys$1.o: $$(build_private_libdir)/inference.ji $$(JULIAHOME)/VERSION $$(BASE_SRCS) $$(STDLIB_SRCS) @$$(call PRINT_JULIA, cd $$(JULIAHOME)/base && \ if $$(call spawn,$3) $2 -C "$$(JULIA_CPU_TARGET)" --output-o $$(call cygpath_w,$$@).tmp $$(JULIA_SYSIMG_BUILD_FLAGS) \ --startup-file=no --warn-overwrite=yes --sysimage $$(call cygpath_w,$$<) sysimg.jl $$(RELBUILDROOT); then \