From 8e1d43fe3d21843fb4123f83625d1864c2f860b8 Mon Sep 17 00:00:00 2001 From: "Matt T. Proud" Date: Sun, 12 Aug 2012 19:38:40 +0200 Subject: [PATCH] Make must test Go by default, not rebuild world. ``lib/go/Makefile.am`` made erroneous assumptions that it should forcibly rebuild all of thrift4go dependencies. This seemed like a good idea at the time for sanity checking reasons, but it requires in reality extra permissions, which the user building thrift4go may not have. The same rationale applies for why the make rules ought to build and test Go instead of installing them by default. --- lib/go/Makefile.am | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/go/Makefile.am b/lib/go/Makefile.am index 66cc5a6..0b44c99 100644 --- a/lib/go/Makefile.am +++ b/lib/go/Makefile.am @@ -17,19 +17,12 @@ # under the License. # -# N.B.(matttproud): The flag assumptions of this makefile could be improved to -# potentially be more cross-platform compatible. For -# instance, I think the »-t« flag for »cp« may be invalid on -# BSD and Darwin systems. - -all: install - +all: test export GOPATH = $(PWD) SOURCE = $(GOPATH)/{pkg,src} DESTINATION = $(DESTDIR)/$(GOROOT) - clean-local: go clean thrift @@ -37,13 +30,21 @@ nuke-local: go clean -i -r -x thrift $(RM) -rf bin pkg +# N.B.(matttproud): This step may fail to run with sudo due to sudo clearing +# environment variables before changing permissions for +# security reasons. This can be avoided by using the +# DESTDIR construct described above to provide emissions to +# an intermediate directory for subsequent manual merging. + install-exec-local: test - go install -a -v -x thrift - mkdir -vp "$(DESTINATION)" - cp -av $(SOURCE) -t "$(DESTINATION)" + go install -v -x thrift + install -d "$(GOPATH)/pkg" + install -d "$(GOPATH)/src" + cp -av "$(GOPATH)/pkg/" "$(DESTINATION)/pkg/" + cp -av "$(GOPATH)/src/" "$(DESTINATION)/src/" test: check - go test -a -v -x thrift + go test -v -x thrift check-local: - go build -a -v -x thrift + go build -v -x thrift