Skip to content

Commit

Permalink
[MAKEFILE] Properly label build/docker artifacts as .SECONDARY
Browse files Browse the repository at this point in the history
Some objects such as build/docker/bin/peer end up being classified
as .INTERMEDIATE objects because of the way we use wildcarding.  The
side effect is that these artifacts may be implicitly deleted in
many/most circumstances, the result of which is that they then
need to be recompiled _every_ time rather than taking advantage
of build-caching.  We can fix this by marking them explicitly
as .SECONDARY artifacts

Fixes FAB-243

Change-Id: If45b0f5c7863d26a061831373187895069573fbb
Signed-off-by: Greg Haskins <gregory.haskins@gmail.com>
  • Loading branch information
ghaskins committed Aug 24, 2016
1 parent 3832045 commit 1e7030a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ build/bin/chaintool: Makefile
@mkdir -p $(@D)
@cp $^ $@

# JIRA FAB-243 - Mark build/docker/bin artifacts explicitly as secondary
# since they are never referred to directly. This prevents
# the makefile from deleting them inadvertently.
.SECONDARY: build/docker/bin/peer build/docker/bin/membersrvc

# We (re)build a package within a docker context but persist the $GOPATH/pkg
# directory so that subsequent builds are faster
build/docker/bin/%: build/image/src/.dummy $(PROJECT_FILES)
Expand All @@ -133,6 +138,7 @@ build/docker/bin/%: build/image/src/.dummy $(PROJECT_FILES)
-v $(abspath build/docker/bin):/opt/gopath/bin \
-v $(abspath build/docker/pkg):/opt/gopath/pkg \
hyperledger/fabric-src go install github.com/hyperledger/fabric/$(TARGET)
@touch $@

build/bin:
mkdir -p $@
Expand Down

0 comments on commit 1e7030a

Please sign in to comment.