Skip to content

Commit

Permalink
Merge tag 'v0.25.0'
Browse files Browse the repository at this point in the history
v0.25.0

      * Re-release of yanked 0.24.6 as a major release
      * Update MSRV to 1.57
      * Support variadic arguments (`...`) (mozilla#805)
      * Add --depfile option (mozilla#820)
      * Breaking changes: The `Config` struct now has a private member.
  • Loading branch information
mhallin committed May 25, 2024
2 parents 7a0941c + dd9a550 commit 8b996ab
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 40 deletions.
34 changes: 13 additions & 21 deletions .github/workflows/cbindgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,25 @@ jobs:
- uses: actions/checkout@v3

- name: Install stable
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy, rustfmt
components: "clippy, rustfmt"

- name: Run rustfmt
run: |
cargo fmt --check
cargo +stable fmt --check
- name: Run clippy
run: |
cargo clippy --workspace -- -D warnings
cargo +stable clippy --workspace -- -D warnings
- name: Install minimum supported Rust version
id: msrv
uses: actions-rs/toolchain@v1
with:
toolchain: 1.57
override: true
uses: dtolnay/rust-toolchain@1.64

- name: Build with minimum supported Rust version
run: |
cargo test nonexistent-test --verbose
cargo +${{steps.msrv.outputs.name}} test nonexistent-test --verbose
build:

Expand All @@ -48,10 +44,8 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install stable Rust
uses: dtolnay/rust-toolchain@stable

- name: Install Python
uses: actions/setup-python@v4
Expand All @@ -65,23 +59,21 @@ jobs:
- name: Build
run: |
cargo build --verbose
cargo +stable build --verbose
- name: Build no-default-features
run: |
cargo build --verbose --no-default-features
cargo +stable build --verbose --no-default-features
- name: Test package
env:
CBINDGEN_TEST_VERIFY: 1
run: |
cargo package --verbose
(cd target/package/cbindgen-$(cargo run -- --version | cut -d ' ' -f 2) && cargo test --verbose)
cargo +stable package --verbose
(cd target/package/cbindgen-$(cargo +stable run -- --version | cut -d ' ' -f 2) && cargo +stable test --verbose)
- name: Install nightly Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
uses: dtolnay/rust-toolchain@nightly

- name: Test
env:
Expand Down
27 changes: 16 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,28 @@ on:
jobs:

linux-binaries:
permissions:
# Grant the GITHUB_TOKEN additional permissions necessary for creating a release.
# We only run this action for tags, so any code has already been reviewed by
# someone with permissions to create a tag.
contents: write

runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3

- name: Install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
uses: dtolnay/rust-toolchain@stable

- name: semver
run: |
cargo +stable install cargo-semver-checks --locked
cargo semver-checks check-release
- name: Build cbindgen
run: |
cargo build --release
cargo +stable build --release
- name: Strip cbindgen
run: |
Expand All @@ -41,11 +49,8 @@ jobs:
sed '$ d' | awk '{$1=$1};1' > CHANGES.txt
- name: Create a release
uses: softprops/action-gh-release@v1
with:
name: v${{ steps.tagName.outputs.version }}
body_path: CHANGES.txt
files: |
target/release/cbindgen
run: |
TAG=${{ steps.tagName.outputs.version }}
gh release create ${TAG} --title "${TAG}" --notes-file "CHANGES.txt" --draft 'target/release/cbindgen#cbindgen-ubuntu20.04'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 9 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
## 0.24.6
## 0.25.0

* Re-release of yanked 0.24.6 as a major release
* Update MSRV to 1.57
* Support variadic arguments (`...`) (#805)
* Add --depfile option (#820)
* Breaking changes: The `Config` struct now has a private member.

## 0.24.6 (YANKED: depfile option was breaking, see #841)

* Update MSRV to 1.57
* Support variadic arguments (`...`) (#805)
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cbindgen"
version = "0.24.6"
version = "0.25.0"
authors = [
"Emilio Cobos Álvarez <emilio@crisal.io>",
"Jeff Muizelaar <jmuizelaar@mozilla.com>",
Expand All @@ -13,7 +13,7 @@ keywords = ["bindings", "ffi", "code-generation"]
categories = ["external-ffi-bindings", "development-tools::ffi"]
repository = "https://github.com/eqrion/cbindgen"
edition = "2018"
rust-version = "1.57"
rust-version = "1.64"
exclude = [
"tests/profile.rs", # Test relies in a sub-crate, see https://github.com/rust-lang/cargo/issues/9017
]
Expand All @@ -26,7 +26,7 @@ serde = { version = "1.0.103", default-features = false, features = ["derive"] }
serde_json = "1.0"
tempfile = "3"
toml = "0.5"
proc-macro2 = "1"
proc-macro2 = "1.0.60"
quote = "1"
heck = "0.4"

Expand Down
1 change: 1 addition & 0 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ There is continuous integration setup for `cbindgen` using [GitHub Actions](http

In addition to a C/C++ compiler `cargo test` requires Python and Cython
(`python -m pip install Cython`) for checking Cython bindings generated from tests (`.pyx` files).
Note that the tests will be failed with Cython 3.x or later.

Please run `cargo test` before filing a pull request to be sure that all tests pass. This will also update the test expectations.

Expand Down
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "nightly"
2 changes: 1 addition & 1 deletion src/bindgen/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl Bindings {
let mut canon_source_files: Vec<_> = self
.source_files
.iter()
.chain(self.config.config_path.as_ref().into_iter())
.chain(self.config.config_path.as_ref())
.map(|p| p.canonicalize().unwrap())
.collect();
// Sorting makes testing easier by ensuring the output is ordered.
Expand Down

0 comments on commit 8b996ab

Please sign in to comment.