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

build: cleanup base files inclusion #45441

Merged
merged 1 commit into from
Jun 9, 2022
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
build: cleanup base files inclusion
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 #31140
  • Loading branch information
vtjnash committed May 30, 2022
commit 075e3dbfe72dbf8a1a02fede142d09b53b790e55
28 changes: 16 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ default: $(JULIA_BUILD_MODE) # contains either "debug" or "release"
all: debug release

# sort is used to remove potential duplicates
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))
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))
ifneq ($(BUILDROOT),$(JULIAHOME))
BUILDDIRS := $(BUILDROOT) $(addprefix $(BUILDROOT)/,base src src/flisp src/support src/clangsa cli doc deps stdlib test test/clangsa test/embedding test/llvmpasses)
BUILDDIRMAKE := $(addsuffix /Makefile,$(BUILDDIRS)) $(BUILDROOT)/sysimage.mk
Expand Down Expand Up @@ -37,13 +37,13 @@ configure:
endif

$(foreach dir,$(DIRS),$(eval $(call dir_target,$(dir))))
$(foreach link,base $(JULIAHOME)/test,$(eval $(call symlink_target,$(link),$$(build_datarootdir)/julia,$(notdir $(link)))))
$(eval $(call symlink_target,$(JULIAHOME)/test,$$(build_datarootdir)/julia,test))

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

# Build the HTML docs (skipped if already exists, notably in tarballs)
$(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)
$(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)
@$(MAKE) docs

julia-symlink: julia-cli-$(JULIA_BUILD_MODE)
Expand All @@ -56,7 +56,7 @@ ifndef JULIA_VAGRANT_BUILD
endif
endif

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

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

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

julia-sysimg-release : $(JULIA_SYSIMG_release)
julia-sysimg-debug : $(JULIA_SYSIMG_debug)
julia-base-cache: $(build_datarootdir)/julia/base.cache
julia-debug julia-release : julia-% : julia-sysimg-% julia-src-% julia-symlink julia-libccalltest julia-libllvmcalltest julia-base-cache

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

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

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

# Copy in all .jl sources as well
mkdir -p $(DESTDIR)$(datarootdir)/julia/base $(DESTDIR)$(datarootdir)/julia/test
cp -R -L $(JULIAHOME)/base/* $(DESTDIR)$(datarootdir)/julia/base
cp -R -L $(JULIAHOME)/test/* $(DESTDIR)$(datarootdir)/julia/test
mkdir -p $(DESTDIR)$(datarootdir)/julia/src $(DESTDIR)$(datarootdir)/julia/test
cp -R -L $(build_datarootdir)/julia/* $(DESTDIR)$(datarootdir)/julia
cp -R -L $(JULIAHOME)/test/* $(DESTDIR)$(datarootdir)/julia/test
# Copy documentation
cp -R -L $(BUILDROOT)/doc/_build/html $(DESTDIR)$(docdir)/
# Remove various files which should not be installed
Expand Down Expand Up @@ -462,7 +466,7 @@ ifneq ($(BUILDROOT),$(JULIAHOME))
$(error make light-source-dist does not work in out-of-tree builds)
endif
# Save git information
-@$(MAKE) -C $(JULIAHOME)/base version_git.jl.phony
-@$(MAKE) -C $(JULIAHOME)/base version_git.jl

# Create file light-source-dist.tmp to hold all the filenames that go into the tarball
echo "base/version_git.jl" > light-source-dist.tmp
Expand Down
6 changes: 0 additions & 6 deletions base/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
/features_h.jl
/pcre_h.jl
/errno_h.jl
/build_h.jl
/build_h.jl.phony
/file_constants.jl
/uv_constants.jl
/version_git.jl
/version_git.jl.phony
/userimg.jl
14 changes: 2 additions & 12 deletions base/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,8 @@ using .Iterators: Flatten, Filter, product # for generators
include("namedtuple.jl")

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

# These used to be in build_h.jl and are retained for backwards compatibility
const libblas_name = "libblastrampoline"
Expand Down
88 changes: 62 additions & 26 deletions base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,22 @@ include $(JULIAHOME)/Make.inc

TAGGED_RELEASE_BANNER := ""

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)
all:

BASE_SRCS := $(patsubst ./%,%,$(shell cd $(SRCDIR) && find . -name \*.jl -and -not -name version_git.jl -and -not -name '*.phony'))
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

GENERATED_DSTS := $(addprefix $(build_datarootdir)/julia/src/,$(GENERATED_SRCS))
BASE_DSTS := $(addprefix $(build_datarootdir)/julia/src/base/,$(BASE_SRCS)) $(GENERATED_DSTS)
BASE_DIRS := $(sort $(dir $(BASE_DSTS)))
$(foreach dir,$(BASE_DIRS),$(eval $(call dir_target,$(dir))))

# we might like to add "| $(BASE_DIRS)" here, but that causes many version of 'make' to get confused and fail to build consistently
$(build_datarootdir)/julia/src/base/%.jl: $(SRCDIR)/%.jl
@mkdir -p $(dir $@)
cp $< $@

all: $(BASE_DSTS)

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

define parse_features
@echo "# $(2) features" >> $@
@$(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*(?:\/\/.*)?$$/' >> $@)
@$(call PRINT_PERL, cat $(JULIAHOME)/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*(?:\/\/.*)?$$/' >> $@)
@echo >> $@
endef

$(BUILDDIR)/features_h.jl: $(SRCDIR)/../src/features_x86.h $(SRCDIR)/../src/features_aarch32.h $(SRCDIR)/../src/features_aarch64.h
$(build_datarootdir)/julia/src/features_h.jl: $(JULIAHOME)/src/features_x86.h $(JULIAHOME)/src/features_aarch32.h $(JULIAHOME)/src/features_aarch64.h
@mkdir -p $(dir $@)
@-rm -f $@
@$(call parse_features,x86,X86)
@$(call parse_features,aarch32,AArch32)
@$(call parse_features,aarch64,AArch64)

$(BUILDDIR)/pcre_h.jl: $(PCRE_INCL_PATH)
$(build_datarootdir)/julia/src/pcre_h.jl: $(PCRE_INCL_PATH)
@mkdir -p $(dir $@)
@$(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 > $@)

$(BUILDDIR)/errno_h.jl:
$(build_datarootdir)/julia/src/errno_h.jl:
@mkdir -p $(dir $@)
@$(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 > $@)

$(BUILDDIR)/file_constants.jl: $(SRCDIR)/../src/file_constants.h
$(build_datarootdir)/julia/src/file_constants.jl: $(JULIAHOME)/src/file_constants.h
@mkdir -p $(dir $@)
@$(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*$$/' > $@)

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

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

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

$(build_datarootdir)/julia/src/version_git.jl.phony: $(BUILDDIR)/version_git.jl.phony
$(BUILDDIR)/version_git.jl.phony: $(SRCDIR)/version_git.sh
ifneq ($(NO_GIT), 1)
sh $< $(SRCDIR) > $@
@# This to avoid touching version_git.jl when it is not modified,
@# so that the system image does not need to be rebuilt.
@if ! cmp -s $@ version_git.jl; then \
$(call PRINT_PERL,) \
mv $@ version_git.jl; \
else \
rm -f $@; \
fi
else
ifeq ($(shell [ -f $(BUILDDIR)/version_git.jl ] && echo "true"), true)
@# Give warning if boilerplate git is used
@mkdir -p $(build_datarootdir)/julia/src
ifneq ($(NO_GIT),1)
@sh $< $(SRCDIR) > $@
else ifeq ($(shell [ -f $(BUILDDIR)/version_git.jl ] && echo "true"), true)
@# Give warning if boilerplate git is found here
@if grep -q "Default output if git is not available" $(BUILDDIR)/version_git.jl; then \
echo "WARNING: Using boilerplate git version info" >&2; \
fi
@cp $(BUILDDIR)/version_git.jl $@
else ifeq ($(shell [ -f $(SRCDIR)/version_git.jl ] && echo "true"), true)
@# Give warning if boilerplate git is found here
@if grep -q "Default output if git is not available" $(SRCDIR)/version_git.jl; then \
echo "WARNING: Using boilerplate git version info" >&2; \
fi
@cp $(SRCDIR)/version_git.jl $@
else
$(warning "WARNING: Generating boilerplate git version info")
@sh $(SRCDIR)/version_git.sh $(SRCDIR) NO_GIT > $(BUILDDIR)/version_git.jl
endif
@sh $< $(SRCDIR) NO_GIT > $@
endif
@# This to avoid touching version_git.jl when it is not modified,
@# so that the system image does not need to be rebuilt.
@if ! cmp -s $@ $(build_datarootdir)/julia/src/version_git.jl; then \
$(call PRINT_PERL,) \
mv $@ $(build_datarootdir)/julia/src/version_git.jl; \
else \
rm -f $@; \
fi
$(BUILDDIR)/version_git.jl: $(SRCDIR)/version_git.sh
sh $< $(SRCDIR) > $@

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

symlink_system_libraries: $(SYMLINK_SYSTEM_LIBRARIES)

.PHONY: $(BUILDDIR)/build_h.jl.phony $(BUILDDIR)/version_git.jl.phony clean all symlink_*
.FORCE:
.PHONY: $(BUILDDIR)/version_git.jl $(BUILDDIR)/version_git.jl.phony $(build_datarootdir)/julia/src/version_git.jl.phony \
$(BUILDDIR)/build_h.jl.phony $(build_datarootdir)/julia/src/build_h.jl.phony \
clean all .FORCE

clean:
-rm -f $(BUILDDIR)/pcre_h.jl
Expand All @@ -281,4 +316,5 @@ clean:
-rm -f $(BUILDDIR)/file_constants.jl
-rm -f $(BUILDDIR)/version_git.jl
-rm -f $(BUILDDIR)/version_git.jl.phony
-rm -rf $(build_datarootdir)/julia/src/*
-rm -f $(build_private_libdir)/lib*.$(SHLIB_EXT)*
2 changes: 1 addition & 1 deletion base/cpuid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Base.:<=(a::ISA, b::ISA) = a.features <= b.features
Base.:<(a::ISA, b::ISA) = a.features < b.features
Base.isless(a::ISA, b::ISA) = a < b

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

# Keep in sync with `arch_march_isa_mapping`.
const ISAs_by_family = Dict(
Expand Down
2 changes: 1 addition & 1 deletion base/filesystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ uv_fs_req_cleanup(req) = ccall(:uv_fs_req_cleanup, Cvoid, (Ptr{Cvoid},), req)
include("path.jl")
include("stat.jl")
include("file.jl")
include(string(length(Core.ARGS) >= 2 ? Core.ARGS[2] : "", "file_constants.jl")) # include($BUILDROOT/base/file_constants.jl)
include("../file_constants.jl")

## Operations with File (fd) objects ##

Expand Down
6 changes: 3 additions & 3 deletions base/initdefs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ function append_default_depot_path!(DEPOT_PATH)
path in DEPOT_PATH || push!(DEPOT_PATH, path)
path = abspath(Sys.BINDIR, "..", "share", "julia")
path in DEPOT_PATH || push!(DEPOT_PATH, path)
return DEPOT_PATH
end

function init_depot_path()
Expand All @@ -111,6 +112,7 @@ function init_depot_path()
else
append_default_depot_path!(DEPOT_PATH)
end
nothing
end

## LOAD_PATH & ACTIVE_PROJECT ##
Expand Down Expand Up @@ -220,9 +222,7 @@ function parse_load_path(str::String)
end

function init_load_path()
if Base.creating_sysimg
paths = ["@stdlib"]
elseif haskey(ENV, "JULIA_LOAD_PATH")
if haskey(ENV, "JULIA_LOAD_PATH")
paths = parse_load_path(ENV["JULIA_LOAD_PATH"])
else
paths = filter!(env -> env !== nothing,
Expand Down
2 changes: 1 addition & 1 deletion base/libc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if Sys.iswindows()
export GetLastError, FormatMessage
end

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

## RawFD ##

Expand Down
2 changes: 1 addition & 1 deletion base/libuv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Core definitions for interacting with the libuv library from Julia

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

# convert UV handle data to julia object, checking for null
function uv_sizeof_handle(handle)
Expand Down
4 changes: 2 additions & 2 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ elseif Sys.isapple()
# char filename[max_filename_length];
# };
# Buffer buf;
# getattrpath(path, &attr_list, &buf, sizeof(buf), FSOPT_);
# getattrlist(path, &attr_list, &buf, sizeof(buf), FSOPT_);
function isfile_casesensitive(path)
isaccessiblefile(path) || return false
path_basename = String(basename(path))
Expand Down Expand Up @@ -784,7 +784,7 @@ end

function find_source_file(path::AbstractString)
(isabspath(path) || isfile(path)) && return path
base_path = joinpath(Sys.BINDIR, DATAROOTDIR, "julia", "base", path)
base_path = joinpath(Sys.BINDIR, DATAROOTDIR, "julia", "src", "base", path)
return isfile(base_path) ? normpath(base_path) : nothing
end

Expand Down
3 changes: 1 addition & 2 deletions base/pcre.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ module PCRE

import ..RefValue

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

const PCRE_LIB = "libpcre2-8"

Expand Down
9 changes: 4 additions & 5 deletions base/sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ import Base.MainInclude: eval, include
pushfirst!(Base._included_files, (@__MODULE__, joinpath(@__DIR__, "Base.jl")))
pushfirst!(Base._included_files, (@__MODULE__, joinpath(@__DIR__, "sysimg.jl")))

# set up depot & load paths to be able to find stdlib packages
@eval Base creating_sysimg = true
Base.init_depot_path()
Base.init_load_path()

if Base.is_primary_base_module
# load some stdlib packages but don't put their names in Main
let
# set up depot & load paths to be able to find stdlib packages
push!(empty!(LOAD_PATH), "@stdlib")
Base.append_default_depot_path!(DEPOT_PATH)

# Stdlibs sorted in dependency, then alphabetical, order by contrib/print_sorted_stdlibs.jl
# Run with the `--exclude-jlls` option to filter out all JLL packages
stdlibs = [
Expand Down
Loading