Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tools/opam-builder/checkBuild.ml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ let compute_solution_checksum st v solution_deps =
try
match FileString.read_file result_file with
| "SUCCESS\n" -> ()
| "FAILURE\n" ->
| "FAILURE\n" | "DEPFAIL\n" ->
Printf.eprintf
"Compilation disabled because dependency %s failed before\n%!"
version_name;
Expand Down Expand Up @@ -185,7 +185,7 @@ let really_check_install failures st v only_to_clean
Printf.fprintf build_oc "disabled:skip:%s\n" v.version_name;
close_out build_oc;
close_out log_oc;
FileString.write_file result_file "FAILURE\n";
FileString.write_file result_file "DEPFAIL\n";
()

let check_installable_solution
Expand Down
6 changes: 4 additions & 2 deletions tools/opam-builder/checkExport.ml
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,12 @@ let export st c stats =
Printf.fprintf oc "begin-build:true\n%s\nbegin-build:false\n"
build_content;

| "FAILURE\n" ->
| ("FAILURE\n" | "DEPFAIL\n") as status ->
let log_content = FileString.read_file log_file in
let build_content = FileString.read_file build_file in
Printf.fprintf oc "status:failure\n";
if status = "FAILURE\n"
then Printf.fprintf oc "status:failure\n"
else Printf.fprintf oc "status:depfail\n";
Printf.fprintf oc "begin-build:true\n%s\nbegin-build:false\n"
build_content;
Printf.fprintf oc "begin-log:true\n%s\nbegin-log:false\n"
Expand Down
15 changes: 9 additions & 6 deletions tools/opam-builder/checkJson.ml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ let of_commit ~replace_commit_tree c =
StringMap.iter (fun _ v ->
let status =
match v.version_result with
| Some true -> "Ok"
| Some false -> "Fail"
| Some Success -> "Ok"
| Some Failure -> "Fail"
| Some Depfail -> "DepFail"
| None ->
match v.version_status with
| None -> "NotChecked"
Expand All @@ -68,8 +69,9 @@ let of_commit ~replace_commit_tree c =
"build_result",
S (match v.version_result with
| None -> "not available"
| Some true -> "Success"
| Some false -> "Failed");
| Some Success -> "Success"
| Some Failure -> "Failed"
| Some Depfail -> "Depfail");
"build_log",
S (match v.version_log with
| None -> "not available"
Expand Down Expand Up @@ -138,8 +140,9 @@ let of_commits ~replace_commit_tree filename title cs =
let _, t = get_version v in
let state =
match v.version_result with
| Some true -> "Ok"
| Some false -> "Fail"
| Some Success -> "Ok"
| Some Failure -> "Fail"
| Some Depfail -> "Depfail"
| None ->
match v.version_status with
| None -> "NotChecked"
Expand Down
13 changes: 8 additions & 5 deletions tools/opam-builder/checkReport.ml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ let report st c stats =
try
match FileString.read_file result_file with
| "SUCCESS\n" -> incr nsuccess_versions
| "FAILURE\n" -> incr nfailed_versions
| "FAILURE\n" | "DEPFAIL\n" -> incr nfailed_versions
| _ -> raise Exit
with _ ->
incr nerror_versions
Expand Down Expand Up @@ -129,8 +129,11 @@ let report st c stats =
match FileString.read_file result_file with
| "SUCCESS\n" ->
Printf.fprintf oc " <td style=\"background-color: green;\"></td>\n";
| "FAILURE\n" ->
Printf.fprintf oc " <td style=\"background-color: orange;\"><a href=\"#%s\">FAILURE</a></td>\n" v.version_name;
| ("FAILURE\n" | "DEPFAIL\n") as fail_status ->
let msg =
if fail_status = "FAILURE\n"
then "FAILURE" else "DEPFAIL" in
Printf.fprintf oc " <td style=\"background-color: orange;\"><a href=\"#%s\">%s</a></td>\n" msg v.version_name;
| _ -> raise Exit
with _ ->
Printf.fprintf oc " <td style=\"background-color: orange;\">???</td>\n";
Expand Down Expand Up @@ -170,8 +173,8 @@ let report st c stats =
let result_file = install_prefix ^ ".result" in
try
match FileString.read_file result_file with
| "SUCCESS\n" -> ()
| "FAILURE\n" ->
| "SUCCESS\n"-> ()
| "FAILURE\n" | "DEPFAIL\n" ->
version_header p v;
Printf.fprintf oc "<pre>%s</pre>"
(FileString.read_file build_file);
Expand Down
7 changes: 6 additions & 1 deletion tools/opam-builder/checkTypes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ open StringCompat
mutable version_revdeps : version list;

(* only available after build *)
mutable version_result : bool option;
mutable version_result : version_result option;
mutable version_build : build_file option;
mutable version_log : string option;
}
Expand All @@ -101,6 +101,11 @@ open StringCompat
lint_errors: (int * string) list;
}

and version_result =
| Success (* the version built correctly *)
| Failure (* the version failed to build *)
| Depfail (* a dependency failed to build *)

type commit = {
check_date : string;
timestamp_date : string;
Expand Down
10 changes: 7 additions & 3 deletions tools/opam-builder/commandBuild.ml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,15 @@ let build_packages () =
try
match FileString.read_file result_file with
| "SUCCESS\n" ->
Some true
Some Success
| "FAILURE\n" ->
v.version_log <-
(try Some (FileString.read_file log_file) with _ -> None);
Some false
Some Failure
| "DEPFAIL\n" ->
v.version_log <-
(try Some (FileString.read_file log_file) with _ -> None);
Some Depfail
| _ ->
let tmp_file = result_file ^ ".tmp" in
(try Sys.remove tmp_file with _ -> ());
Expand Down Expand Up @@ -104,7 +108,7 @@ after deleting the wrong result files. *)
try
let vdep = StringMap.find dep c.versions in
match vdep.version_result with
| Some true ->
| Some Success ->
Printf.eprintf
"Inconsistency: %S skipped, but dep %S is ok\n%!"
v.version_name vdep.version_name;
Expand Down
3 changes: 2 additions & 1 deletion tools/opam-builder/files/opam-builder.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.Ok { background-color: green; }
.BadDeps { background-color: orange; }
.BadDeps { background-color: white; }
.DepFail { background-color: orange; }
.Fail { background-color: red; }

.page-body {
Expand Down
1 change: 1 addition & 0 deletions tools/opam-builder/files/opam-builder.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ <h1 class="banner-title">OPAM BUILDER</h1>
<select id='id-select-table-tag' onchange='javascript:select_table_tag()'>
<option value="" selected>View All</option>
<option value="Fail">View Failures</option>
<option value="DepFail">View Dependency Failures</option>
<option value="BadDeps">View Bad Dependencies</option>
<option value="Missing">View Not-Available</option>
</select>
Expand Down
2 changes: 1 addition & 1 deletion tools/opam-builder/files/opam-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ var table_page = 0; // position of displayed table
var table_page_size = initial_page_size; // min number of displayed entries
var table_title = ""; // current displayed switch
var table_search = ""; // global search
var table_tag = ""; // Ok, Missing, Fail, BadDeps
var table_tag = ""; // Ok, Missing, Fail, DepFail, BadDeps

var package_json_url = "";
var package_json = null;
Expand Down