Commit 28cbe87
nng-sys: upgrade to NNG 2.0.0-alpha.6 (#34)
* nng-sys: upgrade to NNG 2.0.0-alpha.6
BREAKING CHANGES:
- nng_init() must be called before using any NNG functions
- nng_close() renamed to nng_socket_close()
- nng_send_aio()/nng_recv_aio() renamed to nng_socket_send()/nng_socket_recv()
- Many functions now return nng_err enum instead of c_int
- ZeroTier transport removed (NNG_AF_ZT, nng_sockaddr_zt, nng_zt_*)
- nanomsg compatibility layer removed (compat feature and headers)
- NNG_FLAG_ALLOC removed
- Many option getter/setter functions removed or renamed
- TLS must now be configured via nng_tls_config_* functions
- URL structure is now opaque with accessor functions
For the complete migration guide, see:
https://github.com/nanomsg/nng/blob/master/docs/ref/migrate/nng1.md
Changes:
- Bump nng-sys version to 0.4.0+v2.0.0-alpha.6
- Bump nng-sys/nng submodule to v2.0.0-alpha.6
- Regenerate bindings for NNG 2.0 API
- Simplify wrapper.h (now just nng.h and http.h)
- Remove compat.h and supplemental.h
- Update build.rs: remove compat feature handling, bump pkg-config to 2.0.0
- Add NNG_AF_ABSTRACT to nng_sockaddr_family conversion
- Update README with NNG 2.0 warning, migration guide, and fixed examples
- Update tests for NNG 2.0 API (nng_init, nng_socket_close, nng_err)
Note: The `links = "nng"` attribute is temporarily commented out because
anng and nng crates still depend on nng-sys 0.3.0 from crates.io.
* Update CI to build NNG 2.0 from submodule for non-vendored tests
- Build NNG from nng-sys/nng submodule instead of Debian packages (v1.x)
- Update linux-sys 'system + bindgen' job to build NNG from source
- Update linux-nng job to build NNG from source
- Update macOS jobs to build NNG from submodule (consolidate to 2 configs)
- Remove compat and supplemental test jobs (features don't exist in NNG 2.0)
* Fix Windows MSVC build: always enable stats
WORKAROUND: MSVC doesn't allow empty structs in C (error C2016), and
NNG has a bug where nng/src/core/stats.h defines an empty nni_stat_item
struct when NNG_ENABLE_STATS is OFF.
Until this is fixed upstream, we must always enable stats when building
with MSVC to avoid the empty struct compilation error.
* Fix macOS CI: add library search path for /usr/local/lib
On macOS, /usr/local/lib is not in the default library search path.
When we install NNG to /usr/local, the linker can't find libnng
unless we explicitly tell Rust where to look.
Add RUSTFLAGS=-L native=/usr/local/lib to the macOS system nng job.
* Refactor CI: extract NNG build script
Create .github/scripts/build-nng.sh to handle OS-specific NNG build
from the submodule. This reduces duplication between Linux and macOS
jobs - the script auto-detects the OS and handles:
- Install prefix (/usr on Linux, /usr/local on macOS)
- Parallel job count (nproc vs sysctl -n hw.ncpu)
- ldconfig on Linux only
* rename install script
* ci: build NNG from source in feature-powerset check
Replace apt-installed libnng1/libnng-dev packages with building NNG from
the nng-sys/nng submodule. This ensures the hack job tests against the
exact NNG version tracked in the repository when checking all feature
combinations.
* fix comment
* extend link comment
* add comment wht nng v1 is used for testing the nng crate
* ci: run cargo hack per-package to handle NNG v1/v2 split
nng-sys v0.4 targets NNG v2, while nng and anng still depend on
nng-sys v0.3 (NNG v1). Running feature-powerset on the entire
workspace fails since these packages require incompatible NNG versions.
This workaround runs cargo hack on each package individually:
- nng-sys: Install NNG v2 from submodule, set NNG_DIR=/usr
- nng/anng: Use vendored NNG v1 (builds from source, no NNG_DIR needed)
* remove dbg!
* improve version parsing
* add link to upstream issue
* add TODO for path dependencies
* fix manifest formatting
* rename build_nng to install_nng and remove false cases
* remove "from submodule" comments
* add CFLAGS
* improve TODO comment for removing install_nng flag and action
* remove support for abstract sockets from socket familiy conversion
* update version of nng-sys to 0.4.0-v2pre.1+v2.0.0-alpha.6
* update tls link
* revert version example
* remove migration notes and just reference the release notes and the migration guide
* remove invalid comment
* fix readme
* revert version change
* add a bold warning about the use of alpha nng v2
* fix version in readme
* add CFLAGS and RUSTFLAGS to v2 cargo hack run
---------
Co-authored-by: Felix Obenhuber <felix.obenhuber@helsing.ai>1 parent c399535 commit 28cbe87
File tree
16 files changed
+1010
-1278
lines changed- .github
- scripts
- workflows
- anng
- nng-sys
- src
- tests
- nng
16 files changed
+1010
-1278
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
23 | 30 | | |
24 | 31 | | |
25 | 32 | | |
| |||
48 | 55 | | |
49 | 56 | | |
50 | 57 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | 58 | | |
63 | 59 | | |
64 | 60 | | |
65 | 61 | | |
66 | 62 | | |
67 | 63 | | |
68 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
| |||
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
| 125 | + | |
125 | 126 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
132 | 131 | | |
133 | 132 | | |
134 | 133 | | |
| |||
140 | 139 | | |
141 | 140 | | |
142 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
124 | 135 | | |
125 | 136 | | |
126 | | - | |
127 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
128 | 152 | | |
129 | 153 | | |
130 | 154 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
19 | 30 | | |
20 | 31 | | |
21 | 32 | | |
| |||
46 | 57 | | |
47 | 58 | | |
48 | 59 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
15 | | - | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
22 | | - | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | | - | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
| |||
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
85 | | - | |
| 89 | + | |
86 | 90 | | |
87 | 91 | | |
88 | 92 | | |
| |||
92 | 96 | | |
93 | 97 | | |
94 | 98 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
| |||
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
120 | 122 | | |
121 | 123 | | |
122 | 124 | | |
| |||
147 | 149 | | |
148 | 150 | | |
149 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
150 | 155 | | |
151 | 156 | | |
152 | 157 | | |
| |||
178 | 183 | | |
179 | 184 | | |
180 | 185 | | |
181 | | - | |
182 | | - | |
| 186 | + | |
| 187 | + | |
183 | 188 | | |
184 | 189 | | |
185 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
0 commit comments