Skip to content

Commit 2b0e3a4

Browse files
committed
Add warning about version matching to book
1 parent f9d547b commit 2b0e3a4

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

book/src/build/bazel.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ $ cxxbridge src/bridge.rs --header > path/to/bridge.rs.h
1515
$ cxxbridge src/bridge.rs > path/to/bridge.rs.cc
1616
```
1717

18+
<div class="warning">
19+
20+
**Important:** The version number of `cxxbridge-cmd` used for the C++ side of
21+
the binding must always be identical to the version number of `cxx` used for the
22+
Rust side. You must use some form of lockfile or version pinning to ensure that
23+
this is the case.
24+
25+
</div>
26+
1827
The CXX repo maintains working [Bazel] `BUILD.bazel` and [Buck2] `BUCK` targets
1928
for the complete blobstore tutorial (chapter 3) for your reference, tested in
2029
CI. These aren't meant to be directly what you use in your codebase, but serve

book/src/build/other.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ But the C++ side of the bindings needs to be generated. Your options are:
3636
- Or, build your own code generator frontend on top of the [cxx-gen] crate. This
3737
is currently unofficial and unsupported.
3838

39+
<div class="warning">
40+
41+
**Important:** The Rust side and C++ side of a binding must always be created
42+
using the same release of CXX. If using `cxxbridge-cmd` for the C++ side, the
43+
version number of `cxxbridge-cmd` must be identical to the version number of
44+
`cxx` used for the Rust side. If using `cxx-gen` for the C++ side, its patch
45+
number must be identical to the patch number of `cxx`.
46+
47+
</div>
48+
3949
[cxx-gen]: https://docs.rs/cxx-gen
4050

4151
### Compiling C++

0 commit comments

Comments
 (0)