Skip to content
Permalink
Browse files

Precompile a dist's modules in predictable order on installation

  • Loading branch information...
niner committed May 1, 2019
1 parent 4d44bd9 commit 8ec2c43f1a1338ca5d1b120ad8defdeb55892597
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/core/CompUnit/Repository/Installation.pm6
@@ -263,25 +263,25 @@ sub MAIN(:$name, :$auth, :$ver, *@, *%) {
my %done;

my $compiler-id = CompUnit::PrecompilationId.new-without-check($*PERL.compiler.id);
for %provides.kv -> $source-name, $source-meta {
my $id = CompUnit::PrecompilationId.new-without-check($source-meta.values[0]<file>);
for %provides.sort {
my $id = CompUnit::PrecompilationId.new-without-check($_.value.values[0]<file>);
$precomp.store.delete($compiler-id, $id);
}

for %provides.kv -> $source-name, $source-meta {
my $id = $source-meta.values[0]<file>;
for %provides.sort {
my $id = $_.value.values[0]<file>;
my $source = $sources-dir.add($id);
my $source-file = $repo-prefix ?? $repo-prefix ~ $source.relative($.prefix) !! $source;

if %done{$id} {
note "(Already did $id)" if $verbose;
next;
}
note("Precompiling $id ($source-name)") if $verbose;
note("Precompiling $id ($_.key())") if $verbose;
$precomp.precompile(
$source,
CompUnit::PrecompilationId.new-without-check($id),
:source-name("$source-file ($source-name)"),
:source-name("$source-file ($_.key())"),
);
%done{$id} = 1;
}

0 comments on commit 8ec2c43

Please sign in to comment.
You can’t perform that action at this time.