Skip to content

Commit f883763

Browse files
authored
Merge pull request #1127 from godot-rust/qol/update-deps
Centralize + update dependencies in workspace `Cargo.toml`
2 parents 0289637 + 0292629 commit f883763

File tree

11 files changed

+77
-44
lines changed

11 files changed

+77
-44
lines changed

.github/composite/godot-install/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ runs:
5151
fi
5252
5353
curl "$url" -Lo artifact.zip --retry 3
54-
unzip artifact.zip -d $RUNNER_DIR/godot_bin
54+
unzip -q artifact.zip -d $RUNNER_DIR/godot_bin
5555
shell: bash
5656

5757
- name: "Prepare Godot executable"

Cargo.toml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,41 @@ members = [
1515
"itest/hot-reload/rust",
1616
]
1717

18+
# All dependencies except own crates of this project should be specified here, independently of whether they're dev, build or
19+
# regular dependencies. Sort alphabetically within each section; comments about a dependency come on the section header.
20+
[workspace.dependencies]
21+
# Related to godot-rust.
22+
gdextension-api = { version = "0.2.2", git = "https://github.com/godot-rust/godot4-prebuilt", branch = "releases" }
23+
24+
# Main library features.
25+
glam = { version = "0.30", features = ["debug-glam-assert"] }
26+
serde = { version = "1", features = ["derive"] }
27+
serde_json = "1"
28+
29+
# Related to tooling/build setup.
30+
# * regex: not used for unicode parsing -> features unicode-bool + unicode-gencat are enabled instead of unicode-perl.
31+
# 'unicode-gencat' needed for \d, see https://docs.rs/regex/latest/regex/#unicode-features.
32+
bindgen = { version = "0.71", default-features = false, features = ["runtime"] }
33+
libc = "0.2.172"
34+
regex = { version = "1.11", default-features = false, features = ["std", "unicode-bool", "unicode-gencat"] }
35+
which = "7"
36+
37+
# Macros and codegen. Minimal versions compatible with -Zminimal-versions.
38+
# * 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.
41+
heck = "0.5"
42+
litrs = "0.4"
43+
markdown = "=1.0.0-alpha.23"
44+
nanoserde = "0.2"
45+
proc-macro2 = "1.0.80"
46+
quote = "1.0.37"
47+
venial = "0.6.1"
48+
49+
# Testing (godot-cell, itest).
50+
proptest = "1.6.0"
51+
pin-project-lite = { version = "0.2" }
52+
1853
# Note about Jetbrains IDEs: "IDE Sync" (Refresh Cargo projects) may cause static analysis errors such as
1954
# "at most one `api-*` feature can be enabled". This is because by default, all Cargo features are enabled,
2055
# which isn't a setup we support. To address this, individual features can be enabled in the various

godot-bindings/Cargo.toml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,15 @@ api-custom = ["dep:bindgen", "dep:regex", "dep:which"]
3737
api-custom-extheader = []
3838

3939
[dependencies]
40-
gdextension-api = { version = "0.2.2", git = "https://github.com/godot-rust/godot4-prebuilt", branch = "releases" }
40+
gdextension-api = { workspace = true }
4141

42-
# Do not use bindgen 0.69, it contains regression that forces recompilation of code.
43-
bindgen = { optional = true, version = "0.68", default-features = false, features = ["runtime"] }
44-
# regex >= 1.5.5 for security: https://blog.rust-lang.org/2022/03/08/cve-2022-24713.html
45-
# 'unicode-gencat' needed for \d, see: https://docs.rs/regex/1.5.5/regex/#unicode-features
46-
regex = { optional = true, version = "1.5.5", default-features = false, features = ["std", "unicode-gencat"] }
47-
which = { optional = true, version = "6" }
42+
bindgen = { workspace = true, optional = true }
43+
regex = { workspace = true, optional = true }
44+
which = { workspace = true, optional = true }
4845

4946
[dev-dependencies]
50-
# For tests, we need regex unconditionally. Keep this in sync with above dependency.
51-
regex = { version = "1.5.5", default-features = false, features = ["std", "unicode-gencat"] }
47+
# For tests, we need regex unconditionally.
48+
regex = { workspace = true }
5249

5350
# https://docs.rs/about/metadata
5451
[package.metadata.docs.rs]

godot-bindings/src/header_gen.rs

Lines changed: 11 additions & 5 deletions
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(

godot-cell/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ homepage = "https://godot-rust.github.io"
1414
proptest = ["dep:proptest"]
1515

1616
[dependencies]
17-
proptest = { version = "1.4.0", optional = true }
17+
proptest = { workspace = true, optional = true }
1818

1919
# https://docs.rs/about/metadata
2020
[package.metadata.docs.rs]

godot-codegen/Cargo.toml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,11 @@ experimental-threads = []
2323
[dependencies]
2424
godot-bindings = { path = "../godot-bindings", version = "=0.2.4" }
2525

26-
heck = "0.5"
27-
nanoserde = "0.1.35"
28-
29-
# Minimum versions compatible with -Zminimal-versions
30-
proc-macro2 = "1.0.80" # Literal::c_string() added in 1.0.80.
31-
quote = "1.0.29"
32-
33-
# Since we don't use Regex for unicode parsing, the features unicode-bool/unicode-gencat are used instead of unicode-perl.
34-
# See also https://docs.rs/regex/latest/regex/#unicode-features.
35-
regex = { version = "1.5.5", default-features = false, features = ["std", "unicode-bool", "unicode-gencat"] }
26+
heck = { workspace = true }
27+
nanoserde = { workspace = true }
28+
proc-macro2 = { workspace = true }
29+
quote = { workspace = true }
30+
regex = { workspace = true }
3631

3732
[build-dependencies]
3833
godot-bindings = { path = "../godot-bindings", version = "=0.2.4" } # emit_godot_version_cfg

godot-core/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ api-4-4 = ["godot-ffi/api-4-4"]
4545
godot-ffi = { path = "../godot-ffi", version = "=0.2.4" }
4646

4747
# See https://docs.rs/glam/latest/glam/index.html#feature-gates
48-
glam = { version = "0.28", features = ["debug-glam-assert"] }
49-
serde = { version = "1", features = ["derive"], optional = true }
48+
glam = { workspace = true }
49+
serde = { workspace = true, optional = true }
5050
godot-cell = { path = "../godot-cell", version = "=0.2.4" }
5151

5252
[build-dependencies]
@@ -56,7 +56,7 @@ godot-codegen = { path = "../godot-codegen", version = "=0.2.4" }
5656
# Reverse dev dependencies so doctests can use `godot::` prefix.
5757
[dev-dependencies]
5858
godot = { path = "../godot", default-features = false }
59-
serde_json = { version = "1.0" }
59+
serde_json = { workspace = true }
6060

6161
# https://docs.rs/about/metadata
6262
[package.metadata.docs.rs]

godot-ffi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ api-4-4 = ["godot-bindings/api-4-4"]
3636
[dependencies]
3737

3838
[target.'cfg(target_os = "linux")'.dependencies]
39-
libc = "0.2.171"
39+
libc = { workspace = true }
4040

4141
[target.'cfg(target_family = "wasm")'.dependencies]
4242
# Only needed for WASM identifier generation.

godot-macros/Cargo.toml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,16 @@ register-docs = ["dep:markdown", "dep:litrs"]
2020
proc-macro = true
2121

2222
[dependencies]
23-
# Minimum versions compatible with -Zminimal-versions
24-
proc-macro2 = "1.0.80" # Literal::c_string() added in 1.0.80.
25-
quote = "1.0.29"
23+
proc-macro2 = { workspace = true }
24+
quote = { workspace = true }
2625
# Enabled by `docs`.
27-
markdown = { version = "=1.0.0-alpha.21", optional = true }
28-
litrs = { version = "0.4.1", optional = true }
29-
venial = "0.6.1"
26+
markdown = { workspace = true, optional = true }
27+
litrs = { workspace = true, optional = true }
28+
venial = { workspace = true }
3029

3130
# Cannot use [target.'cfg(target_family = "wasm")'.dependencies], as proc-macro crates are always compiled for host platform, not target.
3231
# Thus solved via feature.
33-
libc = { version = "0.2.171", optional = true }
32+
libc = { workspace = true, optional = true }
3433

3534
[build-dependencies]
3635
godot-bindings = { path = "../godot-bindings", version = "=0.2.4" } # emit_godot_version_cfg

itest/rust/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ serde = ["dep:serde", "dep:serde_json", "godot/serde"]
2323

2424
[dependencies]
2525
godot = { path = "../../godot", default-features = false, features = ["__trace"] }
26-
serde = { version = "1", features = ["derive"], optional = true }
27-
serde_json = { version = "1.0", optional = true }
28-
pin-project-lite = { version = "0.2" }
26+
serde = { workspace = true, optional = true }
27+
serde_json = { workspace = true, optional = true }
28+
pin-project-lite = { workspace = true }
2929

3030
[build-dependencies]
3131
godot-bindings = { path = "../../godot-bindings" } # emit_godot_version_cfg
32-
repo-tweak = { path = "../repo-tweak" }
3332
godot-codegen = { path = "../../godot-codegen" } # IS_CODEGEN_FULL
33+
repo-tweak = { path = "../repo-tweak" }
3434

3535
# Minimum versions compatible with -Zminimal-versions
36-
proc-macro2 = "1.0.80" # Literal::c_string() added in 1.0.80.
37-
quote = "1.0.29"
36+
proc-macro2 = { workspace = true }
37+
quote = { workspace = true }

itest/rust/src/engine_tests/async_test.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,9 @@ fn signal_future_non_send_arg_panic() -> TaskHandle {
160160
handle
161161
}
162162

163+
// FIXME test is flaky and occasionally breaks CI job `linux-features-experimental`. Should become deterministic, then un-skip.
163164
#[cfg(feature = "experimental-threads")]
164-
#[itest(async)]
165+
#[itest(async, skip)]
165166
fn signal_future_send_arg_no_panic() -> TaskHandle {
166167
use crate::framework::ThreadCrosser;
167168

0 commit comments

Comments
 (0)