Skip to content

Commit 4a678d7

Browse files
authored
Merge branch 'master' into fix(service-disco)-fix-ticket-time-window-validation
2 parents d0cf243 + 71b58b8 commit 4a678d7

26 files changed

Lines changed: 436 additions & 1377 deletions

.github/workflows/cbindings.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ jobs:
124124
cd cbind
125125
nimble install_pinned
126126
nimble setup
127-
make -C .. nat_libs
128127
nimble buildffi
129128
nimble genbindings_c
130129
nimble genbindings_cddl

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ jobs:
5252
cd tests && nimble install_pinned
5353
5454
- name: Build prerequisites
55-
run: make nimble.paths tests/nimble.paths nat_libs
55+
run: make nimble.paths tests/nimble.paths
5656

5757
- name: Build prerequisites
58-
run: make nimble.paths nat_libs
58+
run: make nimble.paths
5959

6060
- name: Restore build cache
6161
uses: actions/cache@v5

.github/workflows/daily_test_all_latest_deps.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ jobs:
192192
exit 1
193193
fi
194194
echo "=== Installing resolved newest dependencies ==="
195-
# nimbledeps/ switches nimble to local-dep mode so the Makefile's
196-
# nat_libs step finds nimbledeps/pkgs2/nat_traversal-*.
195+
# nimbledeps/ switches nimble to local-dep mode for the pinned build.
197196
rm -rf nimbledeps tests/nimbledeps
198197
mkdir nimbledeps
199198
echo "nimble install -y $DEPS"
@@ -203,7 +202,7 @@ jobs:
203202
(cd tests && nimble install -y $TEST_DEPS)
204203
205204
- name: Build prerequisites
206-
run: make nimble.paths tests/nimble.paths nat_libs
205+
run: make nimble.paths tests/nimble.paths
207206

208207
- name: Build test_all
209208
run: |

.github/workflows/daily_test_all_no_flags.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
cd tests && nimble install_pinned
5757
5858
- name: Build prerequisites
59-
run: make nimble.paths tests/nimble.paths nat_libs
59+
run: make nimble.paths tests/nimble.paths
6060

6161
- name: Build without feature flags
6262
run: |

.github/workflows/examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
nimble install_pinned
5656
5757
- name: Build prerequisites
58-
run: make nimble.paths nat_libs
58+
run: make nimble.paths
5959

6060
- name: Build and run examples
6161
run: |

.github/workflows/interop.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ jobs:
6868

6969
- name: Run Go and Nim together
7070
run: |
71+
nimble install_pinned
7172
nimble setup
7273
cd interop/autonatv2/go-peer
7374
go mod tidy
@@ -93,7 +94,8 @@ jobs:
9394

9495
- name: Run Nim and Rust together
9596
run: |
96-
nimble install
97+
nimble install_pinned
98+
nimble setup
9799
cd interop/kad/rust-peer
98100
cargo run &
99101
@@ -120,6 +122,7 @@ jobs:
120122
# the go peer runs in the background because the interop test logic is implemented in the nim peer.
121123
- name: Run Interop
122124
run: |
125+
nimble install_pinned
123126
nimble setup
124127
cd interop/partial-message
125128
nim c ./nim-peer/src/peer.nim

.github/workflows/test_all.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,10 @@ jobs:
111111
path: |
112112
nimbledeps
113113
tests/nimbledeps
114-
# Scope by os/cpu/cc: nimbledeps contains pre-built .a files for
115-
# nim-nat-traversal's vendored miniupnpc/libnatpmp, rebuilt by
116-
# `make nat_libs` against the host toolchain. Sharing the cache
117-
# across mismatched toolchains (linux<->windows, gcc<->clang)
118-
# produced broken artifacts last time. Keep this key in sync
119-
# with the other workflows that cache nimbledeps so cache
120-
# entries are reusable across them.
114+
# Scope by os/cpu/cc so cache entries can't leak vendored/compiled
115+
# artifacts across mismatched toolchains (linux<->windows,
116+
# gcc<->clang). Keep this key in sync with the other workflows that
117+
# cache nimbledeps so cache entries are reusable across them.
121118
key: nimbledeps-${{ matrix.platform.os }}-${{ matrix.platform.cpu }}-${{ matrix.platform.cc }}-${{ hashFiles('.pinned', 'tests/.pinned') }}
122119

123120
- name: Restore llvm-mingw (Windows) from cache
@@ -169,7 +166,7 @@ jobs:
169166
cd tests && nimble install_pinned
170167
171168
- name: Build prerequisites
172-
run: make nimble.paths tests/nimble.paths nat_libs
169+
run: make nimble.paths tests/nimble.paths
173170

174171
- name: Restore build cache
175172
id: nimcache-restore

.github/workflows/test_multiformat_exts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ jobs:
127127
cd tests && nimble install_pinned
128128
129129
- name: Build prerequisites
130-
run: make nimble.paths tests/nimble.paths nat_libs
130+
run: make nimble.paths tests/nimble.paths
131131

132132
- name: Build test_multiformat_exts
133133
id: build-test

.pinned

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ stew;https://github.com/status-im/nim-stew@#b66168735d6f3841c5239c3169d3fe5fe98b
1515
websock;https://github.com/status-im/nim-websock@#387a8eb7e961e8fdd3b1a717d36bc53b55e4dc5d
1616
zlib;https://github.com/status-im/nim-zlib@#e680f269fb01af2c34a2ba879ff281795a5258fe
1717
protobuf_serialization;https://github.com/status-im/nim-protobuf-serialization@#8406e7287196661614ce6a8e8be20f755376af7f
18-
nat_traversal;https://github.com/status-im/nim-nat-traversal@#860e18c37667b5dd005b94c63264560c35d88004
18+
libplum;https://github.com/logos-storage/nim-libplum@#acefbe424cf9d1f05f2d93533790c9ac4e034df8
1919
npeg;https://github.com/zevv/npeg@#409f6796d0e880b3f0222c964d1da7de6e450811

Makefile

Lines changed: 7 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.PHONY: all build deps cbind clean test \
22
test_multiformat_exts test_integration \
3-
install_pinned pin unpin gen_multicodec format clean-nim nat_libs nat_pkg_dir_check
3+
install_pinned pin unpin gen_multicodec format clean-nim
44

55
NIM_VERSION ?= 2.2.10
66
NPH_VERSION ?= 0.7.0
@@ -102,56 +102,11 @@ tests/nimble.paths: $(wildcard tests/nimbledeps/pkgs2/*/*.nimble) $(wildcard tes
102102
done; \
103103
done
104104

105-
# nim-nat-traversal vendors miniupnpc and libnatpmp as C sources. The package's
106-
# `before install` hook builds them, but the resulting .a files are not always
107-
# preserved alongside the package dir (cross-OS cache reuse, different gcc
108-
# versions). Rebuild them up-front against the host's toolchain.
109-
NAT_PKG_DIR := $(firstword $(wildcard nimbledeps/pkgs2/nat_traversal-*) $(wildcard nimbledeps/pkgs/nat_traversal-*))
110-
NAT_PMP_LIB := $(NAT_PKG_DIR)/vendor/libnatpmp-upstream/libnatpmp.a
111-
112-
# Use gcc rather than `cc` so the linux-i386 wrapper (external/bin/gcc, which
113-
# injects -m32) is picked up. On macOS and llvm-mingw, `gcc` is a clang
114-
# compatibility shim, so this stays ABI-compatible with nim's choice.
115-
NAT_CC ?= gcc
116-
117-
# miniupnpc's unix Makefile drops the .a under `build/`, but its Windows
118-
# Makefile.mingw drops it at the package root. Match each one.
119-
ifeq ($(OS),Windows_NT)
120-
NAT_UPNP_LIB := $(NAT_PKG_DIR)/vendor/miniupnp/miniupnpc/libminiupnpc.a
121-
NAT_UPNP_MAKE_ARGS := -f Makefile.mingw CC=$(NAT_CC) libminiupnpc.a
122-
NAT_PMP_CFLAGS := -Wall -Os -fPIC -DENABLE_STRNATPMPERR -DNATPMP_MAX_RETRIES=4 -DWIN32 -DNATPMP_STATICLIB
123-
# libnatpmp's Makefile only appends wingettimeofday.o to LIBOBJS when $(OS)
124-
# contains mingw/cygwin/msys. The CI Windows runner passes through Windows_NT
125-
# (the host env var), so that branch never matches — leaving
126-
# natpmp_gettimeofday undefined at link time. Pass LIBOBJS explicitly.
127-
NAT_PMP_MAKE_ARGS := LIBOBJS="natpmp.o getgateway.o wingettimeofday.o" libnatpmp.a
128-
else
129-
NAT_UPNP_LIB := $(NAT_PKG_DIR)/vendor/miniupnp/miniupnpc/build/libminiupnpc.a
130-
NAT_UPNP_MAKE_ARGS := CC=$(NAT_CC) CFLAGS="-Os -fPIC" build/libminiupnpc.a
131-
NAT_PMP_CFLAGS := -Wall -Os -fPIC -DENABLE_STRNATPMPERR -DNATPMP_MAX_RETRIES=4
132-
NAT_PMP_MAKE_ARGS := libnatpmp.a
133-
endif
134-
135-
# Stamp-based rebuild: the stamp records "the .a files in this package dir were
136-
# built by our recipe with the right compiler". Re-running install_pinned wipes
137-
# the package dir (and thus the stamp), forcing a rebuild.
138-
NAT_LIBS_STAMP := $(NAT_PKG_DIR)/.libp2p-nat-libs.stamp
139-
140-
nat_libs: $(NAT_LIBS_STAMP)
141-
142-
nat_pkg_dir_check:
143-
@test -n "$(NAT_PKG_DIR)" || \
144-
(echo "Error: nat_traversal package not found under nimbledeps/pkgs2/ or nimbledeps/pkgs/. Run 'nimble install_pinned' first." && exit 1)
145-
146-
$(NAT_LIBS_STAMP): | nat_pkg_dir_check
147-
rm -f "$(NAT_UPNP_LIB)" "$(NAT_PMP_LIB)"
148-
-$(MAKE) -C "$(NAT_PKG_DIR)/vendor/miniupnp/miniupnpc" clean
149-
-$(MAKE) -C "$(NAT_PKG_DIR)/vendor/libnatpmp-upstream" clean
150-
$(MAKE) -C "$(NAT_PKG_DIR)/vendor/miniupnp/miniupnpc" $(NAT_UPNP_MAKE_ARGS)
151-
$(MAKE) -C "$(NAT_PKG_DIR)/vendor/libnatpmp-upstream" CC=$(NAT_CC) CFLAGS="$(NAT_PMP_CFLAGS)" $(NAT_PMP_MAKE_ARGS)
152-
touch "$@"
105+
# nim-libplum vendors libplum (PCP / NAT-PMP / UPnP-IGD) as a git submodule and
106+
# compiles its C sources into libp2p via nim's {.compile.} pragmas, so there is
107+
# no separate NAT library to build or link here.
153108

154-
test: nimble.paths tests/nimble.paths nat_libs
109+
test: nimble.paths tests/nimble.paths
155110
ifeq ($(TEST_PATH),)
156111
$(NIMC) c $(NIM_FLAGS) \
157112
$(if $(CICOV),--nimcache:nimcache/test_all,) \
@@ -166,7 +121,7 @@ else
166121
./tests/test_all $(RUNNER_FLAGS) --xml:tests/results_test_all.xml
167122
endif
168123

169-
test_multiformat_exts: nimble.paths tests/nimble.paths nat_libs
124+
test_multiformat_exts: nimble.paths tests/nimble.paths
170125
$(NIMC) c $(NIM_FLAGS) \
171126
--nimcache:nimcache/test_all_multiformat \
172127
-d:libp2p_multicodec_exts=../tests/libp2p/multiformat_exts/multicodec_exts.nim \
@@ -178,7 +133,7 @@ test_multiformat_exts: nimble.paths tests/nimble.paths nat_libs
178133
tests/test_all.nim
179134
./tests/test_all $(RUNNER_FLAGS) --xml:tests/results_test_all_multiformat.xml
180135

181-
test_integration: nimble.paths tests/nimble.paths nat_libs
136+
test_integration: nimble.paths tests/nimble.paths
182137
$(NIMC) c $(NIM_FLAGS) \
183138
$(if $(CICOV),--nimcache:nimcache/integration,) \
184139
tests/integration/test_all.nim

0 commit comments

Comments
 (0)