23126845 golang download target fails if source not cached
authorShawn Walker-Salas <shawn.walker@oracle.com>
Thu, 21 Apr 2016 16:51:39 -0700
changeset 5833 c1e66c53301d
parent 5832 32a211a6952e
child 5835 681b964c8157
23126845 golang download target fails if source not cached
components/golang/Makefile
make-rules/prep-git.mk
--- a/components/golang/Makefile	Thu Apr 21 12:54:18 2016 -0700
+++ b/components/golang/Makefile	Thu Apr 21 16:51:39 2016 -0700
@@ -88,22 +88,14 @@
 GIT_COMMIT_ID_tour=		41d86d51aaa4f1cf4f66e42456ba137c93cad950
 
 # Resulting hash of related git commit once archived.
-GIT_HASH_crypto=	\
-	sha256:05003de0b534b6e0303dc7c2a0f88a1cd53af11acde96fa5a38bcbaf31250c5e
-GIT_HASH_image=	\
-	sha256:96951cea9d34603209961d46010610894df6c708321e1b4781d71bdd180e75b8
-GIT_HASH_lint=	\
-	sha256:1ad5bbf9c21327c73cb67db1329aee8253e18de994302c8ce1a98581bda4da44
-GIT_HASH_net=	\
-	sha256:ca7830ac9af95232204ebc52d27c4726c32e4c0df760e039faba0224075fcb59
-GIT_HASH_sys=	\
-	sha256:b5fdef2664d43430e58250c25564b0376895eb44fbd7e292d5251e5deea8a0c8
-GIT_HASH_text=	\
-	sha256:f65d0191d15042773899efe405fd3e4168922bba2494b2e68f0408bbef23e777
-GIT_HASH_tools=	\
-	sha256:c260308533abc9ea95328eee34616f59ccef1737c51be9be6d652f538777b661
-GIT_HASH_tour=	\
-	sha256:c484f1dbdd67e5108418574d808daf223cc4c544c0f9e4bea4150978197914bc
+GIT_HASH_crypto=  sha256:05003de0b534b6e0303dc7c2a0f88a1cd53af11acde96fa5a38bcbaf31250c5e
+GIT_HASH_image=  sha256:96951cea9d34603209961d46010610894df6c708321e1b4781d71bdd180e75b8
+GIT_HASH_lint=  sha256:1ad5bbf9c21327c73cb67db1329aee8253e18de994302c8ce1a98581bda4da44
+GIT_HASH_net=  sha256:ca7830ac9af95232204ebc52d27c4726c32e4c0df760e039faba0224075fcb59
+GIT_HASH_sys=  sha256:b5fdef2664d43430e58250c25564b0376895eb44fbd7e292d5251e5deea8a0c8
+GIT_HASH_text=  sha256:f65d0191d15042773899efe405fd3e4168922bba2494b2e68f0408bbef23e777
+GIT_HASH_tools=  sha256:c260308533abc9ea95328eee34616f59ccef1737c51be9be6d652f538777b661
+GIT_HASH_tour=  sha256:c484f1dbdd67e5108418574d808daf223cc4c544c0f9e4bea4150978197914bc
 
 # Go package imports for lint are found in github directory.
 COMPONENT_IMPORT_SRC_lint=	github.com/golang
--- a/make-rules/prep-git.mk	Thu Apr 21 12:54:18 2016 -0700
+++ b/make-rules/prep-git.mk	Thu Apr 21 16:51:39 2016 -0700
@@ -66,8 +66,11 @@
 # when complete.
 #
 # GIT CLONE ARGS
-# --depth=1 arg to git clone takes only the top level (named) commits on any
-# branches or tags. Attempts to use other commit IDs will fail.
+# A shallow clone (--depth=1) to git clone takes only the top level (named)
+# commits on any branches or tags and can cause use of other commit IDs to
+# fail.  As such, it should never be used here as it can make it impossible to
+# reliably reproduce archives created from the result since git clone (unlike
+# mercurial) currently has no way of cloning to a specific commit id.
 $$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1)):	$(MAKEFILE_PREREQ)
 	$$(FETCH) --file $$@ \
 		$$(GIT_HASH$(1):%=--hash %) || \
@@ -75,7 +78,7 @@
 	$$(FETCH) --file $$@ \
 		$$(COMPONENT_ARCHIVE_URL$(1):%=--url %) || \
 	(TMP_REPO=$$$$(mktemp --directory) && \
-	$(GIT) clone --depth=1 $$(GIT_REPO$(1)) $$(GIT_BRANCH_ARG$(1)) $$$${TMP_REPO} && \
+	$(GIT) clone $$(GIT_REPO$(1)) $$(GIT_BRANCH_ARG$(1)) $$$${TMP_REPO} && \
 	(cd $$$${TMP_REPO} ; $(GIT) checkout \
 	$$(GIT_COMMIT_ID$(1))) && \
 	(cd $$$${TMP_REPO} ; $(GIT) archive --format tar.gz \