Skip to content

Commit f0b1c5f

Browse files
authored
build: cleanup base files inclusion (JuliaLang#45441)
Ensures the out-of-tree build has the correct files installed, and simplifies some of the `include`s used in Base. Fixes a return value that was relied on (largely unnecessarily) by a loading test, despite being invalid before now. Fixes JuliaLang#31140
1 parent 46135df commit f0b1c5f

16 files changed

+136
-116
lines changed

Makefile

+16-12
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ default: $(JULIA_BUILD_MODE) # contains either "debug" or "release"
77
all: debug release
88

99
# sort is used to remove potential duplicates
10-
DIRS := $(sort $(build_bindir) $(build_depsbindir) $(build_libdir) $(build_private_libdir) $(build_libexecdir) $(build_includedir) $(build_includedir)/julia $(build_sysconfdir)/julia $(build_datarootdir)/julia $(build_datarootdir)/julia/stdlib $(build_man1dir))
10+
DIRS := $(sort $(build_bindir) $(build_depsbindir) $(build_libdir) $(build_private_libdir) $(build_libexecdir) $(build_includedir) $(build_includedir)/julia $(build_sysconfdir)/julia $(build_datarootdir)/julia $(build_datarootdir)/julia/src $(build_datarootdir)/julia/stdlib $(build_man1dir))
1111
ifneq ($(BUILDROOT),$(JULIAHOME))
1212
BUILDDIRS := $(BUILDROOT) $(addprefix $(BUILDROOT)/,base src src/flisp src/support src/clangsa cli doc deps stdlib test test/clangsa test/embedding test/llvmpasses)
1313
BUILDDIRMAKE := $(addsuffix /Makefile,$(BUILDDIRS)) $(BUILDROOT)/sysimage.mk
@@ -37,13 +37,13 @@ configure:
3737
endif
3838

3939
$(foreach dir,$(DIRS),$(eval $(call dir_target,$(dir))))
40-
$(foreach link,base $(JULIAHOME)/test,$(eval $(call symlink_target,$(link),$$(build_datarootdir)/julia,$(notdir $(link)))))
40+
$(eval $(call symlink_target,$(JULIAHOME)/test,$$(build_datarootdir)/julia,test))
4141

4242
julia_flisp.boot.inc.phony: julia-deps
4343
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/src julia_flisp.boot.inc.phony
4444

4545
# Build the HTML docs (skipped if already exists, notably in tarballs)
46-
$(BUILDROOT)/doc/_build/html/en/index.html: $(shell find $(BUILDROOT)/base $(BUILDROOT)/doc \( -path $(BUILDROOT)/doc/_build -o -path $(BUILDROOT)/doc/deps -o -name *_constants.jl -o -name *_h.jl -o -name version_git.jl \) -prune -o -type f -print)
46+
$(BUILDROOT)/doc/_build/html/en/index.html: $(shell find $(BUILDROOT)/base $(BUILDROOT)/doc \( -path $(BUILDROOT)/doc/_build -o -path $(BUILDROOT)/doc/deps \) -prune -o -type f -print)
4747
@$(MAKE) docs
4848

4949
julia-symlink: julia-cli-$(JULIA_BUILD_MODE)
@@ -56,7 +56,7 @@ ifndef JULIA_VAGRANT_BUILD
5656
endif
5757
endif
5858

59-
julia-deps: | $(DIRS) $(build_datarootdir)/julia/base $(build_datarootdir)/julia/test
59+
julia-deps: | $(DIRS) $(build_datarootdir)/julia/test
6060
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/deps
6161

6262
# `julia-stdlib` depends on `julia-deps` so that the fake JLL stdlibs can copy in their Artifacts.toml files.
@@ -84,9 +84,14 @@ julia-sysimg-ji : julia-stdlib julia-base julia-cli-$(JULIA_BUILD_MODE) julia-sr
8484
julia-sysimg-bc : julia-stdlib julia-base julia-cli-$(JULIA_BUILD_MODE) julia-src-$(JULIA_BUILD_MODE) | $(build_private_libdir)
8585
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f sysimage.mk sysimg-bc JULIA_EXECUTABLE='$(JULIA_EXECUTABLE)'
8686

87-
julia-sysimg-release julia-sysimg-debug : julia-sysimg-% : julia-sysimg-ji julia-src-%
88-
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f sysimage.mk sysimg-$*
87+
$(JULIA_SYSIMG_release): julia-sysimg-ji julia-src-release
88+
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f sysimage.mk sysimg-release
89+
$(JULIA_SYSIMG_debug) : julia-sysimg-ji julia-src-debug
90+
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) -f sysimage.mk sysimg-debug
8991

92+
julia-sysimg-release : $(JULIA_SYSIMG_release)
93+
julia-sysimg-debug : $(JULIA_SYSIMG_debug)
94+
julia-base-cache: $(build_datarootdir)/julia/base.cache
9095
julia-debug julia-release : julia-% : julia-sysimg-% julia-src-% julia-symlink julia-libccalltest julia-libllvmcalltest julia-base-cache
9196

9297
debug release : % : julia-%
@@ -156,10 +161,10 @@ $(build_datarootdir)/julia/julia-config.jl: $(JULIAHOME)/contrib/julia-config.jl
156161
$(build_depsbindir)/stringreplace: $(JULIAHOME)/contrib/stringreplace.c | $(build_depsbindir)
157162
@$(call PRINT_CC, $(HOSTCC) -o $(build_depsbindir)/stringreplace $(JULIAHOME)/contrib/stringreplace.c)
158163

159-
julia-base-cache: julia-sysimg-$(JULIA_BUILD_MODE) | $(DIRS) $(build_datarootdir)/julia
164+
$(build_datarootdir)/julia/base.cache: $(JULIA_SYSIMG) | $(DIRS) $(build_datarootdir)/julia
160165
@JULIA_BINDIR=$(call cygpath_w,$(build_bindir)) WINEPATH="$(call cygpath_w,$(build_bindir));$$WINEPATH" \
161166
$(call spawn, $(JULIA_EXECUTABLE) --startup-file=no $(call cygpath_w,$(JULIAHOME)/etc/write_base_cache.jl) \
162-
$(call cygpath_w,$(build_datarootdir)/julia/base.cache))
167+
$(call cygpath_w,$@))
163168

164169
# public libraries, that are installed in $(prefix)/lib
165170
JL_TARGETS := julia
@@ -313,10 +318,9 @@ ifeq ($(BUNDLE_DEBUG_LIBS),1)
313318
endif
314319

315320
# Copy in all .jl sources as well
316-
mkdir -p $(DESTDIR)$(datarootdir)/julia/base $(DESTDIR)$(datarootdir)/julia/test
317-
cp -R -L $(JULIAHOME)/base/* $(DESTDIR)$(datarootdir)/julia/base
318-
cp -R -L $(JULIAHOME)/test/* $(DESTDIR)$(datarootdir)/julia/test
321+
mkdir -p $(DESTDIR)$(datarootdir)/julia/src $(DESTDIR)$(datarootdir)/julia/test
319322
cp -R -L $(build_datarootdir)/julia/* $(DESTDIR)$(datarootdir)/julia
323+
cp -R -L $(JULIAHOME)/test/* $(DESTDIR)$(datarootdir)/julia/test
320324
# Copy documentation
321325
cp -R -L $(BUILDROOT)/doc/_build/html $(DESTDIR)$(docdir)/
322326
# Remove various files which should not be installed
@@ -462,7 +466,7 @@ ifneq ($(BUILDROOT),$(JULIAHOME))
462466
$(error make light-source-dist does not work in out-of-tree builds)
463467
endif
464468
# Save git information
465-
-@$(MAKE) -C $(JULIAHOME)/base version_git.jl.phony
469+
-@$(MAKE) -C $(JULIAHOME)/base version_git.jl
466470

467471
# Create file light-source-dist.tmp to hold all the filenames that go into the tarball
468472
echo "base/version_git.jl" > light-source-dist.tmp

base/.gitignore

-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
/features_h.jl
2-
/pcre_h.jl
3-
/errno_h.jl
4-
/build_h.jl
51
/build_h.jl.phony
6-
/file_constants.jl
7-
/uv_constants.jl
82
/version_git.jl
93
/version_git.jl.phony
104
/userimg.jl

base/Base.jl

+2-12
Original file line numberDiff line numberDiff line change
@@ -151,18 +151,8 @@ using .Iterators: Flatten, Filter, product # for generators
151151
include("namedtuple.jl")
152152

153153
# For OS specific stuff
154-
# We need to strcat things here, before strings are really defined
155-
function strcat(x::String, y::String)
156-
out = ccall(:jl_alloc_string, Ref{String}, (Csize_t,), Core.sizeof(x) + Core.sizeof(y))
157-
GC.@preserve x y out begin
158-
out_ptr = unsafe_convert(Ptr{UInt8}, out)
159-
unsafe_copyto!(out_ptr, unsafe_convert(Ptr{UInt8}, x), Core.sizeof(x))
160-
unsafe_copyto!(out_ptr + Core.sizeof(x), unsafe_convert(Ptr{UInt8}, y), Core.sizeof(y))
161-
end
162-
return out
163-
end
164-
include(strcat((length(Core.ARGS)>=2 ? Core.ARGS[2] : ""), "build_h.jl")) # include($BUILDROOT/base/build_h.jl)
165-
include(strcat((length(Core.ARGS)>=2 ? Core.ARGS[2] : ""), "version_git.jl")) # include($BUILDROOT/base/version_git.jl)
154+
include("../build_h.jl")
155+
include("../version_git.jl")
166156

167157
# These used to be in build_h.jl and are retained for backwards compatibility
168158
const libblas_name = "libblastrampoline"

base/Makefile

+62-26
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,22 @@ include $(JULIAHOME)/Make.inc
66

77
TAGGED_RELEASE_BANNER := ""
88

9-
all: $(addprefix $(BUILDDIR)/,pcre_h.jl errno_h.jl build_h.jl.phony features_h.jl file_constants.jl uv_constants.jl version_git.jl.phony)
9+
all:
10+
11+
BASE_SRCS := $(patsubst ./%,%,$(shell cd $(SRCDIR) && find . -name \*.jl -and -not -name version_git.jl -and -not -name '*.phony'))
12+
GENERATED_SRCS := pcre_h.jl errno_h.jl build_h.jl.phony features_h.jl file_constants.jl uv_constants.jl version_git.jl.phony
13+
14+
GENERATED_DSTS := $(addprefix $(build_datarootdir)/julia/src/,$(GENERATED_SRCS))
15+
BASE_DSTS := $(addprefix $(build_datarootdir)/julia/src/base/,$(BASE_SRCS)) $(GENERATED_DSTS)
16+
BASE_DIRS := $(sort $(dir $(BASE_DSTS)))
17+
$(foreach dir,$(BASE_DIRS),$(eval $(call dir_target,$(dir))))
18+
19+
# we might like to add "| $(BASE_DIRS)" here, but that causes many version of 'make' to get confused and fail to build consistently
20+
$(build_datarootdir)/julia/src/base/%.jl: $(SRCDIR)/%.jl
21+
@mkdir -p $(dir $@)
22+
cp $< $@
23+
24+
all: $(BASE_DSTS)
1025

1126
PCRE_CONST := 0x[0-9a-fA-F]+|[0-9]+|\([\-0-9]+\)
1227
ifeq ($(USE_SYSTEM_PCRE), 1)
@@ -17,29 +32,37 @@ endif
1732

1833
define parse_features
1934
@echo "# $(2) features" >> $@
20-
@$(call PRINT_PERL, cat $(SRCDIR)/../src/features_$(1).h | perl -lne 'print "const JL_$(2)_$$1 = UInt32($$2)" if /^\s*JL_FEATURE_DEF(?:_NAME)?\(\s*(\w+)\s*,\s*([^,]+)\s*,.*\)\s*(?:\/\/.*)?$$/' >> $@)
35+
@$(call PRINT_PERL, cat $(JULIAHOME)/src/features_$(1).h | \
36+
perl -lne 'print "const JL_$(2)_$$1 = UInt32($$2)" if /^\s*JL_FEATURE_DEF(?:_NAME)?\(\s*(\w+)\s*,\s*([^,]+)\s*,.*\)\s*(?:\/\/.*)?$$/' >> $@)
2137
@echo >> $@
2238
endef
2339

24-
$(BUILDDIR)/features_h.jl: $(SRCDIR)/../src/features_x86.h $(SRCDIR)/../src/features_aarch32.h $(SRCDIR)/../src/features_aarch64.h
40+
$(build_datarootdir)/julia/src/features_h.jl: $(JULIAHOME)/src/features_x86.h $(JULIAHOME)/src/features_aarch32.h $(JULIAHOME)/src/features_aarch64.h
41+
@mkdir -p $(dir $@)
2542
@-rm -f $@
2643
@$(call parse_features,x86,X86)
2744
@$(call parse_features,aarch32,AArch32)
2845
@$(call parse_features,aarch64,AArch64)
2946

30-
$(BUILDDIR)/pcre_h.jl: $(PCRE_INCL_PATH)
47+
$(build_datarootdir)/julia/src/pcre_h.jl: $(PCRE_INCL_PATH)
48+
@mkdir -p $(dir $@)
3149
@$(call PRINT_PERL, $(CPP) -D PCRE2_CODE_UNIT_WIDTH=8 -dM $< | perl -nle '/^\s*#define\s+PCRE2_(\w*)\s*\(?($(PCRE_CONST))\)?u?\s*$$/ and print index($$1, "ERROR_") == 0 ? "const $$1 = Cint($$2)" : "const $$1 = UInt32($$2)"' | LC_ALL=C sort > $@)
3250

33-
$(BUILDDIR)/errno_h.jl:
51+
$(build_datarootdir)/julia/src/errno_h.jl:
52+
@mkdir -p $(dir $@)
3453
@$(call PRINT_PERL, echo '#include <errno.h>' | $(CPP) -dM - | perl -nle 'print "const $$1 = Int32($$2)" if /^#define\s+(E\w+)\s+(\d+)\s*$$/' | LC_ALL=C sort > $@)
3554

36-
$(BUILDDIR)/file_constants.jl: $(SRCDIR)/../src/file_constants.h
55+
$(build_datarootdir)/julia/src/file_constants.jl: $(JULIAHOME)/src/file_constants.h
56+
@mkdir -p $(dir $@)
3757
@$(call PRINT_PERL, $(CPP_STDOUT) -DJULIA $< | perl -nle 'print "$$1 0o$$2" if /^(\s*const\s+[A-z_]+\s+=)\s+(0[0-9]*)\s*$$/; print "$$1" if /^\s*(const\s+[A-z_]+\s+=\s+([1-9]|0x)[0-9A-z]*)\s*$$/' > $@)
3858

39-
$(BUILDDIR)/uv_constants.jl: $(SRCDIR)/../src/uv_constants.h $(LIBUV_INC)/uv/errno.h
59+
$(build_datarootdir)/julia/src/uv_constants.jl: $(JULIAHOME)/src/uv_constants.h $(LIBUV_INC)/uv/errno.h
60+
@mkdir -p $(dir $@)
4061
@$(call PRINT_PERL, $(CPP_STDOUT) "-I$(LIBUV_INC)" -DJULIA $< | tail -n 16 > $@)
4162

63+
$(build_datarootdir)/julia/src/build_h.jl.phony: $(BUILDDIR)/build_h.jl.phony
4264
$(BUILDDIR)/build_h.jl.phony:
65+
@mkdir -p $(build_datarootdir)/julia/src
4366
@echo "# This file is automatically generated in base/Makefile" > $@
4467
ifeq ($(XC_HOST),)
4568
@echo "const MACHINE = \"$(BUILD_MACHINE)\"" >> $@
@@ -87,35 +110,44 @@ endif
87110

88111
@# This to ensure that we always rebuild this file, but only when it is modified do we touch build_h.jl,
89112
@# ensuring we rebuild the system image as infrequently as possible
90-
@if ! cmp -s $@ build_h.jl; then \
113+
@if ! cmp -s $@ $(build_datarootdir)/julia/src/build_h.jl; then \
91114
$(call PRINT_PERL,) \
92-
mv $@ build_h.jl; \
115+
mv $@ $(build_datarootdir)/julia/src/build_h.jl; \
93116
else \
94117
rm -f $@; \
95118
fi
96119

120+
$(build_datarootdir)/julia/src/version_git.jl.phony: $(BUILDDIR)/version_git.jl.phony
97121
$(BUILDDIR)/version_git.jl.phony: $(SRCDIR)/version_git.sh
98-
ifneq ($(NO_GIT), 1)
99-
sh $< $(SRCDIR) > $@
100-
@# This to avoid touching version_git.jl when it is not modified,
101-
@# so that the system image does not need to be rebuilt.
102-
@if ! cmp -s $@ version_git.jl; then \
103-
$(call PRINT_PERL,) \
104-
mv $@ version_git.jl; \
105-
else \
106-
rm -f $@; \
107-
fi
108-
else
109-
ifeq ($(shell [ -f $(BUILDDIR)/version_git.jl ] && echo "true"), true)
110-
@# Give warning if boilerplate git is used
122+
@mkdir -p $(build_datarootdir)/julia/src
123+
ifneq ($(NO_GIT),1)
124+
@sh $< $(SRCDIR) > $@
125+
else ifeq ($(shell [ -f $(BUILDDIR)/version_git.jl ] && echo "true"), true)
126+
@# Give warning if boilerplate git is found here
111127
@if grep -q "Default output if git is not available" $(BUILDDIR)/version_git.jl; then \
112128
echo "WARNING: Using boilerplate git version info" >&2; \
113129
fi
130+
@cp $(BUILDDIR)/version_git.jl $@
131+
else ifeq ($(shell [ -f $(SRCDIR)/version_git.jl ] && echo "true"), true)
132+
@# Give warning if boilerplate git is found here
133+
@if grep -q "Default output if git is not available" $(SRCDIR)/version_git.jl; then \
134+
echo "WARNING: Using boilerplate git version info" >&2; \
135+
fi
136+
@cp $(SRCDIR)/version_git.jl $@
114137
else
115138
$(warning "WARNING: Generating boilerplate git version info")
116-
@sh $(SRCDIR)/version_git.sh $(SRCDIR) NO_GIT > $(BUILDDIR)/version_git.jl
117-
endif
139+
@sh $< $(SRCDIR) NO_GIT > $@
118140
endif
141+
@# This to avoid touching version_git.jl when it is not modified,
142+
@# so that the system image does not need to be rebuilt.
143+
@if ! cmp -s $@ $(build_datarootdir)/julia/src/version_git.jl; then \
144+
$(call PRINT_PERL,) \
145+
mv $@ $(build_datarootdir)/julia/src/version_git.jl; \
146+
else \
147+
rm -f $@; \
148+
fi
149+
$(BUILDDIR)/version_git.jl: $(SRCDIR)/version_git.sh
150+
sh $< $(SRCDIR) > $@
119151

120152
ifeq (,$(filter $(OS), WINNT emscripten))
121153
# For any USE_SYSTEM_* libraries that will be dynamically loaded by libjulia,
@@ -163,7 +195,7 @@ endif
163195
define symlink_system_library
164196
libname_$2 := $$(notdir $(call versioned_libname,$2,$3))
165197
libpath_$2 := $$(shell $$(call spawn,$$(LIBWHICH)) -p $$(libname_$2) 2>/dev/null)
166-
symlink_$2: $$(build_private_libdir)/$$(libname_$2)
198+
symlink_$2: $$(build_private_libdir)/$$(libname_$2) .FORCE
167199
$$(build_private_libdir)/$$(libname_$2):
168200
@if [ -e "$$(libpath_$2)" ]; then \
169201
REALPATH=$$(libpath_$2); \
@@ -269,7 +301,10 @@ endif
269301

270302
symlink_system_libraries: $(SYMLINK_SYSTEM_LIBRARIES)
271303

272-
.PHONY: $(BUILDDIR)/build_h.jl.phony $(BUILDDIR)/version_git.jl.phony clean all symlink_*
304+
.FORCE:
305+
.PHONY: $(BUILDDIR)/version_git.jl $(BUILDDIR)/version_git.jl.phony $(build_datarootdir)/julia/src/version_git.jl.phony \
306+
$(BUILDDIR)/build_h.jl.phony $(build_datarootdir)/julia/src/build_h.jl.phony \
307+
clean all .FORCE
273308

274309
clean:
275310
-rm -f $(BUILDDIR)/pcre_h.jl
@@ -281,4 +316,5 @@ clean:
281316
-rm -f $(BUILDDIR)/file_constants.jl
282317
-rm -f $(BUILDDIR)/version_git.jl
283318
-rm -f $(BUILDDIR)/version_git.jl.phony
319+
-rm -rf $(build_datarootdir)/julia/src/*
284320
-rm -f $(build_private_libdir)/lib*.$(SHLIB_EXT)*

base/cpuid.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Base.:<=(a::ISA, b::ISA) = a.features <= b.features
2121
Base.:<(a::ISA, b::ISA) = a.features < b.features
2222
Base.isless(a::ISA, b::ISA) = a < b
2323

24-
include(string(length(Core.ARGS) >= 2 ? Core.ARGS[2] : "", "features_h.jl")) # include($BUILDROOT/base/features_h.jl)
24+
include("../features_h.jl")
2525

2626
# Keep in sync with `arch_march_isa_mapping`.
2727
const ISAs_by_family = Dict(

base/filesystem.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ uv_fs_req_cleanup(req) = ccall(:uv_fs_req_cleanup, Cvoid, (Ptr{Cvoid},), req)
9191
include("path.jl")
9292
include("stat.jl")
9393
include("file.jl")
94-
include(string(length(Core.ARGS) >= 2 ? Core.ARGS[2] : "", "file_constants.jl")) # include($BUILDROOT/base/file_constants.jl)
94+
include("../file_constants.jl")
9595

9696
## Operations with File (fd) objects ##
9797

base/initdefs.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ function append_default_depot_path!(DEPOT_PATH)
9393
path in DEPOT_PATH || push!(DEPOT_PATH, path)
9494
path = abspath(Sys.BINDIR, "..", "share", "julia")
9595
path in DEPOT_PATH || push!(DEPOT_PATH, path)
96+
return DEPOT_PATH
9697
end
9798

9899
function init_depot_path()
@@ -111,6 +112,7 @@ function init_depot_path()
111112
else
112113
append_default_depot_path!(DEPOT_PATH)
113114
end
115+
nothing
114116
end
115117

116118
## LOAD_PATH & ACTIVE_PROJECT ##
@@ -220,9 +222,7 @@ function parse_load_path(str::String)
220222
end
221223

222224
function init_load_path()
223-
if Base.creating_sysimg
224-
paths = ["@stdlib"]
225-
elseif haskey(ENV, "JULIA_LOAD_PATH")
225+
if haskey(ENV, "JULIA_LOAD_PATH")
226226
paths = parse_load_path(ENV["JULIA_LOAD_PATH"])
227227
else
228228
paths = filter!(env -> env !== nothing,

base/libc.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if Sys.iswindows()
1414
export GetLastError, FormatMessage
1515
end
1616

17-
include(string(length(Core.ARGS) >= 2 ? Core.ARGS[2] : "", "errno_h.jl")) # include($BUILDROOT/base/errno_h.jl)
17+
include("../errno_h.jl")
1818

1919
## RawFD ##
2020

base/libuv.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Core definitions for interacting with the libuv library from Julia
44

5-
include(string(length(Core.ARGS) >= 2 ? Core.ARGS[2] : "", "uv_constants.jl")) # include($BUILDROOT/base/uv_constants.jl)
5+
include("../uv_constants.jl")
66

77
# convert UV handle data to julia object, checking for null
88
function uv_sizeof_handle(handle)

base/loading.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ elseif Sys.isapple()
4242
# char filename[max_filename_length];
4343
# };
4444
# Buffer buf;
45-
# getattrpath(path, &attr_list, &buf, sizeof(buf), FSOPT_NOFOLLOW);
45+
# getattrlist(path, &attr_list, &buf, sizeof(buf), FSOPT_NOFOLLOW);
4646
function isfile_casesensitive(path)
4747
isaccessiblefile(path) || return false
4848
path_basename = String(basename(path))
@@ -804,7 +804,7 @@ end
804804

805805
function find_source_file(path::AbstractString)
806806
(isabspath(path) || isfile(path)) && return path
807-
base_path = joinpath(Sys.BINDIR, DATAROOTDIR, "julia", "base", path)
807+
base_path = joinpath(Sys.BINDIR, DATAROOTDIR, "julia", "src", "base", path)
808808
return isfile(base_path) ? normpath(base_path) : nothing
809809
end
810810

base/pcre.jl

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ module PCRE
66

77
import ..RefValue
88

9-
# include($BUILDROOT/base/pcre_h.jl)
10-
include(string(length(Core.ARGS) >= 2 ? Core.ARGS[2] : "", "pcre_h.jl"))
9+
include("../pcre_h.jl")
1110

1211
const PCRE_LIB = "libpcre2-8"
1312

base/sysimg.jl

+4-5
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ import Base.MainInclude: eval, include
1111
pushfirst!(Base._included_files, (@__MODULE__, joinpath(@__DIR__, "Base.jl")))
1212
pushfirst!(Base._included_files, (@__MODULE__, joinpath(@__DIR__, "sysimg.jl")))
1313

14-
# set up depot & load paths to be able to find stdlib packages
15-
@eval Base creating_sysimg = true
16-
Base.init_depot_path()
17-
Base.init_load_path()
18-
1914
if Base.is_primary_base_module
2015
# load some stdlib packages but don't put their names in Main
2116
let
17+
# set up depot & load paths to be able to find stdlib packages
18+
push!(empty!(LOAD_PATH), "@stdlib")
19+
Base.append_default_depot_path!(DEPOT_PATH)
20+
2221
# Stdlibs sorted in dependency, then alphabetical, order by contrib/print_sorted_stdlibs.jl
2322
# Run with the `--exclude-jlls` option to filter out all JLL packages
2423
stdlibs = [

0 commit comments

Comments
 (0)