Skip to content

Commit f95cb4b

Browse files
committed
Update dependencies
Don't update everything to latest; focus primarily on incompatible (technically SemVer-breaking) updates. In some cases of compatible updates, older versions work fine, and allowing a wider range (lower bound) of versions increases cross-compatibility in the ecosystem. Note about bindgen: their API change from CargoCallbacks to CargoCallbacks::new() introduced a semantic change that recompiled headers repeatedly. Neither deprecation notice nor API docs mention this, but old behavior can be restored via flag. Added some comments about why this behavior is customized (infinite rebuild loop).
1 parent c82c18c commit f95cb4b

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

Cargo.toml

+8-7
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,32 @@ members = [
2222
gdextension-api = { version = "0.2.2", git = "https://github.com/godot-rust/godot4-prebuilt", branch = "releases" }
2323

2424
# Main library features.
25-
glam = { version = "0.28", features = ["debug-glam-assert"] }
25+
glam = { version = "0.30", features = ["debug-glam-assert"] }
2626
serde = { version = "1", features = ["derive"] }
2727
serde_json = "1"
2828

2929
# Related to tooling/build setup.
3030
# * regex: not used for unicode parsing -> features unicode-bool + unicode-gencat are enabled instead of unicode-perl.
3131
# 'unicode-gencat' needed for \d, see https://docs.rs/regex/latest/regex/#unicode-features.
32-
# * bindgen: version 0.69 had regression that forced recompilation of code. We used 0.68 for quite a while, need to see if problem persists.
3332
bindgen = { version = "0.71", default-features = false, features = ["runtime"] }
3433
libc = "0.2.172"
3534
regex = { version = "1.11", default-features = false, features = ["std", "unicode-bool", "unicode-gencat"] }
3635
which = "7"
3736

3837
# Macros and codegen. Minimal versions compatible with -Zminimal-versions.
3938
# * proc_macro2: Literal::c_string() added in 1.0.80.
39+
# * quote: 1.0.37 allows tokenizing CStr.
40+
# * venial: 0.6.1 contains some bugfixes.
4041
heck = "0.5"
41-
litrs = "0.4.1"
42-
markdown = "=1.0.0-alpha.21"
43-
nanoserde = "0.1.35"
42+
litrs = "0.4"
43+
markdown = "=1.0.0-alpha.23"
44+
nanoserde = "0.2"
4445
proc-macro2 = "1.0.80"
45-
quote = "1.0.29"
46+
quote = "1.0.37"
4647
venial = "0.6.1"
4748

4849
# Testing (godot-cell, itest).
49-
proptest = "1.4.0"
50+
proptest = "1.6.0"
5051
pin-project-lite = { version = "0.2" }
5152

5253
# Note about Jetbrains IDEs: "IDE Sync" (Refresh Cargo projects) may cause static analysis errors such as

godot-bindings/src/header_gen.rs

+11-5
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,21 @@ use std::path::Path;
1111
pub(crate) fn generate_rust_binding(in_h_path: &Path, out_rs_path: &Path) {
1212
let c_header_path = in_h_path.display().to_string();
1313

14-
// Listening to changes on files that are generated by this build step cause an infinite loop with cargo watch of
15-
// build -> detect change -> rebuild -> detect change -> ...
14+
// Default behavior of bindgen is to invalidate the built crate whenever any of the included header files changed. This is sensible,
15+
// but in our case, listening to changes on files that are generated by this build step cause an infinite loop with cargo watch of:
16+
// build -> detect change -> rebuild -> detect change -> ...
1617
// println!("cargo:rerun-if-changed={}", c_header_path);
18+
//
19+
// Without `rerun_on_header_files(false)`, the following command causes repeated recompilation of godot-ffi onward:
20+
// cargo build -p itest --features godot/api-custom
21+
//
22+
// This is non-trivial to fix and isn't planned at the moment, see https://github.com/godot-rust/gdext/issues/281.
23+
// If you have an idea to address this without too invasive changes, please comment on that issue.
24+
let cargo_cfg = bindgen::CargoCallbacks::new().rerun_on_header_files(false);
1725

1826
let builder = bindgen::Builder::default()
1927
.header(c_header_path)
20-
// Tell cargo to invalidate the built crate whenever any of the
21-
// included header files changed.
22-
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
28+
.parse_callbacks(Box::new(cargo_cfg))
2329
.prepend_enum_name(false);
2430

2531
std::fs::create_dir_all(

0 commit comments

Comments
 (0)