Skip to content

Commit b01065c

Browse files
committed
revert features
1 parent 1280143 commit b01065c

7 files changed

Lines changed: 19 additions & 17 deletions

File tree

.github/workflows/full-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ jobs:
326326
artifact-name: linux-nightly
327327
godot-binary: godot.linuxbsd.editor.dev.x86_64
328328
# Important to keep both experimental-threads and codegen-full. Some itests (native_st_audio) require both.
329-
rust-extra-args: --features itest/experimental-threads,itest/codegen-full-experimental,godot/api-custom,godot/serde,itest/register-docs
329+
rust-extra-args: --features itest/experimental-threads,itest/codegen-full-experimental,godot/api-custom,godot/serde,itest/register-docs,godot/safeguards-dev-balanced
330330

331331
# Compiles godot-rust with `api-custom-json` feature against the JSON file generated via `--dump-extension-api`.
332332
# Uses latest 4.x headers, while `extension_api.json` comes from the latest Godot binary.
@@ -350,7 +350,7 @@ jobs:
350350
os: ubuntu-22.04
351351
artifact-name: linux-release-nightly
352352
godot-binary: godot.linuxbsd.template_release.x86_64
353-
rust-extra-args: --release --features itest/codegen-full-experimental,godot/safeguards-disengaged
353+
rust-extra-args: --release --features itest/codegen-full-experimental,godot/safeguards-release-disengaged
354354
rust-cache-key: release-disengaged
355355

356356
# Linux compat:

godot-bindings/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ api-custom-json = ["dep:nanoserde", "dep:bindgen", "dep:regex", "dep:which"]
3434
api-custom-extheader = []
3535

3636
# Safeguard levels (see godot/lib.rs for detailed documentation).
37-
safeguards-strict = []
38-
safeguards-disengaged = []
37+
safeguards-dev-balanced = []
38+
safeguards-release-disengaged = []
3939

4040
[dependencies]
4141
gdextension-api = { workspace = true }

godot-bindings/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,12 @@ pub fn emit_safeguard_levels() {
276276
let mut safeguards_level = if cfg!(debug_assertions) { 2 } else { 1 };
277277

278278
// Features can override the default level
279-
if cfg!(feature = "safeguards-strict") {
280-
safeguards_level = 2;
279+
#[cfg(debug_assertions)]
280+
if cfg!(feature = "safeguards-dev-balanced") {
281+
safeguards_level = 1;
281282
}
282-
if cfg!(feature = "safeguards-disengaged") {
283+
#[cfg(not(debug_assertions))]
284+
if cfg!(feature = "safeguards-release-disengaged") {
283285
safeguards_level = 0;
284286
}
285287

godot-core/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ api-4-5 = ["godot-ffi/api-4-5"]
3939
# ]]
4040

4141
# Safeguard levels (see godot/lib.rs for detailed documentation).
42-
safeguards-strict = ["godot-ffi/safeguards-strict"]
43-
safeguards-disengaged = ["godot-ffi/safeguards-disengaged"]
42+
safeguards-dev-balanced = ["godot-ffi/safeguards-dev-balanced"]
43+
safeguards-release-disengaged = ["godot-ffi/safeguards-release-disengaged"]
4444

4545
[dependencies]
4646
godot-ffi = { path = "../godot-ffi", version = "=0.4.1" }

godot-ffi/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ api-4-5 = ["godot-bindings/api-4-5"]
3131
# ]]
3232

3333
# Safeguard levels (see godot/lib.rs for detailed documentation).
34-
safeguards-strict = ["godot-bindings/safeguards-strict"]
35-
safeguards-disengaged = ["godot-bindings/safeguards-disengaged"]
34+
safeguards-dev-balanced = ["godot-bindings/safeguards-dev-balanced"]
35+
safeguards-release-disengaged = ["godot-bindings/safeguards-release-disengaged"]
3636

3737
[dependencies]
3838

godot/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ api-4-5 = ["godot-core/api-4-5"]
4040
# ]]
4141

4242
# Safeguard levels (see godot/lib.rs for detailed documentation).
43-
safeguards-strict = ["godot-core/safeguards-strict"]
44-
safeguards-disengaged = ["godot-core/safeguards-disengaged"]
43+
safeguards-dev-balanced = ["godot-core/safeguards-dev-balanced"]
44+
safeguards-release-disengaged = ["godot-core/safeguards-release-disengaged"]
4545

4646
default = ["__codegen-full"]
4747

godot/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,13 @@
181181
//!
182182
//! See [Safeguard levels](#safeguard-levels).
183183
//!
184-
//! * **`safeguards-strict`**
184+
//! * **`safeguards-dev-balanced`**
185185
//!
186-
//! Use the **strict** safeguard level. This is the default for debug builds, but can be enabled for release builds too.<br><br>
186+
//! For the `dev` Cargo profile, use the **balanced** safeguard level instead of the default strict level.<br><br>
187187
//!
188-
//! * **`safeguards-disengaged`**
188+
//! * **`safeguards-release-disengaged`**
189189
//!
190-
//! Use the **disengaged** safeguard level. This disables most runtime checks for maximum performance.
190+
//! For the `release` Cargo profile, use the **disengaged** safeguard level instead of the default balanced level.
191191
//!
192192
//! _Third-party integrations:_
193193
//!

0 commit comments

Comments
 (0)