Skip to content

Commit eaa8bf1

Browse files
committed
Try increasing timeout limit aggain, message waiting
Signed-off-by: Lukasz Stafiniak <lukstafi@gmail.com>
1 parent a93783f commit eaa8bf1

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

arrayjit/lib/cc_backend.ml

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,25 +83,25 @@ let%track7_sexp c_compile_and_load ~f_path =
8383
| _ -> "-shared -fPIC"
8484
in
8585
(* On Windows, we need to link with the builtins library *)
86-
let builtins_lib =
86+
let builtins_lib =
8787
if String.equal Sys.os_type "Win32" || String.equal Sys.os_type "Cygwin" then
8888
(* Try to find the builtins object file in the build directory *)
89-
let paths = [
90-
"_build/default/arrayjit/lib/builtins.o";
91-
"_build/default/arrayjit/lib/libir_stubs.a";
92-
"arrayjit/lib/builtins.o";
93-
] in
94-
match List.find ~f:Stdlib.Sys.file_exists paths with
95-
| Some path -> " " ^ path
96-
| None -> ""
89+
let paths =
90+
[
91+
"_build/default/arrayjit/lib/builtins.o";
92+
"_build/default/arrayjit/lib/libir_stubs.a";
93+
"arrayjit/lib/builtins.o";
94+
]
95+
in
96+
match List.find ~f:Stdlib.Sys.file_exists paths with Some path -> " " ^ path | None -> ""
9797
else ""
9898
in
9999
let cmdline : string =
100-
Printf.sprintf "%s %s%s -O%d -o %s %s >> %s 2>&1" (compiler_command ()) f_path
101-
builtins_lib (optimization_level ()) libname kernel_link_flags log_fname
100+
Printf.sprintf "%s %s%s -O%d -o %s %s >> %s 2>&1" (compiler_command ()) f_path builtins_lib
101+
(optimization_level ()) libname kernel_link_flags log_fname
102102
in
103103
(* Debug: write the command to the log file *)
104-
let () =
104+
let () =
105105
let oc = Stdio.Out_channel.create ~append:false log_fname in
106106
Stdio.Out_channel.fprintf oc "Command: %s\n" cmdline;
107107
Stdio.Out_channel.fprintf oc "Builtins lib: '%s'\n" builtins_lib;
@@ -111,13 +111,22 @@ let%track7_sexp c_compile_and_load ~f_path =
111111
(* Note: it seems waiting for the file to exist is necessary here and below regardless of needing
112112
the logs. *)
113113
let start_time = Unix.gettimeofday () in
114-
let timeout = Float.of_string @@ Utils.get_global_arg ~default:"100.0" ~arg_name:"cc_backend_post_compile_timeout" in
114+
let wait_counter = ref 0 in
115+
let timeout =
116+
Float.of_string
117+
@@ Utils.get_global_arg ~default:"360.0" ~arg_name:"cc_backend_post_compile_timeout"
118+
in
115119
while rc = 0 && (not @@ (Stdlib.Sys.file_exists libname && Stdlib.Sys.file_exists log_fname)) do
116120
let elapsed = Unix.gettimeofday () -. start_time in
117121
if Float.(elapsed > timeout) then
118122
failwith "Cc_backend.c_compile_and_load: timeout waiting for compilation files to appear";
123+
wait_counter := !wait_counter + 1;
124+
if !wait_counter = 3000 then
125+
Stdio.printf "Cc_backend.c_compile_and_load: waiting for compilation files to appear%!";
126+
if !wait_counter > 3000 && !wait_counter % 1000 = 0 then Stdio.printf ".%!";
119127
Unix.sleepf 0.001
120128
done;
129+
if !wait_counter >= 3000 then Stdio.printf "\n%!";
121130
if rc <> 0 then (
122131
let errors =
123132
"Cc_backend.c_compile_and_load: compilation failed with errors:\n"

ocannl_config.example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,7 @@ limit_constant_fill_size=16
206206

207207
# The timeout for the CC backend to wait for the compilation files to appear, in seconds.
208208
# This is the wait after the compiler command exits (doesn't include the compilation time).
209-
cc_backend_post_compile_timeout=100.0
209+
cc_backend_post_compile_timeout=360.0
210+
211+
# If true, the CC backend will fail if the codesign of the compiled dynamic library fails.
212+
cc_backend_verify_codesign=false

0 commit comments

Comments
 (0)