Skip to content

Commit

Permalink
Show :auth:ver:api of module loaded
Browse files Browse the repository at this point in the history
if the RAKUDO_MODULE_DEBUG=1 environment variable is set
  • Loading branch information
lizmat committed Dec 27, 2023
1 parent 57bda88 commit 91a062d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Perl6/World.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -1499,6 +1499,16 @@ class Perl6::World is HLL::World {
self.add_object_if_no_sc($spec);
my $registry := self.find_symbol(['CompUnit', 'RepositoryRegistry'], :setting-only);
my $comp_unit := $registry.head.need($spec);
if $RMD {

This comment has been minimized.

Copy link
@ugexe

ugexe Dec 27, 2023

Member

Seems like this could just use $comp_unit.distribution.Str to build this instead. Further, .distribution.Str uses the order $name$version$auth$api (while the order doesn't technically matter we should try to keep it consistent in the core and if we did change the order it should probably be $name$auth$api$version).

This comment has been minimized.

Copy link
@ugexe

ugexe Dec 27, 2023

Member

Actually I'm not sure if we can use .distribution.Str since things like Foo:from<Perl5> wouldn't have a distribution set. However, that also suggest that these changes are missing :from<...> for non-Raku modules.

This comment has been minimized.

Copy link
@lizmat

lizmat Dec 28, 2023

Author Contributor

Addressed in fcf22b4f3f . Conformed the order in the case if there is no .distribution with the order as supplied in .distribution.Str. If that order changes, this will also have to be changed here.

my $name := $comp_unit.short-name;
my $auth := $comp_unit.auth;
$auth := $auth ?? ":auth<$auth>" !! '';
my $version := $comp_unit.version;
$version := $version ?? ':ver<' ~ $version.Str ~ '>' !! '';

This comment has been minimized.

Copy link
@ugexe

ugexe Dec 27, 2023

Member

I'm not sure this is correct -- :ver<0> is not the same as having no ver field at all

This comment has been minimized.

Copy link
@lizmat

lizmat Dec 28, 2023

Author Contributor

Addressed in fcf22b4f3f

my $api := $comp_unit.api;
$api := $api ?? ':api<' ~ $api.Str ~ '>' !! '';
$RMD("Loaded $name$auth$version$api");
}
my $globalish := $comp_unit.handle.globalish-package;
nqp::gethllsym('Raku','ModuleLoader').merge_globals_lexically(self, $cur_GLOBALish, $globalish);

Expand Down

0 comments on commit 91a062d

Please sign in to comment.