Skip to content

Commit

Permalink
build: remove source-archive concept
Browse files Browse the repository at this point in the history
Source archives don't exist any more now that the release process is
Bazelized.

Epic: none

Release note: None
  • Loading branch information
rickystewart committed Mar 2, 2023
1 parent 5520c64 commit f5d84e5
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 75 deletions.
35 changes: 2 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ DESTDIR :=
DUPLFLAGS := -t 100
GOFLAGS :=
TAGS :=
ARCHIVE := cockroach.src.tgz
STARTFLAGS := -s type=mem,size=1GiB --logtostderr
BUILDTARGET := ./pkg/cmd/cockroach
SUFFIX := $(GOEXE)
Expand Down Expand Up @@ -1254,36 +1253,6 @@ pre-push: ## Run generate, lint, and test.
pre-push: generate lint test ui-lint ui-test
! git status --porcelain | read || (git status; git --no-pager diff -a 1>&2; exit 1)

# archive builds a source tarball out of this repository. Files in the special
# directory build/archive/contents are inserted directly into $(ARCHIVE_BASE).
# All other files in the repository are inserted into the archive with prefix
# $(ARCHIVE_BASE)/src/github.com/cockroachdb/cockroach to allow the extracted
# archive to serve directly as a GOPATH root.
.PHONY: archive
archive: ## Build a source tarball from this repository.
archive: $(ARCHIVE)

$(ARCHIVE): $(ARCHIVE).tmp
gzip -c $< > $@

# ARCHIVE_EXTRAS are hard-to-generate files and their prerequisites that are
# pre-generated and distributed in source archives to minimize the number of
# dependencies required for end-users to build from source.
ARCHIVE_EXTRAS = \
$(BUILDINFO) \
$(SQLPARSER_TARGETS) \
$(OPTGEN_TARGETS) \
pkg/ui/assets.ccl.installed pkg/ui/assets.oss.installed

# TODO(benesch): Make this recipe use `git ls-files --recurse-submodules`
# instead of scripts/ls-files.sh once Git v2.11 is widely deployed.
.INTERMEDIATE: $(ARCHIVE).tmp
$(ARCHIVE).tmp: ARCHIVE_BASE = cockroach-$(if $(BUILDINFO_TAG),$(BUILDINFO_TAG),$(shell cat .buildinfo/tag))
$(ARCHIVE).tmp: $(ARCHIVE_EXTRAS)
echo "$(if $(BUILDINFO_TAG),$(BUILDINFO_TAG),$(shell cat .buildinfo/tag))" > .buildinfo/tag
scripts/ls-files.sh | $(TAR) -cf $@ -T - $(TAR_XFORM_FLAG),^,$(ARCHIVE_BASE)/src/github.com/cockroachdb/cockroach/, $^
(cd build/archive/contents && $(TAR) -rf ../../../$@ $(TAR_XFORM_FLAG),^,$(ARCHIVE_BASE)/, *)

.buildinfo:
@mkdir -p $@

Expand Down Expand Up @@ -1751,7 +1720,7 @@ cleanshort:
-$(GO) clean $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LINKFLAGS)' -i github.com/cockroachdb/cockroach...
$(FIND_RELEVANT) -type f -name '*.test' -exec rm {} +
for f in cockroach*; do if [ -f "$$f" ]; then rm "$$f"; fi; done
rm -rf $(ARCHIVE) pkg/sql/parser/gen
rm -rf pkg/sql/parser/gen

.PHONY: clean
clean: ## Like cleanshort, but also includes C++ artifacts, Bazel artifacts, and the go build cache.
Expand Down Expand Up @@ -1916,7 +1885,7 @@ endif
# https://github.com/Reviewable/Reviewable/wiki/FAQ#how-do-i-tell-reviewable-that-a-file-is-generated-and-should-not-be-reviewed
# Note how the 'prefix' variable is manually appended. This is required by Homebrew.
.SECONDARY: build/variables.mk
build/variables.mk: Makefile build/archive/contents/Makefile pkg/ui/Makefile build/defs.mk
build/variables.mk: Makefile pkg/ui/Makefile build/defs.mk
@echo '# Code generated by Make. DO NOT EDIT.' > $@.tmp
@echo '# GENERATED FILE DO NOT EDIT' >> $@.tmp
@echo 'define VALID_VARS' >> $@.tmp
Expand Down
4 changes: 0 additions & 4 deletions build/archive/README.md

This file was deleted.

6 changes: 0 additions & 6 deletions build/archive/contents/Makefile

This file was deleted.

27 changes: 0 additions & 27 deletions build/archive/contents/README

This file was deleted.

4 changes: 0 additions & 4 deletions build/variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
define VALID_VARS
ACCEPTANCETIMEOUT
ANTITHESIS
ARCHIVE
ARCHIVE_BASE
ARCHIVE_EXTRAS
BASE_CGO_FLAGS_FILES
BENCHES
BENCHTIMEOUT
BUILDCHANNEL
BUILDINFO
BUILDINFO_TAG
BUILDTARGET
Expand Down
2 changes: 1 addition & 1 deletion pkg/build/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func IsRelease() bool {
// SeemsOfficial reports whether this binary is likely to have come from an
// official release channel.
func SeemsOfficial() bool {
return channel == "official-binary" || channel == "source-archive"
return channel == "official-binary"
}

func computeBinaryVersion(versionTxt, revision string) string {
Expand Down

0 comments on commit f5d84e5

Please sign in to comment.