Skip to content

Commit

Permalink
Show stagestats for dependent precompilation
Browse files Browse the repository at this point in the history
This way you can get much more info when your "stage parse"
takes long, and you can more easily see the dependency
structure of your projects (though of course modules that
were already precompiled won't show up here)
  • Loading branch information
timo committed Aug 5, 2019
1 parent 84b3e9f commit 238f8e5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/core/CompUnit/PrecompilationRepository.pm6
Expand Up @@ -260,6 +260,12 @@ class CompUnit::PrecompilationRepository::Default does CompUnit::PrecompilationR
my $out = '';
my $err = '';
my $status;
#note "running PrecompRepo.precompile";
#note "is stagestats set? { +%*COMPILING<%?OPTIONS><stagestats> } { ~%*COMPILING<%?OPTIONS><stagestats> }";
with %*COMPILING<%?OPTIONS><stagestats> {
note "\nprecomp $path.relative()";
$*ERR.flush;
}
react {
my $proc = Proc::Async.new(
$perl6,
Expand All @@ -269,6 +275,7 @@ class CompUnit::PrecompilationRepository::Default does CompUnit::PrecompilationR
"--target=" ~ Rakudo::Internals.PRECOMP-TARGET,
"--output=$bc",
"--source-name=$source-name",
|("--stagestats" with %*COMPILING<%?OPTIONS><stagestats>),
$path
);

Expand All @@ -280,6 +287,11 @@ class CompUnit::PrecompilationRepository::Default does CompUnit::PrecompilationR
$err ~= $_
}
}
with %*COMPILING<%?OPTIONS><stagestats> {
whenever $proc.stderr.lines {
note(" $_");
}
}
whenever $proc.start(ENV => %env) {
$status = .exitcode
}
Expand All @@ -293,7 +305,7 @@ class CompUnit::PrecompilationRepository::Default does CompUnit::PrecompilationR
die $RMD ?? @result !! $err;
}

if not $RMD and $err -> $warnings {
if not $RMD and not %*COMPILING<%?OPTIONS><stagestats>:exists and $err -> $warnings {
$*ERR.print($warnings);
}
unless $bc.e {
Expand Down

0 comments on commit 238f8e5

Please sign in to comment.