Commit fe3e5c94 authored by Dominique Dumont's avatar Dominique Dumont

Imported Upstream version 2016.04

parent 3fd89ef7
......@@ -559,9 +559,6 @@ E: nlogan@gmail.com
N: Nick Wellnhofer
E: wellnhofer@aevum.de
N: niner
E: nine@detonation.org
N: Notfound
E: julian.notfound@gmail.com
......@@ -689,6 +686,7 @@ U: sorear
E: stefanor@cox.net
N: Stefan Seifert
U: niner
E: nine@detonation.org
N: Stephane cognominal Payrard
......
......@@ -5,6 +5,7 @@ LICENSE
MANIFEST
README.md
VERSION
appveyor.yml
blib/Perl6/.gitignore
docs/ChangeLog
docs/ROADMAP
......@@ -96,12 +97,14 @@ docs/announce/2015.12.md
docs/announce/2016.01.md
docs/announce/2016.02.md
docs/announce/2016.03.md
docs/announce/2016.04.md
docs/architecture.html
docs/architecture.svg
docs/compiler_overview.pod
docs/deprecations
docs/guide_to_setting.pod
docs/language_versions.md
docs/line-editor.pod
docs/metamodel.pod
docs/metaobject-api.pod
docs/module_management.md
......@@ -295,6 +298,7 @@ src/core/Process.pm
src/core/Promise.pm
src/core/PseudoStash.pm
src/core/QuantHash.pm
src/core/REPL.pm
src/core/Rakudo/Internals.pm
src/core/Range.pm
src/core/Rat.pm
......@@ -1747,6 +1751,7 @@ tools/build/create-moar-runner.pl
tools/build/gen-cat.nqp
tools/build/gen-version.pl
tools/build/install-core-dist.pl
tools/build/makeMAGIC_INC_DEC.pl6
tools/build/makeNATIVE_ARRAY.pl6
tools/build/makeSLICE.pl6
tools/build/moar_core_sources
......
......@@ -21,7 +21,7 @@ text file.
## Building and Installing Rakudo
[![Build Status](https://travis-ci.org/rakudo/rakudo.svg?branch=nom)](https://travis-ci.org/rakudo/rakudo)
[![Build Status](https://travis-ci.org/rakudo/rakudo.svg?branch=nom)](https://travis-ci.org/rakudo/rakudo) [![Build status](https://ci.appveyor.com/api/projects/status/github/rakudo/rakudo?svg=true)](https://ci.appveyor.com/project/rakudo/rakudo/branch/nom)
See the INSTALL.txt file for detailed prerequisites and build and
installation instructions.
......@@ -138,10 +138,6 @@ Linenoise is via [panda](https://github.com/tadzik/panda):
An alternative is to use a third-party program such as [rlwrap](http://utopia.knoware.nl/~hlub/uck/rlwrap/#rlwrap).
## How the compiler works
See `docs/compiler_overview.pod`.
## AUTHOR
Jonathan Worthington is the current pumpking for Rakudo Perl 6.
......
# Builds and tests rakudo for different configurations
# For appveyor.yml syntax reference, please see
# https://www.appveyor.com/docs/appveyor-yml
#
# JVM is already preinstalled in build worker. Please see
# https://www.appveyor.com/docs/installed-software#java
#
# Platforms (e.g. x64, x86)
platform:
- x64
# Operating system (build VM template)
os: Visual Studio 2015
configuration:
- Release
# Monitored branches
branches:
only:
- nom
- /smoke-me/
# To stop automatic build of VS solution files
build: off
# Build configurations
environment:
matrix:
- RAKUDO_OPTIONS: --backends=moar --gen-nqp --gen-moar
- RAKUDO_OPTIONS: --backends=moar --gen-nqp=master --gen-moar
- RAKUDO_OPTIONS: --backends=moar --gen-nqp=master --gen-moar=master
# - RAKUDO_OPTIONS: --backends=jvm --gen-nqp
# - RAKUDO_OPTIONS: --backends=jvm --gen-nqp=master
# Allow failures from certain build configuration
matrix:
fast_finish: true
# allow_failures:
# - platform: x64
# RAKUDO_OPTIONS: --backends=jvm --gen-nqp
# - platform: x64
# RAKUDO_OPTIONS: --backends=jvm --gen-nqp=master
# Installation
install:
- '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64'
- choco install strawberryperl
- SET PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%
- ECHO %RAKUDO_OPTIONS%
- CD %APPVEYOR_BUILD_FOLDER%
# Testing
test_script:
- perl Configure.pl %RAKUDO_OPTIONS% && nmake test
New in 2016.04
+ Fixes:
+ .combinations cleanup
+ "magic" inc/dec cleanup
+ utf8-c8 encoding crashes that occurred on random data
+ fix missing pre-comp store unlock
+ missing module error mentions line number
+ some JVM fixes
+ Additions:
+ Improved REPL
+ Add :kv to .first
+ Add provisional $*DEFAULT-READ-ELEMS
+ Efficiency:
+ Removed leaks associated with EVAL
+ Speed up .minpairs/.maxpairs
+ Speed up Object:D cmp Object:D
+ Speed up sort 3-15%
New in 2016.03
+ Fixes:
+ Buf.push|append|unshift|prepend now can take int arrays
......
# Announce: Rakudo Perl 6 compiler, Release #98 (2016.04)
On behalf of the Rakudo development team, I’m very happy to announce the
April 2016 release of Rakudo Perl 6 #98. Rakudo is an implementation of
Perl 6 on the Moar Virtual Machine[^1].
This release implements the 6.c version of the Perl 6 specifications.
It includes bugfixes and optimizations on top of
the 2015.12 release of Rakudo, but no new features.
Upcoming releases in 2016 will include new functionality that is not
part of the 6.c specification, available with a lexically scoped
pragma. Our goal is to insure that anything that is tested as part of the
6.c specification will continue to work unchanged. There may be incremental
spec releases this year as well.
The tarball for this release is available from <http://rakudo.org/downloads/rakudo/>.
Please note: This announcement is not for the Rakudo Star
distribution[^2] --- it’s announcing a new release of the compiler
only. For the latest Rakudo Star release, see
<http://rakudo.org/downloads/star/>.
The Rakudo Perl compiler follows a monthly release cycle, but please bear
with us post-Christmas. We are working hard to insure that we don’t break
anything now that we have a released spec, and it make take us a few months
to settle back into a rhythm.
The changes in this release are outlined below:
New in 2016.04:
+ Fixes:
+ "magic" inc/dec cleanup
+ utf8-c8 encoding crashes that occurred on random data
+ fix missing pre-comp store unlock
+ missing module error mentions line number
+ Additions:
+ Improved REPL
+ Add :kv to .first
+ Add provisional $*DEFAULT-READ-ELEMS
+ Efficiency:
+ Removed leaks associated with EVAL
+ Speed up .minpairs/.maxpairs
+ Speed up Object:D cmp Object:D
+ Speed up sort 3-15%
These are only some of the changes in this release. For a more
detailed list, see “docs/ChangeLog”.
The following people contributed to this release:
Pawel Murias, Elizabeth Mattijsen, Jonathan Worthington, Timo Paulssen,
Will "Coke" Coleda, Rob Hoelz, Larry Wall, Pepe Schwarz, Moritz Lenz,
Ahmad M. Zawawi, ab5tract, Christian Bartolomäus, Jonathan Scott Duff,
Stefan Seifert, Salve J. Nilsen, 0racle, Steve Mynott, Brad Gilbert,
Nelo Onyiah, Stéphane Payrard, bspecht, skids, Matthew Wilson,
Leon Timmermans, David Warring
If you would like to contribute or find out more information, visit
<http://perl6.org>, <http://rakudo.org/how-to-help>, ask on the
<perl6-compiler@perl.org> mailing list, or ask on IRC #perl6 on freenode.
The next release of Rakudo (#99), is tentatively scheduled for 21 May 2016.
A list of the other planned release dates is available in the
“docs/release_guide.pod” file.
The development team appreciates feedback! If you’re using Rakudo, do
get back to us. Questions, comments, suggestions for improvements, cool
discoveries, incredible hacks, or any other feedback -- get in touch with
us through (the above-mentioned) mailing list or IRC channel. Enjoy!
Please note that recent releases have known issues running on the JVM.
We are working to get the JVM backend working again but do not yet have
an estimated delivery date.
[^1]: See <http://moarvm.org/>
[^2]: What’s the difference between the Rakudo compiler and the Rakudo
Star distribution?
The Rakudo compiler is a compiler for the Perl 6 language.
Not much more.
The Rakudo Star distribution is the Rakudo compiler plus a selection
of useful Perl 6 modules, a module installer, the most recent
incarnation of the “Using Perl 6” book, and other software that can
be used with the Rakudo compiler to enhance its utility.
......@@ -2,6 +2,9 @@
=head1 RAKUDO COMPILER OVERVIEW
F<Please note: Parts of this overview are outdated since Rakudo does
no longer run on the Parrot Virtual Machine.>
=head2 How the Rakudo Perl 6 compiler works
This document describes the architecture and operation of the Rakudo
......
=head1 REPL LINE EDITOR
The read-eval-print-loop (aka. the REPL) has the abilty to load a line editor
module if one is available. This makes facilities such as line editing,
persistent history, and symbol completion.
If you don't have any line editing modules installed, you may use C<rlwrap> to
provide much of the same functionality.
=head2 AVAILABLE EDITORS
Right now, there are new line editor modules available: C<Readline> and C<Linenoise>.
They have roughly the same functionality, but C<Linenoise> provides tab completion,
and C<Readline> has an easier time with multibyte input.
=head2 ENVIRONMENT VARIABLES
The line editor used by the REPL can be configured via various environment
variables, listed here.
=over 4
=item RAKUDO_DISABLE_MULTILINE
This disables multi-line input for the REPL if truthy.
=item RAKUDO_HIST
This specifies the location of the history file used by the line editor; the
default is C<~/.perl6/rakudo-history>.
=item RAKUDO_LINE_EDITOR
This specifies the preferred line editor to use; valid values are C<Readline>,
C<Linenoise>, and C<none>. A value of C<none> is useful if you want to avoid
the recommendation message upon REPL startup.
=back
=cut
......@@ -17,7 +17,6 @@ Note that we are trying very hard to insure there are no backward
compatibility issues post Christmas. As such, we may end up delaying
some releases to insure any compatibility issues are resolved.
2016-04-16 Rakudo #98
2016-05-21 Rakudo #99
2016-06-18 Rakudo #100
2016-07-16 Rakudo #101
......@@ -119,7 +118,9 @@ You can get an automatically generated list by running
$ perl6 tools/contributors.pl6
Please check the result manually for duplicates and other errors.
Please check the result manually for duplicates and other errors. Note that
you may not be able to run your system perl6 in a local checkout, you may
have to wait until you build in this directory and use C<./perl6>.
$ git add docs/announce/YYYY.MM.md
$ git commit docs
......@@ -165,11 +166,27 @@ Make sure everything compiles and runs from a known clean state:
$ make realclean
$ perl Configure.pl --gen-moar --backends=ALL
$ make
$ make test
$ make install
$ (cd t/spec & git checkout master) # test latest language spec
$ make test
=item 11.
Install Inline::Perl5 so stresstest can use it.
$ git clone git@github.com:tadzik/panda.git
$ export PATH=`pwd`/install/bin:$PATH
$ cd panda; perl6 bootstrap.pl
$ cd ..
$ export PATH=`pwd`/share/perl6/site/bin:$PATH
$ panda install Inline::Perl5
=item 12.
Now run the stresstests for stable and lastest specs.
$ (cd t/spec && git checkout master) # test latest language spec
$ make stresstest
$ (cd t/spec & git checkout 6.c-errata) # test stable language spec
$ (cd t/spec && git checkout 6.c-errata) # test stable language spec
$ make stresstest
There are many tests to run for the stresstest target. If
......@@ -181,15 +198,18 @@ execute that last as
where 4 is the number of CPU cores. This should make the
total time to execute all of the tests dramatically less.
Note that any failures against the stable language spec must be
fixed before a release can be made.
Note that any failures against the stable language spec B<must> be
fixed before a release can be made. Also, you will see warnings about
missing test files; this is because we only have one list of files,
and new tests may have been added after the last version of the spec
was frozen.
Continue adjusting things until make stresstest passes as expected.
Often this means fixing a bug, fudging a test, or (temporarily?)
commenting out a test file in t/spectest.data . Use your best
judgment or ask others if uncertain what to do here.
=item 11.
=item 13.
Create a tarball by entering C<make release VERSION=YYYY.MM>,
where YYYY.MM is the month for which the release is being made.
......@@ -201,13 +221,15 @@ So please make a backup if you have any important data in there.
Because we tested the stable language spec last, above, those
are the tests that will end up in the release tarball.
=item 12.
=item 14.
Unpack the tar file into another area, and test that it
builds and runs properly using the same process in step 10.
builds and runs properly using the same process in steps 10-12.
For step 12, just run "make stresstest"; you're only testing
the official spec tests here, and cannot switch between branches.
If there are any problems, fix them and go back to step 10.
=item 13.
=item 15.
Tag the release by its release month ("YYYY.MM") and its code name.
......@@ -221,13 +243,13 @@ If you have no PGP key, you might need to
L<create one first|https://fedoraproject.org/wiki/Creating_GPG_Keys>. Should
that prove impossible, you can omit the C<-s> from the command line.
=item 14.
=item 16.
Sign the tarball with your PGP key:
$ gpg -b --armor rakudo-YYYY-MM.tar.gz
=item 15.
=item 17.
Upload the tarball and the signature to L<http://rakudo.org/downloads/rakudo>:
......@@ -235,9 +257,10 @@ Upload the tarball and the signature to L<http://rakudo.org/downloads/rakudo>:
rakudo@rakudo.org:public_html/downloads/rakudo/
If you do not have permissions for that, ask one of (pmichaud, jnthn, FROGGS,
masak, tadzik, moritz, PerlJam, [Coke], lizmat, timotimo, fsergot)) on #perl6 to do it for you.
masak, tadzik, moritz, PerlJam/perlpilot, [Coke], lizmat, timotimo, fsergot))
on #perl6 to do it for you.
=item 16.
=item 18.
To avoid public confusion with Rakudo Star releases, we now publish
compiler release announcements ONLY to perl6-compiler@perl.org.
......@@ -248,11 +271,11 @@ announcement for both.)
Don’t send out any announcements until the files are actually available
per step 14 above.
=item 17.
=item 19.
Update the Wikipedia entry at L<http://en.wikipedia.org/wiki/Rakudo>.
=item 18.
=item 20.
You’re done! Celebrate with the appropriate amount of fun.
......@@ -354,6 +377,7 @@ Previous releases were bundled as part of monthly Parrot releases.
2016-02-02 2016.01.1 (Coke)
2016-02-21 Rakudo #96 "2016.02" (Coke)
2016-03-23 Rakudo #97 "2016.03" (Coke)
2016-04-16 Rakudo #98 "2016.04" (Coke)
=head1 COPYRIGHT
......
=begin pod
=head1 NAME
perl6 - Rakudo Perl 6 Compiler
......@@ -18,15 +20,18 @@ compiled code.
-h, --help display this help text
-n run program once for each line of input
-p same as -n, but also print $_ at the end of lines
-I path adds the path to the module search path
-M module loads the module prior to running the program
--target=[stage] specify compilation stage to emit
--optimize=[level] use the given level of optimization (0..3)
--encoding=[mode] specify string encoding mode
--output=[name] specify name of output file
-o, --output=[name] specify name of output file
-v, --version display version information
--stagestats display time spent in the compilation stages
--ll-exception display a low level backtrace on errors
--profile write profile information as HTML file (MoarVM)
--profile-filename=[name]
specify an alternate profile output file
--profile-filename provide a different filename (also allows .json)
--doc=[module] Use Pod::To::[module] to render inline documentation.
Note that only boolean single-letter options may be bundled.
......@@ -136,8 +141,6 @@ C<IO::Spec::Cygwin> inherits this from C<IO::Spec::Unix>.
C<IO::Spec::Win32.path> will read the first defined of either C<%PATH%> or C<%Path%> as a
semicolon-delimited list.
=back
=head1 AUTHORS
Written by the Rakudo contributors, see the CREDITS file.
......@@ -145,4 +148,4 @@ Written by the Rakudo contributors, see the CREDITS file.
This manual page was written by Reini Urban, Moritz Lenz and the Rakudo
contributors.
=cut
=end pod
......@@ -1733,6 +1733,10 @@ class Perl6::Actions is HLL::Actions does STDActions {
}
method statement_control:sym<import>($/) {
# NB: Grammar already passed arglist directly to World, but this seems soon enough to want it.
if $<arglist> {
WANTED($<arglist><EXPR>.ast, 'import');
}
my $past := QAST::WVal.new( :value($*W.find_symbol(['Nil'])) );
make $past;
}
......@@ -7367,7 +7371,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
method rx_adverbs($/) {
my @pairs;
for $<quotepair> {
nqp::push(@pairs, $_.ast);
nqp::push(@pairs, wanted($_.ast,'rx_adverbs'));
}
make @pairs;
}
......
This diff is collapsed.
......@@ -46,6 +46,17 @@ class Perl6::Metamodel::DefiniteHOW
}
}
method shortname($definite_type) {
if nqp::isnull(nqp::typeparameterized($definite_type)) {
'?:?'
}
else {
my $base_type := nqp::typeparameterat($definite_type, 0);
my $definite := nqp::typeparameterat($definite_type, 1);
$base_type.HOW.shortname($base_type) ~ ':' ~ ($definite ?? 'D' !! 'U')
}
}
sub check_instantiated($definite_type) {
nqp::die('Cannot perform this operation on an uninstantiated definite type')
if nqp::isnull(nqp::typeparameterized($definite_type));
......
......@@ -4,9 +4,7 @@ role Perl6::Metamodel::Naming {
method set_name($obj, $name) {
$!name := $name;
my @parts := nqp::split('::', $name);
#?if moar
nqp::setdebugtypename($obj, $name);
#?endif
$!shortname := @parts ?? @parts[nqp::elems(@parts) - 1] !! '';
}
method name($obj) {
......
......@@ -980,6 +980,7 @@ class Perl6::World is HLL::World {
:from(%opts<from> // 'Perl6'),
:auth-matcher(%opts<auth> // $true),
:version-matcher(%opts<ver> // $true),
:source-line-number($line)
);
self.add_object($spec);
my $registry := self.find_symbol(['CompUnit', 'RepositoryRegistry']);
......
This diff is collapsed.
my class Exception { ... }
my class Backtrace { ... }
my class CompUnit::RepositoryRegistry is repr('Uninstantiable') { ... }
my $RAKUDO-VERBOSE-STACKFRAME;
......@@ -94,6 +95,11 @@ my class Backtrace {
my $file := $annotations<file>;
next unless $file;
my @parts = $file.split('#', 2);
if @parts.elems == 2 {
$file := CompUnit::RepositoryRegistry.repository-for-name(@parts[0]).prefix.child(@parts[1]).abspath;
}
# now *that's* an evil hack
next if $file.ends-with('BOOTSTRAP.nqp')
|| $file.ends-with('QRegex.nqp')
......
......@@ -32,6 +32,8 @@ BEGIN {
Bool.^add_method('pred', my method pred() { Bool::False });
Bool.^add_method('succ', my method succ() { Bool::True });
Bool.^add_method('enums', my method enums() { self.^enum_values });
Bool.^compose;
}
......
class CompUnit::DependencySpecification {
has Str:D $.short-name is required;
has Str:D $.short-name is required;
has Int:D $.source-line-number = 0;
has Str:D $.from = 'Perl6';
has $.version-matcher = True;
has $.auth-matcher = True;
......
......@@ -23,11 +23,11 @@ class CompUnit::PrecompilationRepository::Default does CompUnit::PrecompilationR
my $lle;
my $profile;
method try-load(CompUnit::PrecompilationId $id, IO::Path $source) returns CompUnit::Handle {
method try-load(CompUnit::PrecompilationId $id, IO::Path $source, :$source-name) returns CompUnit::Handle {
my $handle = (
self.may-precomp and (
self.load($id, :since($source.modified)) # already precompiled?
or self.precompile($source, $id) and self.load($id) # if not do it now
or self.precompile($source, $id, :$source-name) and self.load($id) # if not do it now
)
);
my $precompiled = ?$handle;
......@@ -89,7 +89,13 @@ class CompUnit::PrecompilationRepository::Default does CompUnit::PrecompilationR
if $path {
my $modified = $path.modified;
if (not $since or $modified > $since) and self!load-dependencies($path, $modified) {
%!loaded{$id} //= self!load-handle-for-path($path)
with %!loaded{$id} {
self.store.unlock;
$_
}
else {
%!loaded{$id} = self!load-handle-for-path($path)
}
}
else {
if $*RAKUDO_MODULE_DEBUG -> $RMD {
......@@ -107,7 +113,7 @@ class CompUnit::PrecompilationRepository::Default does CompUnit::PrecompilationR
}
}
method precompile(IO::Path:D $path, CompUnit::PrecompilationId $id, Bool :$force = False) {
method precompile(IO::Path:D $path, CompUnit::PrecompilationId $id, Bool :$force = False, :$source-name) {
my $compiler-id = $*PERL.compiler.id;
my $io = self.store.destination($compiler-id, $id);
my $RMD = $*RAKUDO_MODULE_DEBUG;
......@@ -141,6 +147,7 @@ class CompUnit::PrecompilationRepository::Default does CompUnit::PrecompilationR
$profile,
"--target=" ~ Rakudo::Internals.PRECOMP-TARGET,
"--output=$io",
"--source-name=$source-name",
$path,
:out,
:err,
......
......@@ -75,7 +75,7 @@ class CompUnit::Repository::FileSystem does CompUnit::Repository::Locally does C
my $id = nqp::sha1($name ~ $*REPO.id);
my $*RESOURCES = Distribution::Resources.new(:repo(self), :dist-id(''));
my $handle = $precomp.try-load($id, $file);
my $handle = $precomp.try-load($id, $file, :source-name("$file ($spec.short-name())"));
my $precompiled = defined $handle;
$handle //= CompUnit::Loader.load-source-file($file); # precomp failed
......
......@@ -126,6 +126,13 @@ sub MAIN(:$name is copy, :$auth, :$ver, *@, *%) {
nqp::sha1($id)
}
method !repo-prefix() {
my $repo-prefix = CompUnit::RepositoryRegistry.name-for-repository(self) // '';
$repo-prefix ~= '#' if $repo-prefix;
$repo-prefix
}
method install(Distribution $dist, %sources, %scripts?, %resources?, :$force) {
$!lock.protect( {
my @*MODULES;
......@@ -199,23 +206,41 @@ sub MAIN(:$name is copy, :$auth, :$ver, *@, *%) {
$dist-dir.child($dist-id).spurt: to-json($dist.Hash);
my $precomp = $*REPO.precomp-repository;
my $*RESOURCES = Distribution::Resources.new(:repo(self), :$dist-id);
my %done;
for $dist.provides.values.map(*.values[0]<file>) -> $id {
my $source = $sources-dir.child($id);
if $precomp.may-precomp {
my $repo-prefix = self!repo-prefix;
if $precomp.may-precomp {
my $*RESOURCES = Distribution::Resources.new(:repo(self), :$dist-id);
my %done;
for $dist.provides.kv -> $source-name, $ext {
my $id = $ext.values[0]<file>;
my $source = $sources-dir.child($id);
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 !! ();
if %done{$id} { note "(Already did $id)" if $verbose; next }
note("Precompiling $id") if $verbose;
$precomp.precompile($source.IO, $id, :force);
if %done{$id} {
note "(Already did $id)" if $verbose;
next;
}
note("Precompiling $id ($source-name)") if $verbose;
$precomp.precompile(
$source.IO,
$id,
:force,
:source-name("$repo-prefix$source.relative($.prefix) ($source-name)"),
);
%done{$id} = 1;
for @rev-deps -> $rev-dep-id {
if %done{$rev-dep-id} { note "(Already did $rev-dep-id)" if $verbose; next }
note("Precompiling $rev-dep-id") if $verbose;
if %done{$rev-dep-id} {
note "(Already did $rev-dep-id)" if $verbose;
next;
}
note("Precompiling rev-dep $rev-dep-id") if $verbose;
my $source = $sources-dir.child($rev-dep-id);
$precomp.precompile($source, $rev-dep-id, :force) if $source.e;
$precomp.precompile(
$source,
$rev-dep-id,
:force,
:source-name($repo-prefix ~ $source.relative($.prefix))
) if $source.e;
%done{$rev-dep-id} = 1;
}
}
......@@ -333,7 +358,12 @@ sub MAIN(:$name is copy, :$auth, :$ver, *@, *%) {
);
my $*RESOURCES = Distribution::Resources.new(:repo(self), :$dist-id);
my $id = $loader.basename;
my $handle = $precomp.try-load($id, $loader);
my $repo-prefix = self!repo-prefix;
my $handle = $precomp.try-load(
$id,
$loader,
:source-name("$repo-prefix$loader.relative($.prefix) ($spec.short-name())"),
);
my $precompiled = defined $handle;
$handle //= CompUnit::Loader.load-source-file($loader);
......
......@@ -179,6 +179,16 @@ class CompUnit::RepositoryRegistry {
!! Nil
}
method name-for-repository(CompUnit::Repository $repo) {
$*REPO; # initialize if not yet done
my $iter := nqp::iterator($custom-lib);
while $iter {
my \pair = nqp::shift($iter);
return nqp::iterkey_s(pair) if nqp::iterval(pair).prefix eq $repo.prefix;
}
Nil
}
method head() { # mostly usefull for access from NQP
$*REPO
}
......
......@@ -34,7 +34,6 @@ class Distribution {
}