Skip to content

Commit c639f9a

Browse files
committed
Add godot-nightly (bindgen) jobs to CI
Also update artifacts repo + branch version to "4.0.1"
1 parent fa58910 commit c639f9a

File tree

7 files changed

+37
-10
lines changed

7 files changed

+37
-10
lines changed

.github/workflows/full-ci.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,14 @@ jobs:
181181
rust-extra-args: --features double-precision
182182
with-llvm: true
183183

184+
- name: macos-bindgen
185+
artifact-name: macos
186+
os: macos-12
187+
rust-toolchain: stable
188+
godot-binary: godot.macos.editor.dev.x86_64
189+
with-llvm: true
190+
rust-extra-args: --features godot/custom-godot
191+
184192
- name: windows
185193
os: windows-latest
186194
rust-toolchain: stable-x86_64-pc-windows-msvc
@@ -192,6 +200,13 @@ jobs:
192200
godot-binary: godot.windows.editor.dev.double.x86_64.exe
193201
rust-extra-args: --features double-precision
194202

203+
- name: windows-bindgen
204+
artifact-name: windows
205+
os: windows-latest
206+
rust-toolchain: stable-x86_64-pc-windows-msvc
207+
godot-binary: godot.windows.editor.dev.x86_64.exe
208+
rust-extra-args: --features godot/custom-godot
209+
195210
# Don't use latest Ubuntu (22.04) as it breaks lots of ecosystem compatibility.
196211
# If ever moving to ubuntu-latest, need to manually install libtinfo5 for LLVM.
197212
- name: linux
@@ -210,8 +225,7 @@ jobs:
210225
os: ubuntu-20.04
211226
rust-toolchain: stable
212227
godot-binary: godot.linuxbsd.editor.dev.x86_64
213-
rust-extra-args: --features custom-godot
214-
228+
rust-extra-args: --features godot/custom-godot
215229

216230
# Special Godot binaries compiled with AddressSanitizer/LeakSanitizer to detect UB/leaks.
217231
# Additionally, the Godot source is patched to make dlclose() a no-op, as unloading dynamic libraries loses stacktrace and

godot-bindings/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@ license = "MPL-2.0"
77
keywords = ["gamedev", "godot", "engine", "ffi", "sys"]
88
categories = ["game-engines", "graphics"]
99

10+
# Since features are additive and we want the user to user prebuilt by default, we need to have `prebuilt-godot` as the
11+
# default feature. However, it's not possible to _disable_ the prebuilt dependency when specifying `godot-custom` (without
12+
# requiring no-default-features), so we unfortunately still need to depend on prebuilt and just ignore it.
13+
# The artifact generator explicitly excludes that though (to avoid a quasi-circular dependency back to its repo).
1014
[features]
1115
default = ["prebuilt-godot"]
1216
prebuilt-godot = ["dep:godot4-prebuilt"]
1317
custom-godot = ["dep:bindgen", "dep:regex", "dep:which"]
1418
custom-godot-extheader = []
1519

1620
[dependencies]
17-
godot4-prebuilt = { optional = true, git = "https://github.com/godot-rust/godot4-artifacts", branch = "4.0" }
21+
godot4-prebuilt = { optional = true, git = "https://github.com/godot-rust/godot4-prebuilt", branch = "4.0.1" }
1822

1923
# Version >= 1.5.5 for security: https://blog.rust-lang.org/2022/03/08/cve-2022-24713.html
2024
# 'unicode-gencat' needed for \d, see: https://docs.rs/regex/1.5.5/regex/#unicode-features

godot-bindings/src/lib.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ use std::path::Path;
1010

1111
pub use watch::StopWatch;
1212

13-
#[cfg(all(feature = "custom-godot", feature = "prebuilt-godot"))]
14-
compile_error!("Exactly one of `custom-godot` or `prebuilt-godot` must be specified (both given).");
13+
// Note: we cannot prevent both `custom-godot` and `prebuilt-godot` from being specified; see Cargo.toml for more information.
1514

1615
#[cfg(not(any(feature = "custom-godot", feature = "prebuilt-godot")))]
17-
compile_error!("Exactly one of `custom-godot` or `prebuilt-godot` must be specified (none given).");
16+
compile_error!(
17+
"At least one of `custom-godot` or `prebuilt-godot` must be specified (none given)."
18+
);
1819

1920
// ----------------------------------------------------------------------------------------------------------------------------------------------
2021
// Regenerate all files
@@ -50,7 +51,7 @@ pub use custom::*;
5051
// ----------------------------------------------------------------------------------------------------------------------------------------------
5152
// Reuse existing files
5253

53-
#[cfg(feature = "prebuilt-godot")]
54+
#[cfg(not(feature = "custom-godot"))]
5455
#[path = ""]
5556
mod prebuilt {
5657
use super::*;
@@ -67,7 +68,7 @@ mod prebuilt {
6768
}
6869
}
6970

70-
#[cfg(feature = "prebuilt-godot")]
71+
#[cfg(not(feature = "custom-godot"))]
7172
pub use prebuilt::*;
7273

7374
// ----------------------------------------------------------------------------------------------------------------------------------------------

godot-core/build.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
use std::path::Path;
88

99
fn main() {
10-
let gen_path = Path::new(concat!(env!("CARGO_MANIFEST_DIR"), "/src/gen/"));
10+
let gen_path = Path::new(concat!(
11+
env!("CARGO_MANIFEST_DIR"),
12+
"/../target/godot-gen/core"
13+
));
1114

1215
if gen_path.exists() {
1316
std::fs::remove_dir_all(gen_path).unwrap_or_else(|e| panic!("failed to delete dir: {e}"));

godot-core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pub mod engine;
2424
#[allow(unused_imports, dead_code, non_upper_case_globals, non_snake_case, clippy::too_many_arguments, clippy::let_and_return, clippy::new_ret_no_self)]
2525
#[allow(clippy::upper_case_acronyms)] // TODO remove this line once we transform names
2626
#[allow(clippy::wrong_self_convention)] // TODO remove once to_string is const
27+
#[path = "../../target/godot-gen/core/mod.rs"]
2728
mod gen;
2829

2930
#[doc(hidden)]

godot-ffi/build.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ use std::path::Path;
1111
fn main() {
1212
let mut watch = godot_bindings::StopWatch::start();
1313

14-
let gen_path = Path::new(concat!(env!("CARGO_MANIFEST_DIR"), "/src/gen/"));
14+
let gen_path = Path::new(concat!(
15+
env!("CARGO_MANIFEST_DIR"),
16+
"/../target/godot-gen/ffi"
17+
));
1518
let header_rs_path = gen_path.join("gdextension_interface.rs");
1619

1720
godot_bindings::clear_dir(gen_path, &mut watch);

godot-ffi/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
deref_nullptr,
1818
clippy::redundant_static_lifetimes
1919
)]
20+
#[path = "../../target/godot-gen/ffi/mod.rs"]
2021
pub(crate) mod gen;
2122

2223
mod godot_ffi;

0 commit comments

Comments
 (0)