Raku / old-issue-tracker

Tickets from RT
https://github.com/Raku/old-issue-tracker/issues
2 stars 1 forks source link

OOM Killer bug with multiple -I CLI options #5069

Open p6rt opened 8 years ago

p6rt commented 8 years ago

Migrated from rt.perl.org#127329 (status was 'new')

Searchable as RT127329$

p6rt commented 8 years ago

From @drforr

Given the following (somewhat unusual) file layout​:

-- lib/Program.pm6 -- use Vector; # included in lib/Java class Program { } -- cut here --

-- lib/Java/Vector.pm6 -- use String; # Included in lib/Java class Vector { } -- cut here --

-- lib/Java/String.pm6 -- class String { } -- cut here --

invoke with​:

perl6 -c -Ilib -Ilib/Java lib/Program.pm6

Resolution order *should* go something like this (though I'm aware that @​INC is an old-fashioned notion)​:

read lib/Program.pm, attempt to resolve Vector. readdir lib/, find no Vector.pm or .pm6 readdir lib/Java, find Vector.pm6 Read lib/Java/Vector.pm6, attempt to resolve String. readdir lib/, find no String.pm or .pm6 readdir lib/Java, find String.pm6 Compile.

I'd accept OOM or looping (I've seen both behaviors while playing with this) if I were foolish enough to create mutually-recursive includes, although I would be surprised. There is no recursion, mutual or otherwise, going on here though. lib/Java is a subdirectory of lib/ and I'm well aware that could be playing havoc with file includes. I'm also aware that ordinarily lib/Java/Vector.pm6 would contain a class called 'class Java​::Vector { }', but I wanted to experiment with a slightly different kind of include style and ran across what appears to me to be a quirk.