Skip to content

Commit 1dc4d5e

Browse files
committed
chore(nat): change nim-nat-traversal for nim-libplum
1 parent de4cbb1 commit 1dc4d5e

27 files changed

Lines changed: 442 additions & 1303 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/i386_temp.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: temp i386
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
test:
15+
env:
16+
NIMBLE_COMMIT: 42ef70c2102a942c46f13eb76872326edd525cec # v0.22.3
17+
timeout-minutes: 120
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
nim:
22+
- ref: v2.2.10
23+
memory_management: orc
24+
25+
defaults:
26+
run:
27+
shell: bash
28+
29+
name: "linux-i386 test_gossipsub_message_handling"
30+
runs-on: ubuntu-22.04
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v6
34+
with:
35+
submodules: true
36+
37+
- name: Select Nimble version
38+
if: matrix.nim.nimble_commit != ''
39+
shell: bash
40+
run: echo "NIMBLE_COMMIT=${{ matrix.nim.nimble_commit }}" >> $GITHUB_ENV
41+
42+
- name: Setup Nim
43+
uses: "./.github/actions/install_nim"
44+
with:
45+
os: linux
46+
cpu: i386
47+
shell: bash
48+
nim_ref: ${{ matrix.nim.ref }}
49+
50+
- name: Restore deps from cache
51+
id: deps-cache
52+
uses: actions/cache@v5
53+
with:
54+
path: |
55+
nimbledeps
56+
tests/nimbledeps
57+
key: nimbledeps-linux-i386-gcc-${{ hashFiles('.pinned', 'tests/.pinned') }}
58+
59+
- name: Install deps
60+
if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }}
61+
run: |
62+
nimble install_pinned
63+
cd tests && nimble install_pinned
64+
65+
- name: Build prerequisites
66+
run: make nimble.paths tests/nimble.paths
67+
68+
- name: Compile test_gossipsub_message_handling
69+
id: compile-test
70+
run: |
71+
nim --version
72+
nimble --version
73+
gcc --version
74+
75+
nim c --styleCheck:usages --styleCheck:error --verbosity:0 --skipUserCfg --opt:speed --mm:orc --threads:on \
76+
-d:path=libp2p/pubsub/component/test_gossipsub_message_handling \
77+
tests/test_all.nim
78+
79+
- name: Run (1/5)
80+
run: ./tests/test_all --output-level=VERBOSE --console
81+
82+
- name: Run (2/5)
83+
run: ./tests/test_all --output-level=VERBOSE --console
84+
85+
- name: Run (3/5)
86+
run: ./tests/test_all --output-level=VERBOSE --console
87+
88+
- name: Run (4/5)
89+
run: ./tests/test_all --output-level=VERBOSE --console
90+
91+
- name: Run (5/5)
92+
run: ./tests/test_all --output-level=VERBOSE --console

.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@#e6688ea79ec34ec17012c155fd544f482fe71f44
1919
npeg;https://github.com/zevv/npeg@#409f6796d0e880b3f0222c964d1da7de6e450811

0 commit comments

Comments
 (0)