Skip to content

Commit ac17ed9

Browse files
committed
fix(Makefile): nwaku target as dependency
1 parent fc6e489 commit ac17ed9

File tree

2 files changed

+13
-24
lines changed

2 files changed

+13
-24
lines changed

Makefile

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,8 @@ BUILD_TAGS ?= gowaku_no_rln
9595

9696
ifeq ($(USE_NWAKU), true)
9797
BUILD_TAGS += use_nwaku
98-
ifndef NWAKU_SOURCE_DIR
99-
$(error NWAKU_SOURCE_DIR must be set when USE_NWAKU is true)
100-
endif
98+
NWAKU_VERSION ?= v0.37.0-rc.3
99+
NWAKU_SOURCE_DIR ?= $(GIT_ROOT)/../nwaku
101100
LIBWAKU := $(NWAKU_SOURCE_DIR)/build/libwaku.$(LIBWAKU_EXT)
102101
CGO_CFLAGS+=-I$(NWAKU_SOURCE_DIR)/library
103102
CGO_LDFLAGS+=-L$(NWAKU_SOURCE_DIR)/build -lwaku -Wl,-rpath,$(NWAKU_SOURCE_DIR)/build
@@ -183,7 +182,16 @@ $(GO_CMD_BUILDS): ##@build Build any Go project from cmd folder
183182
@echo "Compilation done."
184183
@echo "Run \"build/bin/$(notdir $@) -h\" to view available commands."
185184

186-
$(LIBWAKU):
185+
186+
$(NWAKU_SOURCE_DIR): ##@build Clone nwaku
187+
ifeq ($(USE_NWAKU),true)
188+
@echo "Cloning nwaku $(NWAKU_VERSION)..."
189+
git clone --branch $(NWAKU_VERSION) https://github.com/waku-org/nwaku.git $(NWAKU_SOURCE_DIR)
190+
endif
191+
192+
clone-nwaku: $(NWAKU_SOURCE_DIR)
193+
194+
$(LIBWAKU): clone-nwaku
187195
ifeq ($(USE_NWAKU),true)
188196
@echo "Building libwaku" $(LIBWAKU)
189197
$(MAKE) -C $(NWAKU_SOURCE_DIR) SHELL=/bin/bash
@@ -200,12 +208,6 @@ clean-libwaku:
200208

201209
rebuild-libwaku: | clean-libwaku $(LIBWAKU)
202210

203-
clone-nwaku: NWAKU_SOURCE_DIR ?= $(GIT_ROOT)/../nwaku
204-
clone-nwaku: NWAKU_VERSION ?= v0.37.0-rc.3
205-
clone-nwaku: ##@build Clone or checkout nwaku v0.37.0-rc.3 into ../nwaku
206-
@echo "Cloning nwaku $(NWAKU_VERSION)..."
207-
git clone --branch $(NWAKU_VERSION) https://github.com/waku-org/nwaku.git $(NWAKU_SOURCE_DIR)
208-
209211
statusgo: ##@build Build status-go as status-backend server
210212
statusgo: build/bin/status-backend
211213

_assets/ci/Jenkinsfile.nwaku

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pipeline {
6565
USE_NWAKU = "${params.USE_NWAKU}"
6666

6767
/* nwaku source directory */
68-
NWAKU_SOURCE_DIR = "${WORKSPACE}/../nwaku"
68+
NWAKU_SOURCE_DIR = "${WORKSPACE_TMP}/nwaku"
6969

7070
/* fixes nim cache collision */
7171
XDG_CACHE_HOME = "${env.WORKSPACE_TMP}/.cache"
@@ -79,8 +79,6 @@ pipeline {
7979
sh "mkdir -p \$(dirname ${REPO_SRC})"
8080
sh "ln -s ${WORKSPACE} ${REPO_SRC}"
8181
}
82-
// Clean up any existing nwaku directory
83-
sh "rm -rf ${NWAKU_SOURCE_DIR} || true"
8482
}
8583
}
8684
}
@@ -99,16 +97,6 @@ pipeline {
9997
}
10098
}
10199

102-
stage('Clone nwaku') {
103-
when {
104-
expression { params.USE_NWAKU == true }
105-
}
106-
steps { script {
107-
nix.develop('make clone-nwaku', pure: false)
108-
}
109-
}
110-
}
111-
112100
stage('Build Static Lib') {
113101
steps {
114102
script {
@@ -143,7 +131,6 @@ pipeline {
143131
success { script { github.notifyPR(true) } }
144132
failure { script { github.notifyPR(false) } }
145133
cleanup {
146-
sh "rm -rf ${env.NWAKU_SOURCE_DIR} || true"
147134
cleanWs()
148135
dir("${env.WORKSPACE}@tmp") { deleteDir() }
149136
}

0 commit comments

Comments
 (0)