diff --git a/Makefile b/Makefile index 882beb6172f8f..171409b4970ea 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ 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)) ifneq ($(BUILDROOT),$(JULIAHOME)) -BUILDDIRS := $(BUILDROOT) $(addprefix $(BUILDROOT)/,base src ui doc deps test test/embedding test/llvmpasses) +BUILDDIRS := $(BUILDROOT) $(addprefix $(BUILDROOT)/,base src ui doc deps stdlib test test/embedding test/llvmpasses) BUILDDIRMAKE := $(addsuffix /Makefile,$(BUILDDIRS)) DIRS := $(DIRS) $(BUILDDIRS) $(BUILDDIRMAKE): | $(BUILDDIRS) @@ -39,9 +39,6 @@ endif $(foreach dir,$(DIRS),$(eval $(call dir_target,$(dir)))) $(foreach link,base $(JULIAHOME)/test,$(eval $(call symlink_target,$(link),$(build_datarootdir)/julia,$(notdir $(link))))) -build_defaultpkgdir = $(build_datarootdir)/julia/stdlib/$(shell echo $(VERSDIR)) -$(eval $(call symlink_target,$(JULIAHOME)/stdlib,$(build_datarootdir)/julia/stdlib,$(shell echo $(VERSDIR)))) - julia_flisp.boot.inc.phony: julia-deps @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/src julia_flisp.boot.inc.phony @@ -56,9 +53,12 @@ ifndef JULIA_VAGRANT_BUILD endif endif -julia-deps: | $(DIRS) $(build_datarootdir)/julia/base $(build_datarootdir)/julia/test $(build_defaultpkgdir) +julia-deps: | $(DIRS) $(build_datarootdir)/julia/base $(build_datarootdir)/julia/test @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/deps +julia-stdlib: | $(DIRS) + @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/stdlib + julia-base: julia-deps $(build_sysconfdir)/julia/startup.jl $(build_man1dir)/julia.1 $(build_datarootdir)/julia/julia-config.jl @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/base @@ -74,10 +74,10 @@ julia-ui-release julia-ui-debug : julia-ui-% : julia-src-% julia-sysimg : julia-base julia-ui-$(JULIA_BUILD_MODE) @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) $(build_private_libdir)/sys.ji JULIA_EXECUTABLE='$(JULIA_EXECUTABLE)' -julia-sysimg-release : julia-sysimg julia-ui-release +julia-sysimg-release : julia-stdlib julia-sysimg julia-ui-release @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) $(build_private_libdir)/sys.$(SHLIB_EXT) -julia-sysimg-debug : julia-sysimg julia-ui-debug +julia-sysimg-debug : julia-stdlib julia-sysimg julia-ui-debug @$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) $(build_private_libdir)/sys-debug.$(SHLIB_EXT) julia-debug julia-release : julia-% : julia-ui-% julia-sysimg-% julia-symlink julia-libccalltest julia-base-cache @@ -527,10 +527,11 @@ source-dist: full-source-dist: light-source-dist.tmp # Get all the dependencies downloaded @$(MAKE) -C deps getall NO_GIT=1 + @$(MAKE) -C stdlib getall # Create file full-source-dist.tmp to hold all the filenames that go into the tarball cp light-source-dist.tmp full-source-dist.tmp - -ls deps/srccache/*.tar.gz deps/srccache/*.tar.bz2 deps/srccache/*.tar.xz deps/srccache/*.tgz deps/srccache/*.zip deps/srccache/*.pem >> full-source-dist.tmp + -ls deps/srccache/*.tar.gz deps/srccache/*.tar.bz2 deps/srccache/*.tar.xz deps/srccache/*.tgz deps/srccache/*.zip deps/srccache/*.pem stdlib/srccache/*.tar.gz >> full-source-dist.tmp # Prefix everything with the current directory name (usually "julia"), then create tarball DIRNAME=$$(basename $$(pwd)); \ @@ -543,6 +544,7 @@ clean: | $(CLEAN_TARGETS) @-$(MAKE) -C $(BUILDROOT)/src clean @-$(MAKE) -C $(BUILDROOT)/ui clean @-$(MAKE) -C $(BUILDROOT)/test clean + @-$(MAKE) -C $(BUILDROOT)/stdlib clean-pkg -rm -f $(BUILDROOT)/julia -rm -f $(BUILDROOT)/*.tar.gz -rm -f $(build_depsbindir)/stringreplace \ diff --git a/deps/checksums/Pkg-ed5908796128c6227dcddefa9ec06a47066b8b01.tar.gz/md5 b/deps/checksums/Pkg-ed5908796128c6227dcddefa9ec06a47066b8b01.tar.gz/md5 new file mode 100644 index 0000000000000..6a2f75aeb009e --- /dev/null +++ b/deps/checksums/Pkg-ed5908796128c6227dcddefa9ec06a47066b8b01.tar.gz/md5 @@ -0,0 +1 @@ +df1b07419d50db883998ca9bb8fc7ea1 diff --git a/deps/checksums/Pkg-ed5908796128c6227dcddefa9ec06a47066b8b01.tar.gz/sha512 b/deps/checksums/Pkg-ed5908796128c6227dcddefa9ec06a47066b8b01.tar.gz/sha512 new file mode 100644 index 0000000000000..c750de4766759 --- /dev/null +++ b/deps/checksums/Pkg-ed5908796128c6227dcddefa9ec06a47066b8b01.tar.gz/sha512 @@ -0,0 +1 @@ +c2a1427d3d8fec20746676133b41db6a082e9b3fc7c1941a43e0398cfe8b33d1547ab58d89391a99b26816909e77258d6331894295d5c6084997da8104f9ac7b diff --git a/stdlib/.gitignore b/stdlib/.gitignore new file mode 100644 index 0000000000000..d8ce799be4bb9 --- /dev/null +++ b/stdlib/.gitignore @@ -0,0 +1,2 @@ +/srccache +/Pkg diff --git a/stdlib/Makefile b/stdlib/Makefile new file mode 100644 index 0000000000000..3c44b191fc124 --- /dev/null +++ b/stdlib/Makefile @@ -0,0 +1,46 @@ +default: install + +.PHONY: default extract-pkg get-pkg clean-pkg getall install + +SRCDIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) +JULIAHOME := $(abspath $(SRCDIR)/..) +SRCCACHE := $(abspath $(SRCDIR)/srccache) +BUILDDIR := $(SRCCACHE) + +include $(JULIAHOME)/Make.inc +include $(JULIAHOME)/deps/tools/common.mk +include $(JULIAHOME)/deps/tools/git-external.mk + +VERSDIR := v`cut -d. -f1-2 < $(JULIAHOME)/VERSION` + +# Download and extract Pkg +PKG := https://github.com/JuliaLang/Pkg.jl +PKG_TAR_URL = https://api.github.com/repos/JuliaLang/Pkg.jl/tarball/$1 +$(eval $(call git-external,Pkg,PKG,,,$(BUILDDIR))) + +extract-pkg: $(BUILDDIR)/$(PKG_SRC_DIR)/source-extracted +Pkg: $(BUILDDIR)/$(PKG_SRC_DIR)/source-extracted + rm -rf $@ + cp -r $(BUILDDIR)/$(PKG_SRC_DIR) $@ +get-pkg: Pkg +clean-pkg: + -rm -rf Pkg + -rm -rf $(BUILDDIR)/$(PKG_SRC_DIR) + +# Generate symlinks to all stdlibs from usr/share/julia/stdlib/vX.Y/ +STDLIBS = Base64 CRC32c Dates DelimitedFiles Distributed FileWatching \ + Future InteractiveUtils Libdl LibGit2 LinearAlgebra Logging \ + Markdown Mmap Printf Profile Random REPL Serialization SHA \ + SharedArrays Sockets SparseArrays Statistics SuiteSparse Test Unicode UUIDs + +$(foreach pkg, $(STDLIBS), $(eval $(call symlink_target,$(JULIAHOME)/stdlib/$(pkg),$(build_datarootdir)/julia/stdlib/$(shell echo $(VERSDIR)),$(pkg)))) +$(eval $(call symlink_target,$(BUILDROOT)/stdlib/Pkg,$(build_datarootdir)/julia/stdlib/$(shell echo $(VERSDIR)),Pkg)) + +$(build_datarootdir)/julia/stdlib/$(shell echo $(VERSDIR)): + mkdir -p $@ + +STDLIBS_LINK_TARGETS = $(addprefix $(build_datarootdir)/julia/stdlib/$(shell echo $(VERSDIR))/, $(STDLIBS) Pkg) + +install: Pkg $(STDLIBS_LINK_TARGETS) +getall: get-pkg + diff --git a/stdlib/Pkg.version b/stdlib/Pkg.version new file mode 100644 index 0000000000000..a7733e05b8262 --- /dev/null +++ b/stdlib/Pkg.version @@ -0,0 +1,2 @@ +PKG_BRANCH = master +PKG_SHA1 = ed5908796128c6227dcddefa9ec06a47066b8b01 diff --git a/test/choosetests.jl b/test/choosetests.jl index 2f9c5cd000bf2..e0eba43004ae9 100644 --- a/test/choosetests.jl +++ b/test/choosetests.jl @@ -3,7 +3,7 @@ using Random, Sockets const STDLIB_DIR = joinpath(Sys.BINDIR, "..", "share", "julia", "stdlib", "v$(VERSION.major).$(VERSION.minor)") -const STDLIBS = filter!(x -> isdir(joinpath(STDLIB_DIR, x)), readdir(STDLIB_DIR)) +const STDLIBS = filter!(x -> isfile(joinpath(STDLIB_DIR, x, "src", "$(x).jl")), readdir(STDLIB_DIR)) """