-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
stdlib-git: improve integration with git-external #30075
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1181,22 +1181,24 @@ $(subst /,\\,$(subst $(shell $(2) pwd),$(shell $(2) cmd //C cd),$(abspath $(1))) | |
endef | ||
endif | ||
|
||
define symlink_target | ||
CLEAN_TARGETS += clean-$(2)/$(3) | ||
define symlink_target # (from, to-dir, to-name) | ||
CLEAN_TARGETS += clean-$$(abspath $(2)/$(3)) | ||
clean-$$(abspath $(2)/$(3)): | ||
ifeq ($(BUILD_OS), WINNT) | ||
@-cmd //C rmdir $$(call mingw_to_dos,$(2)/$(3),cd $(2) &&) | ||
-cmd //C rmdir $$(call mingw_to_dos,$(2)/$(3),cd $(2) &&) | ||
else | ||
@-rm $$(abspath $(2)/$(3)) | ||
-rm -r $$(abspath $(2)/$(3)) | ||
endif | ||
$$(subst $$(abspath $(JULIAHOME))/,,$$(abspath $(2)/$(3))): $$(abspath $(2)/$(3)) | ||
$$(abspath $(2)/$(3)): | $$(abspath $(2)) | ||
ifeq ($(BUILD_OS), WINNT) | ||
ifeq ($$(BUILD_OS), WINNT) | ||
@cmd //C mklink //J $$(call mingw_to_dos,$(2)/$(3),cd $(2) &&) $$(call mingw_to_dos,$(1),) | ||
else ifneq (,$(findstring CYGWIN,$(BUILD_OS))) | ||
else ifneq (,$$(findstring CYGWIN,$$(BUILD_OS))) | ||
@cmd /C mklink /J $$(call cygpath_w,$(2)/$(3)) $$(call cygpath_w,$(1)) | ||
else ifdef JULIA_VAGRANT_BUILD | ||
@cp -R $$(abspath $(1)) $$@ | ||
@rm -r $$@ | ||
@cp -R $$(abspath $(1)) [email protected] | ||
@mv [email protected] $$@ | ||
else | ||
@ln -sf $$(abspath $(1)) $$@ | ||
endif | ||
|
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
42bdc87720b24e312c6882517f67d3a6 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
b2c3bc198e8dc8cc4c56f57d0f0f8dc6495fce7e0c5ca10414fc851a06a67775d4c6f42c76cd54a73a5e1d9c45a8f3de25be456a6a685da33738bcacce8ef232 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/srccache | ||
/Pkg-* | ||
/Pkg |
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
PKG_BRANCH = master | ||
PKG_SHA1 = d305e82fd353cb67e8a064800b9972ee1cb7b5e0 | ||
PKG_SHA1 = f9180e48b27a843aeee864db814dce57cb296b9b | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this changing the Pkg sha? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It had the wrong SHA1 from what was intended here. This is now the whole commit hash, while previously it only contained the tree hash for this commit. This var is (intentionally) allowed to specify any git object (incl. branch, tag, etc.), but typically it should have the commit SHA, since that's the most general and easiest to work with (e.g. what git usually presents you). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But why are the checksums also changed? Shouldn't the commit you set here produce the same tarball? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The name here gets inserted by GitHub as part of the tarball file contents ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not cache the
Pkg-$COMMITSHA
folders in SRCCACHE instead of poisoning/stdlib/
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want an out-of-tree build, you should do an out-of-tree build. Some Packages have a tendency to mutate their own contents (usually just a
deps/
folder), so as a whole that probably more nearly makes them build artifacts than source code. But anyways, this variable is just documenting where build artifacts must go (which must not be the same as srccache where source inputs should go); actually deciding whether something is a shared, immutable input or a build artifact is up to the rest of the Makefile.