-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stdlib-git: improve integration with git-external (#30075)
Previously some of the work was shifted, leading to awkward extraneous copies and preventing usage of DEPS_GIT=1 mode (the main point of this script). There also seemed to be unexpected failure modes in the current usage where the files in stdlib/Pkg would routinely go missing for me. I don't know the source of those, but I hope that this will fix it (because it makes more of the state immutable). Also noticed some issues with existing scripts (expanding variables at unintended points, not rebuilding on some changes), and fixed those.
- Loading branch information
Showing
13 changed files
with
100 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ 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))))) | ||
$(foreach link,base $(JULIAHOME)/test,$(eval $(call symlink_target,$(link),$$(build_datarootdir)/julia,$(notdir $(link))))) | ||
|
||
julia_flisp.boot.inc.phony: julia-deps | ||
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/src julia_flisp.boot.inc.phony | ||
|
@@ -183,10 +183,8 @@ COMPILER_SRCS := $(addprefix $(JULIAHOME)/, \ | |
COMPILER_SRCS += $(shell find $(JULIAHOME)/base/compiler -name \*.jl) | ||
# sort these to remove duplicates | ||
BASE_SRCS := $(sort $(shell find $(JULIAHOME)/base -name \*.jl -and -not -name sysimg.jl) \ | ||
$(shell find $(BUILDROOT)/base -name \*.jl -and -not -name sysimg.jl)) \ | ||
$(shell find $(JULIAHOME)/stdlib/Base64/src -name \*.jl) | ||
STDLIB_SRCS := $(JULIAHOME)/base/sysimg.jl $(shell find $(JULIAHOME)/stdlib/*/src -name \*.jl) | ||
STDLIB_PKGS := $(shell cd $(JULIAHOME)/stdlib && ls) | ||
$(shell find $(BUILDROOT)/base -name \*.jl -and -not -name sysimg.jl)) | ||
STDLIB_SRCS := $(JULIAHOME)/base/sysimg.jl $(shell find $(build_datarootdir)/julia/stdlib/$(VERSDIR)/*/src -name \*.jl) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
vtjnash
Author
Member
|
||
RELBUILDROOT := $(shell $(JULIAHOME)/contrib/relative_path.sh "$(JULIAHOME)/base" "$(BUILDROOT)/base/") | ||
|
||
$(build_private_libdir)/corecompiler.ji: $(COMPILER_SRCS) | $(build_private_libdir) | ||
|
@@ -397,6 +395,10 @@ endif | |
# Remove various files which should not be installed | ||
-rm -f $(DESTDIR)$(datarootdir)/julia/base/version_git.sh | ||
-rm -f $(DESTDIR)$(datarootdir)/julia/test/Makefile | ||
-rm -f $(DESTDIR)$(datarootdir)/julia/stdlib/$(VERSDIR)/*/source-extracted | ||
-rm -f $(DESTDIR)$(datarootdir)/julia/stdlib/$(VERSDIR)/*/build-configured | ||
-rm -f $(DESTDIR)$(datarootdir)/julia/stdlib/$(VERSDIR)/*/build-compiled | ||
-rm -f $(DESTDIR)$(datarootdir)/julia/stdlib/$(VERSDIR)/*/build-checked | ||
# Copy in beautiful new man page | ||
$(INSTALL_F) $(build_man1dir)/julia.1 $(DESTDIR)$(man1dir)/ | ||
# Copy icon and .desktop file | ||
|
@@ -447,12 +449,9 @@ endif | |
mkdir -p $(DESTDIR)$(sysconfdir) | ||
cp -R $(build_sysconfdir)/julia $(DESTDIR)$(sysconfdir)/ | ||
|
||
distclean dist-clean: | ||
distclean: | ||
-rm -fr $(BUILDROOT)/julia-*.tar.gz $(BUILDROOT)/julia*.exe $(BUILDROOT)/julia-*.7z $(BUILDROOT)/julia-$(JULIA_COMMIT) | ||
|
||
dist: | ||
@echo \'dist\' target is deprecated: use \'binary-dist\' instead. | ||
|
||
binary-dist: distclean | ||
ifeq ($(USE_SYSTEM_BLAS),0) | ||
ifeq ($(ISX86),1) | ||
|
@@ -518,7 +517,7 @@ endif | |
echo "base/version_git.jl" > light-source-dist.tmp | ||
|
||
# Download all stdlibs and include the tarball filenames in light-source-dist.tmp | ||
@$(MAKE) -C stdlib getall | ||
@$(MAKE) -C stdlib getall NO_GIT=1 | ||
-ls stdlib/srccache/*.tar.gz >> light-source-dist.tmp | ||
|
||
# Exclude git, github and CI config files | ||
|
@@ -561,7 +560,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 | ||
@-$(MAKE) -C $(BUILDROOT)/stdlib clean | ||
-rm -f $(BUILDROOT)/julia | ||
-rm -f $(BUILDROOT)/*.tar.gz | ||
-rm -f $(build_depsbindir)/stringreplace \ | ||
|
@@ -577,6 +576,7 @@ cleanall: clean | |
-rm -fr $(build_prefix) $(build_staging) | ||
|
||
distcleanall: cleanall | ||
@-$(MAKE) -C $(BUILDROOT)/stdlib distclean | ||
@-$(MAKE) -C $(BUILDROOT)/deps distcleanall | ||
@-$(MAKE) -C $(BUILDROOT)/doc cleanall | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
deps/checksums/Pkg-d305e82fd353cb67e8a064800b9972ee1cb7b5e0.tar.gz/md5
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
deps/checksums/Pkg-d305e82fd353cb67e8a064800b9972ee1cb7b5e0.tar.gz/sha512
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
deps/checksums/Pkg-f9180e48b27a843aeee864db814dce57cb296b9b.tar.gz/md5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
42bdc87720b24e312c6882517f67d3a6 |
1 change: 1 addition & 0 deletions
1
deps/checksums/Pkg-f9180e48b27a843aeee864db814dce57cb296b9b.tar.gz/sha512
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
b2c3bc198e8dc8cc4c56f57d0f0f8dc6495fce7e0c5ca10414fc851a06a67775d4c6f42c76cd54a73a5e1d9c45a8f3de25be456a6a685da33738bcacce8ef232 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/srccache | ||
/Pkg-* | ||
/Pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,47 @@ | ||
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) | ||
BUILDDIR := . | ||
|
||
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` | ||
VERSDIR := v$(shell 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) | ||
$(build_datarootdir)/julia/stdlib/$(VERSDIR): | ||
mkdir -p $@ | ||
|
||
# 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 | ||
STDLIBS-EXT = Pkg | ||
|
||
$(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 | ||
|
||
# Download and extract Pkg | ||
PKG_GIT_URL := git://github.com/JuliaLang/Pkg.jl.git | ||
PKG_TAR_URL = https://api.github.com/repos/JuliaLang/Pkg.jl/tarball/$1 | ||
$(eval $(call git-external,Pkg,PKG,,,$(BUILDDIR))) | ||
$(BUILDDIR)/$(PKG_SRC_DIR)/build-compiled: $(BUILDDIR)/$(PKG_SRC_DIR)/source-extracted | ||
@# no build steps | ||
echo 1 > $@ | ||
$(eval $(call symlink_install,Pkg,$$(PKG_SRC_DIR),$$(build_datarootdir)/julia/stdlib/$$(VERSDIR))) | ||
clean-Pkg: | ||
-rm $(BUILDDIR)/$(PKG_SRC_DIR)/build-compiled | ||
get-Pkg: $(PKG_SRC_FILE) | ||
extract-Pkg: $(BUILDDIR)/$(PKG_SRC_DIR)/source-extracted | ||
configure-Pkg: extract-Pkg | ||
compile-Pkg: $(BUILDDIR)/$(PKG_SRC_DIR)/build-compiled | ||
|
||
|
||
# Generate symlinks to all stdlibs at usr/share/julia/stdlib/vX.Y/ | ||
$(foreach module, $(STDLIBS), $(eval $(call symlink_target,$$(JULIAHOME)/stdlib/$(module),$$(build_datarootdir)/julia/stdlib/$$(VERSDIR),$(module)))) | ||
|
||
STDLIBS_LINK_TARGETS := $(addprefix $(build_datarootdir)/julia/stdlib/$(VERSDIR)/,$(STDLIBS)) | ||
|
||
getall get: get-Pkg | ||
install: install-Pkg $(STDLIBS_LINK_TARGETS) | ||
clean: clean-Pkg $(CLEAN_TARGETS) | ||
distclean: distclean-Pkg clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
PKG_BRANCH = master | ||
PKG_SHA1 = d305e82fd353cb67e8a064800b9972ee1cb7b5e0 | ||
PKG_SHA1 = f9180e48b27a843aeee864db814dce57cb296b9b |
This change is a little problematic;
find $(build_datarootdir)/julia/stdlib/$(VERSDIR)/*/src -name \*.jl
doesn't give anything when running on a clean build (it errors out because$(build_datarootdir)
doesn't exist yet). This problem is masked by the existence of$(JULIAHOME)/base/sysimg.jl
, so anything downstream of$(STDLIB_SRCS)
will still be built, however it is possible to get into a weird state where if I delete$(build_datarootdir)
after that first build AND modify one of the standard libraries, downstream targets may not be properly rebuilt. This is just a minor problem, but I think we should fix it.Since the files within
$(build_datarootdir)
are just symlinks anyway, it seems reasonable to me to revert this line back to: