• Home
  • Raw
  • Download

Lines Matching +full:rust +full:- +full:version

5 [#rust on chat.mozilla.org](https://chat.mozilla.org/#/room/#rust:mozilla.org)
8 <!-- START doctoc generated TOC please keep comment here to allow auto update -->
9 <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
11 - [Code of Conduct](#code-of-conduct)
12 - [Filing an Issue](#filing-an-issue)
13 - [Looking to Start Contributing to `bindgen`?](#looking-to-start-contributing-to-bindgen)
14 - [Building](#building)
15 - [Testing](#testing)
16 - [Overview](#overview)
17 - [Testing Bindings Generation](#testing-bindings-generation)
18 - [Testing Generated Bindings](#testing-generated-bindings)
19- [Testing a Single Header's Bindings Generation and Compiling its Bindings](#testing-a-single-hea…
20 - [Authoring New Tests](#authoring-new-tests)
21 - [Test Expectations and `libclang` Versions](#test-expectations-and-libclang-versions)
22 - [Integration Tests](#integration-tests)
23 - [Fuzzing `bindgen` with `csmith`](#fuzzing-bindgen-with-csmith)
24- [Property tests for `bindgen` with `quickchecking`](#property-tests-for-bindgen-with-quickchecki…
25 - [Code Overview](#code-overview)
26 - [Implementing new options using `syn`](#implementing-new-options-using-syn)
27 - [Pull Requests and Code Reviews](#pull-requests-and-code-reviews)
28 - [Generating Graphviz Dot Files](#generating-graphviz-dot-files)
29 - [Debug Logging](#debug-logging)
30 - [Using `creduce` to Minimize Test Cases](#using-creduce-to-minimize-test-cases)
31 - [Getting `creduce`](#getting-creduce)
32 - [Isolating Your Test Case](#isolating-your-test-case)
33 - [Writing a Predicate Script](#writing-a-predicate-script)
34 - [Cutting a new bindgen release](#cutting-a-new-bindgen-release)
35 - [Updating the changelog](#updating-the-changelog)
36 - [Bumping the version numbers.](#bumping-the-version-numbers)
37 - [Merge to `main`](#merge-to-main)
38- [Publish and add a git tag for the right commit](#publish-and-add-a-git-tag-for-the-right-commit)
40 <!-- END doctoc generated TOC please keep comment here to allow auto update -->
44 We abide by the [Rust Code of Conduct][coc] and ask that you do as well.
46 [coc]: https://www.rust-lang.org/en-US/conduct.html
61 * [Issues labeled "easy"](https://github.com/rust-lang/rust-bindgen/issues?q=is%3Aopen+is%3Aissue+l…
62 …s labeled "less easy"](https://github.com/rust-lang/rust-bindgen/issues?q=is%3Aopen+is%3Aissue+lab…
63 * [Issues labeled "help wanted"](https://github.com/rust-lang/rust-bindgen/labels/help%20wanted)
64 * Still can't find something to work on? [Drop a comment here](https://github.com/rust-lang/rust-bi…
75 latest version of libclang. In that case, you may want to either uninstall other
79 $ export LIBCLANG_PATH=path/to/clang-9.0/lib
87 $ cargo build --features testing_only_docs
94 Input C/C++ test headers reside in the `bindgen-tests/tests/headers` directory. Expected
95 output Rust bindings live in `bindgen-tests/tests/expectations/tests`. For example,
96 `bindgen-tests/tests/headers/my_header.h`'s expected generated Rust bindings would be
97 `bindgen-tests/tests/expectations/tests/my_header.rs`.
99 There are also some integration tests in the `./bindgen-integration` crate, which uses `bindgen` to
101 values are what we expect them to be, both on the Rust and C++ side.
108 $ rustup component add rustfmt --toolchain nightly
117 To regenerate bindings from the corpus of test headers in `bindgen-tests/tests/headers` and
118 compare them against the expected bindings in `bindgen-tests/tests/expectations/tests`, run:
141 `BINDGEN_DISABLE_ROUNDTRIP_TEST` to avoid a lot of tests for round-tripping of
147 `bindgen-tests/tests/expectations/tests/*` bindings files, then you should test that the
154 $ cd bindgen-tests/tests/expectations
161 is a dependency for running `test-one.sh`.
165 tests). This can be done with the `bindgen-tests/tests/test-one.sh` script. It supports fuzzy
170 $ ./bindgen-tests/tests/test-one.sh going
173 Note that `test-one.sh` does not recompile `bindgen`, so if you change the code,
178 To add a new test header to the suite, simply put it in the `bindgen-tests/tests/headers`
179 directory. Next, run `bindgen` to generate the initial expected output Rust
180 bindings. Put those in `bindgen-tests/tests/expectations/tests`.
188 // bindgen-flags: --enable-cxx-namespaces -- -std=c++14
191 Then verify the new Rust bindings compile and pass their layout tests:
194 $ cd bindgen-tests/tests/expectations
203 version. Instead of having a single `bindgen-tests/tests/expectations/tests/my_test.rs` file,
206 * `bindgen-tests/tests/expectations/tests/libclang-9/my_test.rs`
207 * `bindgen-tests/tests/expectations/tests/libclang-5/my_test.rs`
211 many version of `libclang` installed locally. Just make a work-in-progress pull
216 Usually, `bindgen`'s test runner can infer which version of `libclang` you
217 have. If for some reason it can't, you can force a specific `libclang` version
221 $ cargo test --features testing_only_libclang_$VERSION
224 Where `$VERSION` is one of:
230 depending on which version of `libclang` you have installed.
234 The `./bindgen-integration` crate uses `bindgen` to
236 values are what we expect them to be, both on the Rust and C++ side.
241 $ cd bindgen-integration
251 See [./csmith-fuzzing/README.md](./csmith-fuzzing/README.md) for details.
263 `bindgen` takes C and C++ header files as input and generates corresponding Rust
267 Rust-y wrappers over the raw C `libclang` API that the `clang-sys` crate
279 * A `Module`, which is originally a C++ namespace and becomes a Rust
311 The IR forms a graph of interconnected and inter-referencing types and
321 `src/ir/analysis/*`. They are implemented as fixed-point algorithms, using the
324 The final phase is generating Rust source text from the analyzed IR, and it is
326 { ... }` macro for quasi-quoting Rust forms. Some options that affect the
327 generated Rust code are implemented using the [`syn`](https://docs.rs/syn) crate.
334 - Introduce a new field to `BindgenOptions` for the option.
335 - Write a free function inside `codegen::postprocessing` implementing the
337 - Add a new value to the `codegen::postprocessing::PASSES` for the option using
358 * [Servo's GitHub Workflow](https://github.com/servo/servo/wiki/Github-workflow)
359 …sing and Squashing](https://github.com/servo/servo/wiki/Beginner's-guide-to-rebasing-and-squashing)
376 Then, use the `--emit-ir-graphviz` flag to generate a `dot` file from our IR:
379 $ cargo run -- example.hpp --emit-ir-graphviz output.dot
385 $ dot -Tpng output.dot -o output.png
390 [![An example graphviz rendering of our IR](./example-graphviz-ir.png)](./example-graphviz-ir.png)
427 Otherwise, follow [these instructions](https://github.com/csmith-project/creduce/blob/main/INSTALL.…
438 $ creduce ./predicate.sh ./isolated-test-case.h
443 `--dump-preprocessed-input` flag.
445 If you're using `bindgen` as a Rust library, invoke the
465 set -eu
470 # You'll need to replace `--whatever-flags` with things that are specific to the
472 path/to/rust-bindgen/csmith-fuzzing/predicate.py \
473 --whatever-flags \
474 ./isolated-test-case.h
481 path/to/rust-bindgen/csmith-fuzzing/predicate.py \
482 --expect-bindgen-fail \
483 --bindgen-grep "thread main panicked at '<insert panic message here>'" \
484 ./isolated-test-case.h
492 path/to/rust-bindgen/csmith-fuzzing/predicate.py \
493 --bindings-grep NameOfTheStructThatIsErroneouslyDerivingEq \
494 --expect-compile-fail \
495 --rustc-grep 'error[E0277]: the trait bound `f64: std::cmp::Eq` is not satisfied' \
496 ./isolated-test-case.h
503 path/to/rust-bindgen/csmith-fuzzing/predicate.py \
504 --bindings-grep MyStruct \
505 --expect-layout-tests-fail \
506 --layout-tests-grep "thread 'bindgen_test_layout_MyStruct' panicked" \
507 ./isolated-test-case.h
513 $ path/to/rust-bindgen/csmith-fuzzing/predicate.py --help
517 (Although, maybe we should add extra functionality to `predicate.py` -- file an
537 $ git log --oneline v0.62.0..HEAD
540 Also worth checking the [next-release tag](https://github.com/rust-lang/rust-bindgen/pulls?q=is%3Ap…
542 Once that's done and the changelog is up-to-date, run `doctoc` on it.
551 ### Bumping the version numbers.
553 Bump version numbers as needed. Run tests just to ensure everything is working
559 publishing. For dot-releases of an old version (e.g., cherry-picking an
567 $ git tag -a v0.62.1 # With the right version of course
569 $ pushd bindgen-cli && cargo publish && popd
570 $ git push --tags upstream # To publish the tag