Skip to content

Commit 630bf39

Browse files
UebelAndreSilcet
authored andcommitted
Update bindgen version to 0.65.1 (bazelbuild#2008)
* Update bindgen version to 0.65.1 * Regenerate documentation * Disable Bindgen examples on Windows
1 parent 629bccb commit 630bf39

File tree

65 files changed

+2767
-507
lines changed

Some content is hidden

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

65 files changed

+2767
-507
lines changed

.bazelci/presubmit.yml

+3
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,9 @@ tasks:
398398
- "-//proto/..."
399399
# The wasm rules do not work on windows
400400
- "-//wasm/..."
401+
# The bindgen rules are currently broken on windows
402+
# https://github.com/bazelbuild/rules_rust/issues/2009
403+
- "-//bindgen/..."
401404
build_targets: *windows_targets
402405
test_targets: *windows_targets
403406
crate_universe_examples_ubuntu2004:

bindgen/3rdparty/BUILD.bazel

+26-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
11
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
2+
load("//bindgen:repositories.bzl", "BINDGEN_VERSION")
23
load("//crate_universe:defs.bzl", "crate", "crates_vendor")
34

5+
_BINDGEN_CLI_PACKAGES = {
6+
"clap": crate.spec(
7+
version = "4.3.3",
8+
),
9+
"clap_complete": crate.spec(
10+
version = "4.3.1",
11+
),
12+
"env_logger": crate.spec(
13+
version = "0.10.0",
14+
),
15+
}
16+
417
crates_vendor(
518
name = "crates_vendor",
619
annotations = {
720
"bindgen": [crate.annotation(
8-
gen_binaries = ["bindgen"],
921
gen_build_script = True,
1022
)],
1123
"clang-sys": [crate.annotation(
1224
gen_build_script = True,
1325
)],
14-
"indexmap": [crate.annotation(
26+
"libc": [crate.annotation(
1527
gen_build_script = True,
1628
)],
17-
"log": [crate.annotation(
18-
rustc_flags = ["--cfg=atomic_cas"],
29+
"rustix": [crate.annotation(
30+
gen_build_script = True,
1931
)],
2032
"winapi": [crate.annotation(
2133
gen_build_script = True,
@@ -24,26 +36,29 @@ crates_vendor(
2436
cargo_lockfile = "Cargo.Bazel.lock",
2537
generate_build_scripts = False,
2638
mode = "remote",
27-
packages = {
39+
packages = dict({
2840
"bindgen": crate.spec(
41+
default_features = False,
42+
features = ["runtime"],
43+
version = BINDGEN_VERSION,
44+
),
45+
"bindgen-cli": crate.spec(
46+
default_features = False,
2947
features = ["runtime"],
30-
version = "0.60.1",
48+
version = BINDGEN_VERSION,
3149
),
3250
"clang-sys": crate.spec(
3351
# Should match the version of llvm-project being used.
3452
features = ["clang_14_0"],
3553
),
36-
"libloading": crate.spec(
37-
version = "0.7.3",
38-
),
39-
},
54+
}.items() + _BINDGEN_CLI_PACKAGES.items()),
4055
repository_name = "rules_rust_bindgen",
4156
tags = ["manual"],
4257
)
4358

4459
alias(
4560
name = "bindgen",
46-
actual = "//bindgen/3rdparty/crates:bindgen__bindgen",
61+
actual = "@rules_rust_bindgen__bindgen-cli-{}//:bindgen-cli".format(BINDGEN_VERSION),
4762
tags = ["manual"],
4863
visibility = ["//visibility:public"],
4964
)
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
load("@rules_rust//rust:defs.bzl", "rust_binary")
2+
3+
package(default_visibility = ["//visibility:public"])
4+
5+
# licenses([
6+
# "TODO", # BSD-3-Clause
7+
# ])
8+
9+
rust_binary(
10+
name = "bindgen-cli",
11+
srcs = glob(["**/*.rs"]),
12+
compile_data = glob(
13+
include = ["**"],
14+
exclude = [
15+
"**/* *",
16+
"BUILD",
17+
"BUILD.bazel",
18+
"WORKSPACE",
19+
"WORKSPACE.bazel",
20+
],
21+
),
22+
crate_features = [
23+
"runtime",
24+
],
25+
crate_root = "main.rs",
26+
edition = "2018",
27+
rustc_flags = ["--cap-lints=allow"],
28+
tags = [
29+
"cargo-bazel",
30+
"crate-name=bindgen-cli",
31+
"manual",
32+
"noclippy",
33+
"norustfmt",
34+
],
35+
version = "0.65.1",
36+
# This list is produced by adding the contents of https://github.com/rust-lang/rust-bindgen/blob/main/bindgen-cli/Cargo.toml
37+
# to `@rules_rust//bindgen/3rdparty:crates_vendor`, rendering dependencies, and updating the deps
38+
deps = [
39+
"@rules_rust_bindgen__bindgen-0.65.1//:bindgen",
40+
"@rules_rust_bindgen__clap-4.3.3//:clap",
41+
"@rules_rust_bindgen__clap_complete-4.3.1//:clap_complete",
42+
"@rules_rust_bindgen__env_logger-0.10.0//:env_logger",
43+
"@rules_rust_bindgen__log-0.4.19//:log",
44+
"@rules_rust_bindgen__shlex-1.1.0//:shlex",
45+
],
46+
)

0 commit comments

Comments
 (0)