Skip to content

Commit d214181

Browse files
authored
Merge pull request #1292 from godot-rust/qol/drop-godot-4.1
Remove support for Godot 4.1
2 parents 9ed35b5 + 54e8a91 commit d214181

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

+137
-575
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ runs:
117117
echo "Update compatibility_minimum in .gdextension files to '$apiVersion'..."
118118
dirs=("itest")
119119
120-
# Note that this is still hardcoded to 4.1, the start of GDExtension's compatibility promise. This makes it easier for users
121-
# to use gdext with older Godot versions. There is anyway a runtime check in gdext that checks compatibility again.
120+
# Note that this is still hardcoded to 4.2, the lowest supported API level by godot-rust. This makes it easier for users
121+
# to use godot-rust with older Godot versions. There is anyway a runtime check in gdext that checks compatibility again.
122122
for dir in "${dirs[@]}"; do
123-
find "$dir" -type f -name "*.gdextension" -exec sed -i'.bak' "s/compatibility_minimum = 4\.1/compatibility_minimum = $apiVersion/" {} +
123+
find "$dir" -type f -name "*.gdextension" -exec sed -i'.bak' "s/compatibility_minimum = 4\.2/compatibility_minimum = $apiVersion/" {} +
124124
done
125125
126126
echo "Example output: itest/godot/itest.gdextension"

.github/workflows/full-ci.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ jobs:
237237
# - Double + lazy: Godot nightly, custom, double, lazy func tables
238238
# - Features + exp: Godot nightly, custom, threads, serde, experimental API
239239
# - Memcheck nightly: Godot mem nightly, custom, sanitizer
240-
# - Memcheck 4.x: Godot mem 4.0/4.1, sanitizer
240+
# - Memcheck 4.x: Godot mem 4.2, sanitizer
241241

242242
# Note: Windows uses '--target x86_64-pc-windows-msvc' by default as Cargo argument.
243243
include:
@@ -300,12 +300,6 @@ jobs:
300300
godot-binary: godot.windows.editor.dev.x86_64.exe
301301
godot-prebuilt-patch: '4.3'
302302

303-
# - name: windows-4.1
304-
# os: windows-latest
305-
# artifact-name: windows-4.1
306-
# godot-binary: godot.windows.editor.dev.x86_64.exe
307-
# godot-prebuilt-patch: '4.1.3'
308-
309303
# Linux
310304

311305
# Don't use latest Ubuntu (22.04) as it breaks lots of ecosystem compatibility.
@@ -352,7 +346,7 @@ jobs:
352346
rust-extra-args: --release --features itest/codegen-full-experimental
353347
rust-cache-key: release
354348

355-
# Linux compat (4.1 disabled, already covered by memcheck)
349+
# Linux compat:
356350
# No hot-reload before 4.4, as the Godot project is 4.4+.
357351

358352
- name: linux-4.4
@@ -368,6 +362,7 @@ jobs:
368362
godot-binary: godot.linuxbsd.editor.dev.x86_64
369363
godot-prebuilt-patch: '4.3'
370364

365+
# Can be disabled in the future (already covered by memcheck). For now kept on to differentiate quicker.
371366
- name: linux-4.2
372367
os: ubuntu-22.04
373368
artifact-name: linux-4.2
@@ -391,11 +386,11 @@ jobs:
391386
# Sanitizers can't build proc-macros and build scripts; with --target, cargo ignores RUSTFLAGS for those two.
392387
rust-target: x86_64-unknown-linux-gnu
393388

394-
- name: linux-memcheck-4.1
389+
- name: linux-memcheck-4.2
395390
os: ubuntu-22.04
396-
artifact-name: linux-memcheck-4.1
391+
artifact-name: linux-memcheck-4.2
397392
godot-binary: godot.linuxbsd.editor.dev.x86_64.llvm.san
398-
godot-prebuilt-patch: '4.1' # check compat of API 4.1.0 with newer binaries.
393+
godot-prebuilt-patch: '4.2' # check compat of API 4.2 with newer binaries.
399394
rust-toolchain: nightly
400395
rust-env-rustflags: -Zrandomize-layout -Zsanitizer=address
401396
# Sanitizers can't build proc-macros and build scripts; with --target, cargo ignores RUSTFLAGS for those two.

.github/workflows/minimal-ci.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,6 @@ jobs:
205205
godot-binary: godot.linuxbsd.editor.dev.x86_64
206206
godot-prebuilt-patch: '4.2.2'
207207

208-
- name: linux-4.1
209-
os: ubuntu-22.04
210-
artifact-name: linux-4.1
211-
godot-binary: godot.linuxbsd.editor.dev.x86_64
212-
godot-prebuilt-patch: '4.1.4'
213-
214208
# Memory checkers
215209

216210
- name: linux-memcheck

godot-bindings/Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ experimental-wasm-nothreads = []
1919

2020
# [version-sync] [[
2121
# [line] api-$kebabVersion = []
22-
api-4-1 = []
23-
api-4-1-1 = []
24-
api-4-1-2 = []
25-
api-4-1-3 = []
26-
api-4-1-4 = []
2722
api-4-2 = []
2823
api-4-2-1 = []
2924
api-4-2-2 = []

godot-bindings/build.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ fn main() {
1717

1818
// [version-sync] [[
1919
// [line] \tif cfg!(feature = "api-$kebabVersion") { count += 1; }
20-
if cfg!(feature = "api-4-1") { count += 1; }
21-
if cfg!(feature = "api-4-1-1") { count += 1; }
22-
if cfg!(feature = "api-4-1-2") { count += 1; }
23-
if cfg!(feature = "api-4-1-3") { count += 1; }
24-
if cfg!(feature = "api-4-1-4") { count += 1; }
2520
if cfg!(feature = "api-4-2") { count += 1; }
2621
if cfg!(feature = "api-4-2-1") { count += 1; }
2722
if cfg!(feature = "api-4-2-2") { count += 1; }

godot-bindings/src/godot_exe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ pub(crate) fn read_godot_version(godot_bin: &Path) -> GodotVersion {
130130
/// True if Godot is a debug build (editor or debug export template), false otherwise (release export template).
131131
fn is_godot_debug_build(godot_bin: &Path) -> bool {
132132
// The `--version` command does not contain information about debug/release, but we can see if the `--help` output lists the command
133-
// `--dump-extension-api`. This seems to be reliable down to Godot 4.1.
133+
// `--dump-extension-api`. This seems to be reliable down to Godot 4.1 (past our support lower bound).
134134

135135
let mut cmd = Command::new(godot_bin);
136136
cmd.arg("--help");

godot-bindings/src/import.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ pub const ALL_VERSIONS: &[(u8, u8, u8)] = &[
1515
// [version-sync] [[
1616
// [include] past+current+future
1717
// [line] \t$triple,
18-
(4, 1, 0),
19-
(4, 1, 1),
20-
(4, 1, 2),
21-
(4, 1, 3),
22-
(4, 1, 4),
2318
(4, 2, 0),
2419
(4, 2, 1),
2520
(4, 2, 2),
@@ -31,16 +26,6 @@ pub const ALL_VERSIONS: &[(u8, u8, u8)] = &[
3126

3227
// [version-sync] [[
3328
// [line] #[cfg(feature = "api-$kebabVersion")]\npub use gdextension_api::version_$snakeVersion as prebuilt;
34-
#[cfg(feature = "api-4-1")]
35-
pub use gdextension_api::version_4_1 as prebuilt;
36-
#[cfg(feature = "api-4-1-1")]
37-
pub use gdextension_api::version_4_1_1 as prebuilt;
38-
#[cfg(feature = "api-4-1-2")]
39-
pub use gdextension_api::version_4_1_2 as prebuilt;
40-
#[cfg(feature = "api-4-1-3")]
41-
pub use gdextension_api::version_4_1_3 as prebuilt;
42-
#[cfg(feature = "api-4-1-4")]
43-
pub use gdextension_api::version_4_1_4 as prebuilt;
4429
#[cfg(feature = "api-4-2")]
4530
pub use gdextension_api::version_4_2 as prebuilt;
4631
#[cfg(feature = "api-4-2-1")]
@@ -60,11 +45,6 @@ pub use gdextension_api::version_4_4 as prebuilt;
6045
// [pre] #[cfg(not(any(
6146
// [post] \tfeature = "api-custom",\n\tfeature = "api-custom-json",\n)))]
6247
#[cfg(not(any(
63-
feature = "api-4-1",
64-
feature = "api-4-1-1",
65-
feature = "api-4-1-2",
66-
feature = "api-4-1-3",
67-
feature = "api-4-1-4",
6848
feature = "api-4-2",
6949
feature = "api-4-2-1",
7050
feature = "api-4-2-2",

godot-codegen/src/conv/type_conversions.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ fn to_rust_expr_inner(expr: &str, ty: &RustTy, is_inner: bool) -> TokenStream {
310310
}
311311
}
312312
// empty string appears only for Callable/Rid in 4.0; default ctor syntax in 4.1+
313+
// TODO(v0.4): check if we can remove ""
313314
"" | "RID()" | "Callable()" if !is_inner => {
314315
return match ty {
315316
RustTy::BuiltinIdent { ty: ident, .. } if ident == "Rid" => quote! { Rid::Invalid },

godot-codegen/src/generator/notifications.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ pub fn make_notification_enum(
7878
}
7979
}
8080

81-
workaround_constant_collision(&mut all_constants);
82-
8381
let enum_name = ctx.notification_enum_name(class_name).name;
8482
let doc_str = format!(
8583
"Notification type for class [`{c}`][crate::classes::{c}].",
@@ -148,18 +146,3 @@ pub fn make_notification_enum(
148146
pub fn try_to_notification(constant: &JsonClassConstant) -> Option<Ident> {
149147
constant.name.strip_prefix("NOTIFICATION_").map(util::ident) // used to be conv::shout_to_pascal(s)
150148
}
151-
152-
// ----------------------------------------------------------------------------------------------------------------------------------------------
153-
// Implementation
154-
155-
/// Workaround for Godot bug https://github.com/godotengine/godot/issues/75839, fixed in 4.2.
156-
///
157-
/// Godot has a collision for two notification constants (DRAW, NODE_CACHE_REQUESTED) in the same inheritance branch (as of 4.0.2).
158-
/// This cannot be represented in a Rust enum, so we merge the two constants into a single enumerator.
159-
fn workaround_constant_collision(all_constants: &mut Vec<(Ident, i32)>) {
160-
// This constant has never been used by the engine.
161-
#[cfg(before_api = "4.2")]
162-
all_constants.retain(|(constant_name, _)| constant_name != "NODE_RECACHE_REQUESTED");
163-
164-
let _ = &all_constants; // unused warning
165-
}

godot-codegen/src/generator/signals.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,8 @@ pub fn make_class_signals(
6767
has_own_signals.then(|| make_upcast_deref_impl(class_name, &nearest_collection_name));
6868

6969
let code = quote! {
70-
#[cfg(since_api = "4.2")]
7170
pub use signals::*;
7271

73-
#[cfg(since_api = "4.2")]
7472
mod signals {
7573
use crate::obj::{Gd, GodotClass};
7674
use super::re_export::#class_name;

0 commit comments

Comments
 (0)