From fd568682c3aa720ca3cbe058bde5ccbaab6426d4 Mon Sep 17 00:00:00 2001 From: Marc CARRE Date: Tue, 24 Jan 2017 13:01:35 +0000 Subject: [PATCH 1/3] Upgrade Weave Net to latest version of build-tools, skipping bash scripts when lint-ing. Lint-ing all of Weave Net is currently not desirable because: * it would create conflicts on many branches, * it would pollute the git history, * etc. and because `lint` currently lints all files except `./vendor`, this breaks Weave Net's build. As a result, Weave Net is not using the latest commit in `build-tools`'s `master` branch, which is also source of problems: * it limits standardisation of projects across Weaveworks, * it limits the ability to use the latest features of `build-tools`, * it complexifies merging changes in `build-tools` (e.g. #53 and weaveworks/weave#2694 for weaveworks/weave#2647), * etc. This change: * brings Weave Net to the latest version of `build-tools` (which now supports `.lintignore` files), * adds such a `.lintignore` file to skip all bash scripts (in order to avoid breaking the build). `GLOB`s in `.lintignore` can then, over time and as scripts are `shfmt`-ed, be relaxed and maybe even removed. --- .lintignore | 8 ++++++++ tools | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .lintignore diff --git a/.lintignore b/.lintignore new file mode 100644 index 0000000000..3403a0d123 --- /dev/null +++ b/.lintignore @@ -0,0 +1,8 @@ +# IMPORTANT: Please only use GLOBs to ignore files and directories. + +# Do not lint any bash script in Weave Net, in order to +# avoid breaking the build on make lint: +*.sh +bin/* +prog/weaveexec/symlink +weave diff --git a/tools b/tools index 48beb60bbe..a59884f322 160000 --- a/tools +++ b/tools @@ -1 +1 @@ -Subproject commit 48beb60bbebb6511b8c41fb339f48dc97505966e +Subproject commit a59884f322173264bc088549899cad51a51d0a87 From ed629d420d862bdae580fa1eb982e79405231ec0 Mon Sep 17 00:00:00 2001 From: Marc CARRE Date: Tue, 24 Jan 2017 16:51:11 +0000 Subject: [PATCH 2/3] Pass additional options to ./tools/test to revert to previous behaviour. Previous commit upgrades Weave Net to the latest version of `build-tools`. However, `./tools/test`'s default behaviour has changed, so we need to explicitly pass new options/arguments, in order to keep it behaving like before fd568682c3aa720ca3cbe058bde5ccbaab6426d4. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1af0eccd24..3eb7bd7c43 100644 --- a/Makefile +++ b/Makefile @@ -210,7 +210,7 @@ $(SIGPROXY_EXE) $(TEST_TLS_EXE) $(WEAVEWAIT_NOOP_EXE) $(RUNNER_EXE): go build $(BUILD_FLAGS) -o $@ ./$(@D) tests: - ./tools/test -no-go-get + ./tools/test -no-go-get -netgo -timeout 8m lint: ./tools/lint -nocomment -notestpackage . From 8e6cb5e24dd055de8c6062cea65a41f8e04762e0 Mon Sep 17 00:00:00 2001 From: Marc CARRE Date: Tue, 24 Jan 2017 19:29:12 +0000 Subject: [PATCH 3/3] Print files we currently do not lint. Makes what the build does explicitly and helps for potential debugging. Also reminds us that we are skipping these files, so that we ultimately shfmt them and stop lint-ignoring them. --- Makefile | 2 +- bin/circle-test-unit | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3eb7bd7c43..27ea6832a4 100644 --- a/Makefile +++ b/Makefile @@ -176,7 +176,7 @@ exes $(EXES) tests lint: $(BUILD_UPTODATE) $(SUDO) docker run $(RM) $(RUN_FLAGS) \ -v $(shell pwd):/go/src/github.com/weaveworks/weave \ -v $(shell pwd)/.pkg:/go/pkg \ - -e GOARCH=$(ARCH) -e CGO_ENABLED=1 -e GOOS=linux -e CIRCLECI -e CIRCLE_BUILD_NUM -e CIRCLE_NODE_TOTAL -e CIRCLE_NODE_INDEX -e COVERDIR -e SLOW \ + -e GOARCH=$(ARCH) -e CGO_ENABLED=1 -e GOOS=linux -e CIRCLECI -e CIRCLE_BUILD_NUM -e CIRCLE_NODE_TOTAL -e CIRCLE_NODE_INDEX -e COVERDIR -e SLOW -e DEBUG \ $(BUILD_IMAGE) COVERAGE=$(COVERAGE) WEAVE_VERSION=$(WEAVE_VERSION) CC=$(CC) QEMUARCH=$(QEMUARCH) CGO_LDFLAGS=$(CGO_LDFLAGS) $@ else diff --git a/bin/circle-test-unit b/bin/circle-test-unit index b9c98eb4c9..b9ac9a5dc1 100755 --- a/bin/circle-test-unit +++ b/bin/circle-test-unit @@ -6,6 +6,6 @@ source "$STATE" if [ -n "$TEST_AND_PUBLISH" ] ; then cd $SRCDIR - make lint + make DEBUG=1 lint COVERDIR=test/coverage make RM= tests fi