Skip to content

Commit e64ad77

Browse files
authored
Merge pull request #24773 from JuliaLang/vc/stdlib
Precompile stdlib modules and include them in sysimg
2 parents 21afb72 + 006e77a commit e64ad77

File tree

11 files changed

+31
-5
lines changed

11 files changed

+31
-5
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ CORE_SRCS := $(addprefix $(JULIAHOME)/, \
199199
base/reflection.jl \
200200
base/tuple.jl)
201201
BASE_SRCS := $(sort $(shell find $(JULIAHOME)/base -name \*.jl) $(shell find $(BUILDROOT)/base -name \*.jl))
202+
STDLIB_SRCS := $(sort $(shell find $(JULIAHOME)/stdlib/*/src -name \*.jl))
202203

203204
$(build_private_libdir)/inference.ji: $(CORE_SRCS) | $(build_private_libdir)
204205
@$(call PRINT_JULIA, cd $(JULIAHOME)/base && \
@@ -208,7 +209,7 @@ $(build_private_libdir)/inference.ji: $(CORE_SRCS) | $(build_private_libdir)
208209
RELBUILDROOT := $(shell $(JULIAHOME)/contrib/relative_path.sh "$(JULIAHOME)/base" "$(BUILDROOT)/base/")
209210
COMMA:=,
210211
define sysimg_builder
211-
$$(build_private_libdir)/sys$1.o: $$(build_private_libdir)/inference.ji $$(JULIAHOME)/VERSION $$(BASE_SRCS)
212+
$$(build_private_libdir)/sys$1.o: $$(build_private_libdir)/inference.ji $$(JULIAHOME)/VERSION $$(BASE_SRCS) $$(STDLIB_SRCS)
212213
@$$(call PRINT_JULIA, cd $$(JULIAHOME)/base && \
213214
if $$(call spawn,$3) $2 -C "$$(JULIA_CPU_TARGET)" --output-o $$(call cygpath_w,$$@).tmp $$(JULIA_SYSIMG_BUILD_FLAGS) \
214215
--startup-file=no --warn-overwrite=yes --sysimage $$(call cygpath_w,$$<) sysimg.jl $$(RELBUILDROOT); then \

base/sysimg.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,10 +485,17 @@ using Base
485485
unshift!(Base._included_files, (@__MODULE__, joinpath(@__DIR__, "sysimg.jl")))
486486

487487
# load some stdlib packages but don't put their names in Main
488-
Base.require(:DelimitedFiles)
489-
Base.require(:Test)
488+
Base.require(:Base64)
489+
Base.require(:CRC32c)
490490
Base.require(:Dates)
491+
Base.require(:DelimitedFiles)
492+
Base.require(:FileWatching)
493+
Base.require(:Mmap)
494+
Base.require(:Profile)
495+
Base.require(:SharedArrays)
491496
Base.require(:SuiteSparse)
497+
Base.require(:Test)
498+
492499

493500
empty!(LOAD_PATH)
494501

stdlib/Base64/src/Base64.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

3+
__precompile__(true)
4+
35
module Base64
46

57
export

stdlib/CRC32c/src/CRC32c.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2+
__precompile__(true)
3+
14
"""
25
Standard library module for computing the CRC-32c checksum.
36

stdlib/Dates/src/Dates.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

3+
__precompile__(true)
4+
35
"""
46
Dates
57

stdlib/FileWatching/src/FileWatching.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

3+
__precompile__(true)
4+
35
"""
46
Utilities for monitoring files and file descriptors for events.
57
"""

stdlib/Mmap/src/Mmap.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

3+
__precompile__(true)
4+
35
"""
46
Low level module for mmap (memory mapping of files).
57
"""

stdlib/Profile/src/Profile.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

3+
__precompile__(true)
4+
35
"""
46
Profiling support, main entry point is the [`@profile`](@ref) macro.
57
"""

stdlib/SharedArrays/src/SharedArrays.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

3+
__precompile__(true)
4+
35
"""
46
Provide the [`SharedArray`](@ref) type. It represents an array, which is shared across multiple processes, on a single machine.
57
"""

stdlib/SuiteSparse/src/SuiteSparse.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

3+
__precompile__(true)
4+
35
module SuiteSparse
46

57
import Base: At_ldiv_B, Ac_ldiv_B, A_ldiv_B!

0 commit comments

Comments
 (0)