From f1cd5e345cd24127adb00483ee0e85cc983a4fd8 Mon Sep 17 00:00:00 2001 From: Daniel Worrall Date: Wed, 15 Jan 2020 23:02:22 +0000 Subject: [PATCH 1/2] Add git shallow clones --- darwin/Makefile | 3 +-- docs/Dockerfile | 3 +-- linux/Dockerfile | 23 +++++++++-------------- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/darwin/Makefile b/darwin/Makefile index c192dfd8..b7d50d66 100644 --- a/darwin/Makefile +++ b/darwin/Makefile @@ -49,9 +49,8 @@ $(CURDIR)/../omnibus/crystal-darwin-x86_64: $(OUTPUT_DIR)/$(DARWIN_NAME) $(OUTPUT_DIR)/$(DARWIN_PKG_NAME): ## Build omnibus crystal project ifeq ($(FORCE_GIT_TAGGED), 0) rm -Rf $(CURDIR)/tmp && mkdir -p $(CURDIR)/tmp && cd $(CURDIR)/tmp \ - && git clone https://github.com/crystal-lang/crystal \ + && git clone --branch $(CRYSTAL_SHA1) --depth 1 https://github.com/crystal-lang/crystal \ && cd crystal \ - && git checkout $(CRYSTAL_SHA1) \ && git checkout -b $(CRYSTAL_VERSION) endif diff --git a/docs/Dockerfile b/docs/Dockerfile index df71a9cc..09afaebf 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -5,9 +5,8 @@ RUN crystal --version ARG output_docs_base_name ARG crystal_sha1 -RUN git clone https://github.com/crystal-lang/crystal \ +RUN git clone --branch ${crystal_sha1} --depth 1 https://github.com/crystal-lang/crystal \ && cd crystal \ - && git checkout ${crystal_sha1} \ \ && make docs \ && git describe --tags --long --always 2>/dev/null > ./docs/revision.txt \ diff --git a/linux/Dockerfile b/linux/Dockerfile index 2554704b..d4e7fc72 100644 --- a/linux/Dockerfile +++ b/linux/Dockerfile @@ -14,11 +14,10 @@ ENV CFLAGS="-fPIC -pipe ${release:+-O2}" ARG gc_version ARG libatomic_ops_version COPY files/feature-thread-stackbottom-upstream.patch /tmp/ -RUN git clone https://github.com/ivmai/bdwgc \ +RUN git clone --branch ${gc_version} --depth 1 https://github.com/ivmai/bdwgc \ && cd bdwgc \ - && git checkout ${gc_version} \ - && git clone https://github.com/ivmai/libatomic_ops \ - && (cd libatomic_ops && git checkout ${libatomic_ops_version}) \ + && git clone --branch ${libatomic_ops_version} --depth 1 https://github.com/ivmai/libatomic_ops \ + && cd libatomic_ops \ \ && patch -p1 < /tmp/feature-thread-stackbottom-upstream.patch \ \ @@ -29,9 +28,8 @@ RUN git clone https://github.com/ivmai/bdwgc \ # Cross-compile crystal and build libcrystal.a ARG crystal_sha1 ARG musl_target -RUN git clone https://github.com/crystal-lang/crystal \ +RUN git clone --branch ${crystal_sha1} --depth 1 https://github.com/crystal-lang/crystal \ && cd crystal \ - && git checkout ${crystal_sha1} \ \ && make deps @@ -54,11 +52,10 @@ ENV CFLAGS="-fPIC -pipe ${release:+-O2}" # Build libgc (again, this time for musl) ARG gc_version ARG libatomic_ops_version -RUN git clone https://github.com/ivmai/bdwgc \ +RUN git clone --branch ${gc_version} --depth 1 https://github.com/ivmai/bdwgc \ && cd bdwgc \ - && git checkout ${gc_version} \ - && git clone https://github.com/ivmai/libatomic_ops \ - && (cd libatomic_ops && git checkout ${libatomic_ops_version}) \ + && git clone --branch ${libatomic_ops_version} --depth 1 https://github.com/ivmai/libatomic_ops \ + && cd libatomic_ops \ \ && ./autogen.sh \ && ./configure --disable-debug --disable-shared --enable-large-config \ @@ -78,9 +75,8 @@ RUN mkdir -p /tmp/crystal \ ARG crystal_version ARG crystal_sha1 ARG gnu_target -RUN git clone https://github.com/crystal-lang/crystal \ +RUN git clone --branch ${crystal_sha1} --depth 1 https://github.com/crystal-lang/crystal \ && cd crystal \ - && git checkout ${crystal_sha1} \ \ && make crystal stats=true static=true ${release:+release=true} \ CRYSTAL_CONFIG_TARGET=${gnu_target} \ @@ -89,9 +85,8 @@ RUN git clone https://github.com/crystal-lang/crystal \ # Build shards ARG shards_version ARG musl_target -RUN git clone https://github.com/crystal-lang/shards \ +RUN git clone --branch ${shards_version} --depth 1 https://github.com/crystal-lang/shards \ && cd shards \ - && git checkout ${shards_version} \ \ # Hack to make shards not segfault && echo 'require "llvm/lib_llvm"; require "llvm/enums"; require "./src/shards"' > hack.cr \ From 5f17b7b8a45dcf4cc15ac5d74c83c375682ab685 Mon Sep 17 00:00:00 2001 From: Daniel Worrall Date: Fri, 17 Jan 2020 18:27:56 +0000 Subject: [PATCH 2/2] Remove broken sha references --- darwin/Makefile | 3 ++- docs/Dockerfile | 3 ++- linux/Dockerfile | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/darwin/Makefile b/darwin/Makefile index b7d50d66..c192dfd8 100644 --- a/darwin/Makefile +++ b/darwin/Makefile @@ -49,8 +49,9 @@ $(CURDIR)/../omnibus/crystal-darwin-x86_64: $(OUTPUT_DIR)/$(DARWIN_NAME) $(OUTPUT_DIR)/$(DARWIN_PKG_NAME): ## Build omnibus crystal project ifeq ($(FORCE_GIT_TAGGED), 0) rm -Rf $(CURDIR)/tmp && mkdir -p $(CURDIR)/tmp && cd $(CURDIR)/tmp \ - && git clone --branch $(CRYSTAL_SHA1) --depth 1 https://github.com/crystal-lang/crystal \ + && git clone https://github.com/crystal-lang/crystal \ && cd crystal \ + && git checkout $(CRYSTAL_SHA1) \ && git checkout -b $(CRYSTAL_VERSION) endif diff --git a/docs/Dockerfile b/docs/Dockerfile index 09afaebf..df71a9cc 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -5,8 +5,9 @@ RUN crystal --version ARG output_docs_base_name ARG crystal_sha1 -RUN git clone --branch ${crystal_sha1} --depth 1 https://github.com/crystal-lang/crystal \ +RUN git clone https://github.com/crystal-lang/crystal \ && cd crystal \ + && git checkout ${crystal_sha1} \ \ && make docs \ && git describe --tags --long --always 2>/dev/null > ./docs/revision.txt \ diff --git a/linux/Dockerfile b/linux/Dockerfile index d4e7fc72..028e3a0f 100644 --- a/linux/Dockerfile +++ b/linux/Dockerfile @@ -28,8 +28,9 @@ RUN git clone --branch ${gc_version} --depth 1 https://github.com/ivmai/bdwgc \ # Cross-compile crystal and build libcrystal.a ARG crystal_sha1 ARG musl_target -RUN git clone --branch ${crystal_sha1} --depth 1 https://github.com/crystal-lang/crystal \ +RUN git clone https://github.com/crystal-lang/crystal \ && cd crystal \ + && git checkout ${crystal_sha1} \ \ && make deps @@ -75,8 +76,9 @@ RUN mkdir -p /tmp/crystal \ ARG crystal_version ARG crystal_sha1 ARG gnu_target -RUN git clone --branch ${crystal_sha1} --depth 1 https://github.com/crystal-lang/crystal \ +RUN git clone https://github.com/crystal-lang/crystal \ && cd crystal \ + && git checkout ${crystal_sha1} \ \ && make crystal stats=true static=true ${release:+release=true} \ CRYSTAL_CONFIG_TARGET=${gnu_target} \