chore: update accordings to rename

This commit is contained in:
darshankabariya 2025-12-20 01:52:47 +05:30
parent 02c9a6afa6
commit 20676f7d01
No known key found for this signature in database
GPG Key ID: 9A92CCD9899F0D22
2 changed files with 26 additions and 14 deletions

View File

@ -22,19 +22,22 @@ go get -u github.com/logos-messaging/logos-messaging-go-bindings
export CGO_LDFLAGS="-L${LMN_DIR}/build -lwaku -Wl,-rpath,${LMN_DIR}/build"
# compile all packages
go build ./waku
make -C waku build
# run all tests
go test ./waku
make -C waku test
# run a specific test
go test ./waku -count=1 -run TestConnectedPeersInfo -v
make -C waku test TEST=TestConnectedPeersInfo
```
2. **Automatic clone (default)** if `LMN_DIR` is **unset**, running
```bash
make -C waku build
make -C waku build-auto
make -C waku test-auto
make -C waku test-auto TEST=TestConnectedPeersInfo
```
will clone a shallow copy of `logos-messaging-nim` into `third_party/nwaku`, build `libwaku`, and compile the Go bindings. This is what CI uses.
> **Downstream projects**: When importing `logos-messaging-go-bindings` in another Go module you must ensure `LMN_DIR` is exported (or vendor `libwaku`) before running `go build`. Otherwise the CGO step will fail.

View File

@ -1,7 +1,7 @@
# Makefile for Waku Go Bindings
# Path to logos-messaging-nim (nwaku) submodule
LMN_DIR ?= $(shell pwd)/../vendor/logos-messaging-nim/
LMN_DIR ?= $(shell pwd)/../vendor/logos-messaging-nim
# Default paths for libwaku library and headers (can be overridden)
LIBWAKU_HEADER_PATH ?= $(LMN_DIR)/library
@ -14,7 +14,7 @@ export CGO_LDFLAGS := -L$(LIBWAKU_LIB_PATH)/ -lwaku -Wl,-rpath,$(LIBWAKU_LIB_PAT
HEADER_FILE := $(LIBWAKU_HEADER_PATH)/libwaku.h
LIB_FILES := $(wildcard $(LIBWAKU_LIB_PATH)/libwaku.*)
.PHONY: all clean prepare build build-auto build-manual test-auto test-manual build-libwaku
.PHONY: all clean prepare build test build-auto test-auto build-libwaku
# Validate necessary folders and files
check-folders:
@ -58,21 +58,30 @@ build-libwaku:
$(MAKE) -C $(LMN_DIR) libwaku; \
fi
build: build-libwaku check-folders
@echo "Building Waku Go Bindings (manual)..."
go build ./waku
test: build
@echo "Running tests (manual)..."
@if [ -z "$(TEST)" ]; then \
go test ./waku; \
else \
go test ./waku -count=1 -run $(TEST) -v; \
fi
build-auto: build-libwaku check-folders
@echo "Building Waku Go Bindings (auto)..."
go build ./
build-manual: build-libwaku check-folders
@echo "Building Waku Go Bindings (manual)..."
go build ./waku
test-auto: build-auto
@echo "Running tests (auto)..."
go test ./
@if [ -z "$(TEST)" ]; then \
go test ./...; \
else \
go test ./ -count=1 -run $(TEST) -v; \
fi
test-manual: build-manual
@echo "Running tests (manual)..."
go test ./waku
# Clean up generated files
clean: