Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Refinedrust Dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lennard Gäher
Refinedrust Dev
Merge requests
!1
fix(translation): Remove buffered concurrency with run_check
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
fix(translation): Remove buffered concurrency with run_check
lafeychine/refinedrust-dev:main
into
main
Overview
1
Commits
1
Pipelines
0
Changes
3
Merged
Vincent Lafeychine
requested to merge
lafeychine/refinedrust-dev:main
into
main
1 year ago
Overview
1
Commits
1
Pipelines
0
Changes
3
Expand
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
26397b32
1 commit,
1 year ago
3 files
+
12
−
46
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
rr_frontend/translation/src/main.rs
+
12
−
44
Options
@@ -53,9 +53,7 @@ use typed_arena::Arena;
use
std
::
collections
::{
HashSet
,
HashMap
};
use
std
::
process
::{
Command
,
Stdio
};
use
libc
::{
pid_t
,
waitpid
,
WCONTINUED
,
WEXITED
,
WNOHANG
};
use
std
::
process
::
Command
;
mod
utils
;
@@ -452,57 +450,27 @@ pub fn analyze<'tcx>(tcx : TyCtxt<'tcx>) {
// maybe run proof checker
// TODO: Refactor the analyze function into smaller parts.
// The flush should not be done explicitly.
code_file
.flush
()
.unwrap
();
spec_file
.flush
()
.unwrap
();
dune_file
.flush
()
.unwrap
();
if
let
Some
(
true
)
=
rrconfig
::
check_proofs
()
{
if
cfg!
(
target_os
=
"windows"
)
{
println!
(
"Cannot run proof checker on Windows."
);
}
else
{
println!
(
"calling type checker in {:?}"
,
dir_path
);
let
child
=
Command
::
new
(
"dune"
)
let
status
=
Command
::
new
(
"dune"
)
.arg
(
"build"
)
.current_dir
(
&
dir_path
)
.stdin
(
Stdio
::
null
())
.stdout
(
Stdio
::
inherit
())
.stderr
(
Stdio
::
inherit
())
.spawn
()
.status
()
.expect
(
"failed to execute process"
);
// Wait for all subprocesses to complete before exiting.
//let status = child.wait().expect("build process failed");
//println!("build process status: {:?}", status);
// Wait for all subprocesses to complete before exiting.
wait_for_child_processes
(
child
.id
()
as
pid_t
);
}
}
}
// Thanks, ChatGPT.
// TODO somehow this doesn't correctly exit for [dune].
fn
wait_for_child_processes
(
pid
:
pid_t
)
{
loop
{
let
result
=
unsafe
{
waitpid
(
pid
,
&
mut
0
,
WNOHANG
|
WCONTINUED
|
WEXITED
,
)
};
match
result
{
-
1
=>
{
println!
(
"waitpid failed: {} (os error {})"
,
std
::
io
::
Error
::
last_os_error
(),
std
::
io
::
Error
::
last_os_error
()
.raw_os_error
()
.unwrap_or
(
0
));
break
;
}
0
=>
{
// no child process has exited
std
::
thread
::
yield_now
();
}
_
=>
{
println!
(
"process {} exited"
,
pid
);
break
;
}
println!
(
"Type checker finished with {status}"
);
}
}
}
Loading