Skip to content
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ $(GO_CMD_BUILDS): ##@build Build any Go project from cmd folder

LIBWAKU := $(CURDIR)/vendor/github.com/waku-org/waku-go-bindings/third_party/nwaku/build/libwaku.$(LIBWAKU_EXT)
$(LIBWAKU):
ifeq ($(USE_NWAKU),true)
ifeq (true,true)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will be reverted once we want to merge the PR

once we start using nwaku as a default we will need to remove the if condition

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ivansete-status : you can start here, this flag is available in CI

shell('USE_NWAKU=true make statusgo-shared-library')

@echo "Building libwaku"
$(MAKE) -C $(CURDIR)/vendor/github.com/waku-org/waku-go-bindings/waku SHELL=/bin/bash
endif
Expand Down Expand Up @@ -214,7 +214,7 @@ statusgo-ios: ##@cross-compile Build status-go for iOS
@echo "iOS framework cross compilation done in build/bin/Statusgo.xcframework"

statusgo-library: generate
statusgo-library: $(LIBWAKU) ##@cross-compile Build status-go as static library for current platform
statusgo-library: ##@cross-compile Build status-go as static library for current platform
## cmd/library/README.md explains the magic incantation behind this
mkdir -p build/bin/statusgo-lib
go run cmd/library/*.go > build/bin/statusgo-lib/main.go
Expand All @@ -231,7 +231,7 @@ statusgo-library: $(LIBWAKU) ##@cross-compile Build status-go as static library
build-libwaku: $(LIBWAKU)

statusgo-shared-library: generate
statusgo-shared-library: $(LIBWAKU) ##@cross-compile Build status-go as shared library for current platform
statusgo-shared-library: ##@cross-compile Build status-go as shared library for current platform
## cmd/library/README.md explains the magic incantation behind this
mkdir -p build/bin/statusgo-lib
go run cmd/library/*.go > build/bin/statusgo-lib/main.go
Expand Down Expand Up @@ -282,6 +282,7 @@ generate: export GO_GENERATE_FAST_DEBUG ?= false
generate: export GO_GENERATE_FAST_RECACHE ?= false
generate: ##@ Run generate for all given packages using go-generate-fast, fallback to `go generate` (e.g. for docker)
@GOROOT=$$(go env GOROOT) $(GO_GENERATE_CMD) $(PACKAGES)
generate: $(LIBWAKU)

generate-contracts:
go generate ./contracts
Expand Down
2 changes: 2 additions & 0 deletions _assets/scripts/run_unit_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
source "${GIT_ROOT}/_assets/scripts/colors.sh"
source "${GIT_ROOT}/_assets/scripts/codecov.sh"

export LD_LIBRARY_PATH="${GIT_ROOT}/vendor/github.com/waku-org/waku-go-bindings/third_party/nwaku/build:${LD_LIBRARY_PATH}"

if [[ $UNIT_TEST_RERUN_FAILS == 'true' ]]; then
GOTESTSUM_EXTRAFLAGS="${GOTESTSUM_EXTRAFLAGS} --rerun-fails"
elif [[ $UNIT_TEST_FAILFAST == 'true' ]]; then
Expand Down
1 change: 0 additions & 1 deletion protocol/messenger_base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ func (s *MessengerBaseTestSuite) setupMessaging() {
var err error
s.messagingEnv, err = messaging.NewTestMessagingEnvironment()
s.Require().NoError(err)
s.Require().NoError(s.messagingEnv.Setup())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing this because it just started the node, and the node gets already started in NewTestMessagingEnvironment

starting the node twice was giving issues. nwaku has to protect agains it but in any case, it's a bug to attempt to do it

}

func (s *MessengerBaseTestSuite) SetupTest() {
Expand Down
4 changes: 2 additions & 2 deletions wakuv2/gowaku.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !use_nwaku
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in order to run the CI and test, I changed the default to be nwaku instead of go-waku. That's the changes in the tags in most of the files in this PR.

Once the PR is ready to merge, we should rever this changes in keep go-waku as the default. Probably add a CI job running everything for nwaku

// +build !use_nwaku
//go:build use_gowaku
// +build use_gowaku

// Copyright 2019 The Waku Library Authors.
//
Expand Down
3 changes: 3 additions & 0 deletions wakuv2/gowaku_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build use_gowaku
// +build use_gowaku

package wakuv2

import (
Expand Down
7 changes: 3 additions & 4 deletions wakuv2/nwaku.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build use_nwaku
// +build use_nwaku

package wakuv2

import "C"
Expand Down Expand Up @@ -1067,7 +1064,9 @@ func (w *Waku) Stop() error {
}
}

close(w.goingOnline)
if w.goingOnline != nil {
close(w.goingOnline)
}

w.wg.Wait()

Expand Down
Loading