Skip to content

Commit 40daade

Browse files
committed
Merge remote-tracking branch 'upstream/main' into merge-latest-upstream
2 parents fc466bf + 0917399 commit 40daade

File tree

380 files changed

+11842
-12505
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

380 files changed

+11842
-12505
lines changed

.github/workflows/bindgen.yml

Lines changed: 33 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,25 @@ jobs:
3737
steps:
3838
- uses: actions/checkout@v4
3939

40+
- name: Read crate metadata
41+
id: metadata
42+
run: echo "rust-version=$(sed -ne 's/rust-version *= *\"\(.*\)\"/\1/p' Cargo.toml)" >> $GITHUB_OUTPUT
43+
4044
- name: Install msrv for lib
4145
uses: dtolnay/rust-toolchain@master
4246
with:
43-
# MSRV below is documented in Cargo.toml and README.md, please update those if you
44-
# change this.
45-
toolchain: 1.70.0
47+
toolchain: ${{ steps.metadata.outputs.rust-version }}
4648

4749
- name: Test lib with msrv
48-
run: cargo +1.70.0 test --package bindgen
50+
run: cargo +${{ steps.metadata.outputs.rust-version }} test --package bindgen
4951

5052
- name: Install msrv for cli
5153
uses: dtolnay/rust-toolchain@master
5254
with:
53-
# MSRV below is documented in Cargo.toml and README.md, please update those if you
54-
# change this.
55-
toolchain: 1.70.0
55+
toolchain: ${{ steps.metadata.outputs.rust-version }}
5656

5757
- name: Test cli with msrv
58-
run: cargo +1.70.0 build --package bindgen-cli
58+
run: cargo +${{ steps.metadata.outputs.rust-version }} build --package bindgen-cli
5959

6060
minimal:
6161
runs-on: ubuntu-latest
@@ -108,7 +108,7 @@ jobs:
108108
runs-on: ${{matrix.os}}
109109
strategy:
110110
matrix:
111-
os: [ubuntu-latest, macos-12]
111+
os: [ubuntu-latest, macos-latest]
112112
steps:
113113
- uses: actions/checkout@v4
114114

@@ -125,12 +125,7 @@ jobs:
125125
strategy:
126126
matrix:
127127
os: [ubuntu-latest]
128-
target:
129-
- debian: null
130-
cross: null
131-
rust: null
132128
llvm_version: ["9.0", "16.0"]
133-
main_tests: [1]
134129
release_build: [0, 1]
135130
no_default_features: [0, 1]
136131
# FIXME: There are no pre-built static libclang libraries, so the
@@ -147,64 +142,31 @@ jobs:
147142
no_default_features: 0
148143
feature_extra_asserts: 1
149144

150-
# FIXME: Seems installing multiarch packages fails:
151-
#
152-
# https://github.com/rust-lang/rust-bindgen/pull/2037/checks?check_run_id=2441799333
153-
#
154-
# - os: ubuntu-latest
155-
# target:
156-
# debian: arm64
157-
# cross: aarch64-linux-gnu
158-
# rust: aarch64-unknown-linux-gnu
159-
# llvm_version: "16.0"
160-
# main_tests: 0
161-
# release_build: 0
162-
# feature_extra_asserts: 0
163-
164145
# Ensure stuff works on macos too
165-
# FIXME: Ideally should use the latest llvm version, but llvm doesn't
166-
# provide releases for x86-64 macOS anymore which is what the runner uses.
167-
#
168-
- os: macos-12
169-
llvm_version: "9.0"
146+
- os: macos-latest
147+
llvm_version: "16.0"
170148
release_build: 0
171149
no_default_features: 0
172150
feature_extra_asserts: 0
173151
steps:
174152
- uses: actions/checkout@v4
175153

176-
- name: Install multiarch packages
177-
if: matrix.target.debian
178-
run: |
179-
sudo apt-get install binfmt-support qemu-user-static gcc-${{matrix.target.cross}} g++-${{matrix.target.cross}}
180-
source /etc/lsb-release
181-
sudo tee /etc/apt/sources.list <<EOF >/dev/null
182-
deb [arch=${{matrix.target.debian}}] http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME main
183-
deb [arch=${{matrix.target.debian}}] http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-updates main
184-
deb [arch=${{matrix.target.debian}}] http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-backports main
185-
deb [arch=${{matrix.target.debian}}] http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-security main
186-
EOF
187-
sudo dpkg --add-architecture ${{matrix.target.debian}}
188-
sudo apt-get update
189-
sudo apt-get install libc6:${{matrix.target.debian}} libstdc++6:${{matrix.target.debian}}
190-
191154
- name: Install stable
192155
uses: dtolnay/rust-toolchain@master
193156
with:
194157
toolchain: stable
195-
target: ${{matrix.target.rust}}
196158
- name: Install libtinfo
197159
if: matrix.os == 'ubuntu-latest'
198160
run: |
199-
sudo apt-get update
200-
sudo apt-get install libtinfo5
161+
wget https://mirrors.kernel.org/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb
162+
sudo dpkg -i libtinfo5_6.3-2ubuntu0.1_amd64.deb
163+
- name: Install LLVM and Clang
164+
uses: KyleMayes/[email protected]
165+
with:
166+
version: ${{matrix.llvm_version}}
201167
- name: Run all the tests
202168
env:
203169
GITHUB_ACTIONS_OS: ${{matrix.os}}
204-
RUST_CROSS_COMPILER: ${{matrix.target.cross}}
205-
RUST_TARGET: ${{matrix.target.rust}}
206-
LLVM_VERSION: ${{matrix.llvm_version}}
207-
BINDGEN_MAIN_TESTS: ${{matrix.main_tests}}
208170
BINDGEN_RELEASE_BUILD: ${{matrix.release_build}}
209171
BINDGEN_FEATURE_RUNTIME: ${{matrix.feature_runtime}}
210172
BINDGEN_FEATURE_EXTRA_ASSERTS: ${{matrix.feature_extra_asserts}}
@@ -239,12 +201,27 @@ jobs:
239201
./mdbook build book
240202
./mdbook test book
241203
204+
# FIXME(pvdrz): this should be done inside `bindgen-test` instead
205+
test-no-headers:
206+
runs-on: ubuntu-latest
207+
steps:
208+
- uses: actions/checkout@v4
209+
210+
- name: Test `--help`
211+
run: cargo run -- --help
212+
213+
- name: Test `--version`
214+
run: cargo run -- --version
215+
216+
- name: Test `--generate-shell-completions`
217+
run: cargo run -- --generate-shell-completions=bash
218+
242219
# One job that "summarizes" the success state of this pipeline. This can then
243220
# be added to branch protection, rather than having to add each job
244221
# separately.
245222
success:
246223
runs-on: ubuntu-latest
247-
needs: [rustfmt-clippy, msrv, minimal, docs, quickchecking, test-expectations, test, check-cfg, test-book]
224+
needs: [rustfmt-clippy, msrv, minimal, docs, quickchecking, test-expectations, test, check-cfg, test-book, test-no-headers]
248225
# GitHub branch protection is exceedingly silly and treats "jobs skipped
249226
# because a dependency failed" as success. So we have to do some
250227
# contortions to ensure the job fails if any of its dependencies fails.

.github/workflows/create-tag.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,35 @@ on:
44
pull_request:
55
types:
66
- closed
7-
7+
workflow_dispatch:
8+
inputs:
9+
commit:
10+
description: 'Commit hash'
11+
required: true
12+
type: string
813
jobs:
914
create-tag:
10-
if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name && startsWith(github.event.pull_request.head.ref, 'bump-version')
15+
if: >-
16+
(inputs.commit || false) ||
17+
(github.event.pull_request.merged == true &&
18+
github.event.pull_request.user.login == 'github-actions' &&
19+
github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name &&
20+
startsWith(github.event.pull_request.head.ref, 'bump-version') )
1121
runs-on: ubuntu-latest
1222
steps:
1323
- name: Checkout code
1424
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Compute the commit
29+
run: |
30+
if [[ -z "${{ inputs.commit }}" ]]; then
31+
COMMIT=$(git rev-parse ${{ github.sha }}^@ | grep -Fvx ${{ github.event.pull_request.head.sha }})
32+
else
33+
COMMIT="${{ inputs.commit }}"
34+
fi
35+
echo "commit=$COMMIT" >> $GITHUB_ENV
1536
1637
- name: Install rust toolchain
1738
uses: dtolnay/rust-toolchain@stable
@@ -21,7 +42,8 @@ jobs:
2142
echo "version=$(cargo pkgid -p bindgen | cut -d '#' -f 2)" >> $GITHUB_ENV
2243
2344
- name: Create tag
24-
run: |
25-
TAG_NAME="v${{ env.version }}"
26-
git tag $TAG_NAME
27-
git push origin $TAG_NAME
45+
uses: mathieudutour/[email protected]
46+
with:
47+
github_token: ${{ secrets.GITHUB_TOKEN }}
48+
commit_sha: ${{ env.commit }}
49+
custom_tag: ${{ env.version }}

.github/workflows/deploy-book.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
- name: Test book
1717
run: |
18-
curl -L https://github.com/rust-lang/mdBook/releases/download/v0.4.5/mdbook-v0.4.5-x86_64-unknown-linux-gnu.tar.gz | tar xz
18+
curl -L https://github.com/rust-lang/mdBook/releases/download/v0.4.34/mdbook-v0.4.34-x86_64-unknown-linux-gnu.tar.gz | tar xz
1919
./mdbook build book
2020
./mdbook test book
2121

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This file was autogenerated by cargo-dist: https://opensource.axo.dev/cargo-dist/
2+
#
13
# Copyright 2022-2024, axodotdev
24
# SPDX-License-Identifier: MIT or Apache-2.0
35
#
@@ -61,7 +63,7 @@ jobs:
6163
# we specify bash to get pipefail; it guards against the `curl` command
6264
# failing. otherwise `sh` won't catch that `curl` returned non-0
6365
shell: bash
64-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.21.0/cargo-dist-installer.sh | sh"
66+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.22.1/cargo-dist-installer.sh | sh"
6567
- name: Cache cargo-dist
6668
uses: actions/upload-artifact@v4
6769
with:

0 commit comments

Comments
 (0)