Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixup for previous id change
The previous commit went to far. While the precomp ids may not depend on the
ever changing id of this repo, they still have to depend on the changing ids of
the repos down the chain.
  • Loading branch information
niner committed Nov 21, 2015
1 parent 9104866 commit ef03668
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/core/CompUnit/Repository/Installation.pm
Expand Up @@ -86,6 +86,12 @@ sub MAIN(:$name, :$auth, :$ver, *@, *%) {
$lookup.close;
}

method !precomp-id(Str $name) {
my $id = $name ~ self.path-spec;
$id ~= ',' ~ self.next-repo.id if self.next-repo;
nqp::sha1($id)
}

method install(:$dist!, *@files) {
$!lock.protect( {
my $path = self.writeable-path or die "No writeable path found";
Expand Down Expand Up @@ -122,7 +128,7 @@ sub MAIN(:$name, :$auth, :$ver, *@, *%) {
my $has-provides;
for @files -> $file is copy {
$file = $is-win ?? ~$file.subst('\\', '/', :g) !! ~$file;
my $id = nqp::sha1($file ~ self.prefix);
my $id = self!precomp-id($file);
my $destination = $sources-dir.child($id);
if [||] @provides>>.ACCEPTS($file) -> $/ {
my $name = $/.ast;
Expand Down Expand Up @@ -165,7 +171,7 @@ sub MAIN(:$name, :$auth, :$ver, *@, *%) {
for $d.provides.values.map(*.values[0]<file>) -> $file-id {
my $source = $sources-dir.child($file-id);
if $precomp.may-precomp {
my $id = nqp::sha1($source ~ self.prefix);
my $id = self!precomp-id($source.Str);
my $rev-deps-file = ($precomp.store.path($*PERL.compiler.id, $id) ~ '.rev-deps').IO;
my @rev-deps = $rev-deps-file.e ?? $rev-deps-file.lines !! ();

Expand Down Expand Up @@ -239,7 +245,7 @@ sub MAIN(:$name, :$auth, :$ver, *@, *%) {
);
my $handle;
if $precomp.may-precomp {
my $id = nqp::sha1($loader ~ self.prefix);
my $id = self!precomp-id($loader.Str);
if $*W and $*W.is_precompilation_mode {
say $id;
$handle = $precomp.load($id) or $precomp.precompile($loader, $id);
Expand Down

0 comments on commit ef03668

Please sign in to comment.