From 500fc211e4ae5aa9037dec171e9383d4901947c6 Mon Sep 17 00:00:00 2001 From: Gari Singh Date: Mon, 8 Oct 2018 07:57:09 -0400 Subject: [PATCH] FAB-12237 Remove use of experimental tag We no longer muild with experimental features FAB-12237 #done Change-Id: I69624617d7f1a504e4ddfac7b0de1763e5e2fbc1 Signed-off-by: Gari Singh --- Makefile | 6 ------ common/metadata/metadata.go | 1 - core/chaincode/platforms/golang/platform.go | 10 +--------- core/scc/buildtags_experimental_test.go | 11 ----------- core/scc/buildtags_test.go | 11 ----------- core/scc/loadsysccs_test.go | 2 +- orderer/common/metadata/metadata.go | 11 +++++++---- orderer/common/metadata/metadata_test.go | 10 ++++++---- peer/version/version.go | 5 ++--- 9 files changed, 17 insertions(+), 50 deletions(-) delete mode 100644 core/scc/buildtags_experimental_test.go delete mode 100644 core/scc/buildtags_test.go diff --git a/Makefile b/Makefile index 595554116d5..0fb40eb301e 100755 --- a/Makefile +++ b/Makefile @@ -57,15 +57,10 @@ PROJECT_NAME = $(PROJECT_NAME)/fabric else PROJECT_NAME = hyperledger/fabric endif -EXPERIMENTAL ?= true BUILD_DIR ?= .build NEXUS_REPO = nexus3.hyperledger.org:10001/hyperledger -ifeq ($(EXPERIMENTAL),true) -GO_TAGS += experimental -endif - EXTRA_VERSION ?= $(shell git rev-parse --short HEAD) PROJECT_VERSION=$(BASE_VERSION)-snapshot-$(EXTRA_VERSION) @@ -81,7 +76,6 @@ METADATA_VAR += BaseVersion=$(BASEIMAGE_RELEASE) METADATA_VAR += BaseDockerLabel=$(BASE_DOCKER_LABEL) METADATA_VAR += DockerNamespace=$(DOCKER_NS) METADATA_VAR += BaseDockerNamespace=$(BASE_DOCKER_NS) -METADATA_VAR += Experimental=$(EXPERIMENTAL) GO_LDFLAGS = $(patsubst %,-X $(PKGNAME)/common/metadata.%,$(METADATA_VAR)) diff --git a/common/metadata/metadata.go b/common/metadata/metadata.go index 289f611a892..7cdd66e9954 100644 --- a/common/metadata/metadata.go +++ b/common/metadata/metadata.go @@ -13,4 +13,3 @@ var BaseVersion string = "0.4.12" var BaseDockerLabel string = "org.hyperledger.fabric" var DockerNamespace string = "hyperledger" var BaseDockerNamespace string = "hyperledger" -var Experimental string = "true" diff --git a/core/chaincode/platforms/golang/platform.go b/core/chaincode/platforms/golang/platform.go index ba816726d1e..5993f638b07 100644 --- a/core/chaincode/platforms/golang/platform.go +++ b/core/chaincode/platforms/golang/platform.go @@ -19,7 +19,6 @@ import ( "sort" "strings" - "github.com/hyperledger/fabric/common/metadata" "github.com/hyperledger/fabric/core/chaincode/platforms" "github.com/hyperledger/fabric/core/chaincode/platforms/ccmetadata" "github.com/hyperledger/fabric/core/chaincode/platforms/util" @@ -508,17 +507,10 @@ func (goPlatform *Platform) GenerateDockerBuild(path string, code []byte, tw *ta ldflagsOpt := getLDFlagsOpts() logger.Infof("building chaincode with ldflagsOpt: '%s'", ldflagsOpt) - var gotags string - // check if experimental features are enabled - if metadata.Experimental == "true" { - gotags = " experimental" - } - logger.Infof("building chaincode with tags: %s", gotags) - codepackage := bytes.NewReader(code) binpackage := bytes.NewBuffer(nil) err = util.DockerBuild(util.DockerBuildOptions{ - Cmd: fmt.Sprintf("GOPATH=/chaincode/input:$GOPATH go build -tags \"%s\" %s -o /chaincode/output/chaincode %s", gotags, ldflagsOpt, pkgname), + Cmd: fmt.Sprintf("GOPATH=/chaincode/input:$GOPATH go build %s -o /chaincode/output/chaincode %s", ldflagsOpt, pkgname), InputStream: codepackage, OutputStream: binpackage, }) diff --git a/core/scc/buildtags_experimental_test.go b/core/scc/buildtags_experimental_test.go deleted file mode 100644 index 87fbbf3f0cd..00000000000 --- a/core/scc/buildtags_experimental_test.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build experimental - -/* -Copyright SecureKey Technologies Inc. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ - -package scc - -var goBuildTags = "experimental" diff --git a/core/scc/buildtags_test.go b/core/scc/buildtags_test.go deleted file mode 100644 index 726093df191..00000000000 --- a/core/scc/buildtags_test.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build !experimental - -/* -Copyright SecureKey Technologies Inc. All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ - -package scc - -var goBuildTags = "" diff --git a/core/scc/loadsysccs_test.go b/core/scc/loadsysccs_test.go index eca5353c2b6..863a8c9d89c 100644 --- a/core/scc/loadsysccs_test.go +++ b/core/scc/loadsysccs_test.go @@ -64,7 +64,7 @@ func TestLoadSCCPluginInvalid(t *testing.T) { var raceEnabled bool func buildExamplePlugin(t *testing.T, path, pluginPackage string) { - cmd := exec.Command("go", "build", "-tags", goBuildTags, "-o", path, "-buildmode=plugin") + cmd := exec.Command("go", "build", "-o", path, "-buildmode=plugin") if raceEnabled { cmd.Args = append(cmd.Args, "-race") } diff --git a/orderer/common/metadata/metadata.go b/orderer/common/metadata/metadata.go index 03c2368e99d..94de3ff985a 100644 --- a/orderer/common/metadata/metadata.go +++ b/orderer/common/metadata/metadata.go @@ -29,9 +29,12 @@ func GetVersionInfo() string { Version = "development build" } - return fmt.Sprintf("%s:\n Version: %s\n Commit SHA: %s\n"+ - " Go version: %s\n OS/Arch: %s\n"+ - " Experimental features: %s\n", ProgramName, Version, common.CommitSHA, + return fmt.Sprintf( + "%s:\n Version: %s\n Commit SHA: %s\n Go version: %s\n OS/Arch: %s\n", + ProgramName, + Version, + common.CommitSHA, runtime.Version(), - fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH), common.Experimental) + fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH), + ) } diff --git a/orderer/common/metadata/metadata_test.go b/orderer/common/metadata/metadata_test.go index 439221baa63..0b127bed90f 100644 --- a/orderer/common/metadata/metadata_test.go +++ b/orderer/common/metadata/metadata_test.go @@ -24,10 +24,12 @@ func TestGetVersionInfo(t *testing.T) { common.Version = "testVersion" } - expected := fmt.Sprintf("%s:\n Version: %s\n Commit SHA: %s\n Go version: %s\n OS/Arch: %s\n"+ - " Experimental features: %s\n", metadata.ProgramName, common.Version, + expected := fmt.Sprintf( + "%s:\n Version: %s\n Commit SHA: %s\n Go version: %s\n OS/Arch: %s\n", + metadata.ProgramName, common.Version, common.CommitSHA, - runtime.Version(), fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH), - common.Experimental) + runtime.Version(), + fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH), + ) assert.Equal(t, expected, metadata.GetVersionInfo()) } diff --git a/peer/version/version.go b/peer/version/version.go index 7c01dc46883..56c9a94dff5 100644 --- a/peer/version/version.go +++ b/peer/version/version.go @@ -52,8 +52,7 @@ func GetInfo() string { return fmt.Sprintf("%s:\n Version: %s\n Commit SHA: %s\n Go version: %s\n"+ " OS/Arch: %s\n"+ - " Experimental features: %s\n Chaincode:\n %s\n", + " Chaincode:\n %s\n", ProgramName, metadata.Version, metadata.CommitSHA, runtime.Version(), - fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH), - metadata.Experimental, ccinfo) + fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH), ccinfo) }