@@ -113,13 +113,41 @@ fn copy_cdylib_into_godot_build(is_debug_build: bool) {
113113
114114fn godot_import ( ) {
115115 let godot_bin = resolve_godot_bin ( ) ;
116- let mut cmd = Command :: new ( & godot_bin) ;
117- cmd. current_dir ( GODOT_BASE_DIR )
118- . args ( [ "--import" ] ) // ensure import database updated
119- . args ( [ "--headless" ] ) // run without GUI for CI
120- . stdout ( Stdio :: inherit ( ) )
121- . stderr ( Stdio :: inherit ( ) ) ;
122- run_cmd ( cmd, & format ! ( "{} --import --headless" , godot_bin) ) ;
116+ let human = format ! ( "{} --import --headless" , godot_bin) ;
117+ for attempt in 1 ..=2 {
118+ let mut cmd = Command :: new ( & godot_bin) ;
119+ cmd. current_dir ( GODOT_BASE_DIR )
120+ . args ( [ "--import" ] ) // ensure import database updated
121+ . args ( [ "--headless" ] ) // run without GUI for CI
122+ . stdout ( Stdio :: inherit ( ) )
123+ . stderr ( Stdio :: inherit ( ) ) ;
124+
125+ match cmd. status ( ) {
126+ Ok ( status) if status. success ( ) => {
127+ return ;
128+ }
129+ Ok ( status) => {
130+ eprintln ! (
131+ "Import attempt {} failed ({}): exit status {:?}" ,
132+ attempt, human, status
133+ ) ;
134+ }
135+ Err ( e) => {
136+ eprintln ! (
137+ "Failed to run {} (attempt {}): {}" ,
138+ human, attempt, e
139+ ) ;
140+ }
141+ }
142+
143+ if attempt == 1 {
144+ eprintln ! ( "Retrying Godot import once due to transient failure..." ) ;
145+ std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 300 ) ) ;
146+ continue ;
147+ }
148+ }
149+ eprintln ! ( "Godot import failed after retry." ) ;
150+ std:: process:: exit ( 1 ) ;
123151}
124152
125153fn godot_export ( is_debug_build : bool ) {
0 commit comments