Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
caisar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
caisar
Commits
e86dd911
Commit
e86dd911
authored
3 years ago
by
Michele Alberti
Browse files
Options
Downloads
Patches
Plain Diff
Remove temporary files only when computation correctly terminates.
parent
e58920f9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config.ml
+1
-1
1 addition, 1 deletion
config.ml
engine.ml
+7
-5
7 additions, 5 deletions
engine.ml
with
8 additions
and
6 deletions
config.ml
+
1
−
1
View file @
e86dd911
...
...
@@ -167,13 +167,13 @@ let detect_default_solvers () =
Stdlib
.
close_in
in_channel
;
Buffer
.
contents
buf
in
Utils
.
remove_on_app_mode
tmp
;
if
retcode
<>
0
then
begin
Logs
.
info
(
fun
m
->
m
"No solver `%s' found."
S
.
name
);
None
end
else
begin
Utils
.
remove_on_app_mode
tmp
;
(* If available, we save a [config] for solver. *)
let
version
=
version_of_solver
solver
cmd_output
in
let
config
=
{
name
=
S
.
name
;
exe
;
version
;
}
in
...
...
This diff is collapsed.
Click to expand it.
engine.ml
+
7
−
5
View file @
e86dd911
...
...
@@ -45,10 +45,11 @@ let check_availability solver config =
let
retcode
=
Sys
.
command
cmd
in
let
in_channel
=
Stdlib
.
open_in
tmp
in
Stdlib
.
close_in
in_channel
;
Utils
.
remove_on_app_mode
tmp
;
if
retcode
=
0
then
then
begin
Utils
.
remove_on_app_mode
tmp
;
Ok
()
end
else
Error
(
Format
.
sprintf
...
...
@@ -199,7 +200,6 @@ let exec_tasks ~raw_options solver config model tasks_htbl =
Logs
.
info
(
fun
m
->
m
"Executing command `%s'."
cmd
);
try
let
retcode
=
Sys
.
command
cmd
in
Utils
.
remove_on_app_mode
prop
;
if
retcode
<>
0
then
Error
(
Format
.
sprintf
"Command `%s' has failed."
cmd
)
else
begin
...
...
@@ -207,14 +207,16 @@ let exec_tasks ~raw_options solver config model tasks_htbl =
let
result
=
extract_result
solver
~
log
~
output
in
Logs
.
app
(
fun
m
->
m
"Result of `%s': %a."
task
.
id
Solver
.
Result
.
pretty
result
);
Utils
.
remove_on_app_mode
output
;
if
Solver
.
Result
.
equal
result
Solver
.
Result
.
Failure
then
Logs
.
app
(
fun
m
->
m
"See error messages in `%s' for more information."
log
)
else
else
begin
Utils
.
remove_on_app_mode
log
;
Utils
.
remove_on_app_mode
prop
;
Utils
.
remove_on_app_mode
output
;
end
;
Ok
result
end
with
_
->
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment