Browse code

Merge pull request #19071 from icecrime/incremental_builds

Enable incremental builds

Brian Goff authored on 2016/01/28 01:21:01
Showing 1 changed files
... ...
@@ -151,8 +151,17 @@ LDFLAGS_STATIC=''
151 151
 EXTLDFLAGS_STATIC='-static'
152 152
 # ORIG_BUILDFLAGS is necessary for the cross target which cannot always build
153 153
 # with options like -race.
154
-ORIG_BUILDFLAGS=( -a -tags "autogen netgo static_build sqlite_omit_load_extension $DOCKER_BUILDTAGS" -installsuffix netgo )
154
+ORIG_BUILDFLAGS=( -tags "autogen netgo static_build sqlite_omit_load_extension $DOCKER_BUILDTAGS" -installsuffix netgo )
155 155
 # see https://github.com/golang/go/issues/9369#issuecomment-69864440 for why -installsuffix is necessary here
156
+
157
+# When $DOCKER_INCREMENTAL_BINARY is set in the environment, enable incremental
158
+# builds by installing dependent packages to the GOPATH.
159
+REBUILD_FLAG="-a"
160
+if [ "$DOCKER_INCREMENTAL_BINARY" ]; then
161
+	REBUILD_FLAG="-i"
162
+fi
163
+ORIG_BUILDFLAGS+=( $REBUILD_FLAG )
164
+
156 165
 BUILDFLAGS=( $BUILDFLAGS "${ORIG_BUILDFLAGS[@]}" )
157 166
 # Test timeout.
158 167