rakudo / rakudo

🦋 Rakudo – Raku on MoarVM, JVM, and JS
https://rakudo.org/
Artistic License 2.0
1.73k stars 374 forks source link

CompUnit::Repository::Staging: No such method 'need' for invocant of type 'Any' #4799

Closed hythm7 closed 2 years ago

hythm7 commented 2 years ago

The Problem

useing a distribution from a CompUnit::Repository::Staging fails with the above error if there is use lib 'lib' statement in the file, it creates lib/.precomp in CWD, which seems messes up precompilation.

Expected Behavior

It shouldn't matter if there is a use lib 'lib' in the program.

Actual Behavior

Fails with the above error if: 1- the program has a use lib 'lib' before useing the module 2- running the program from the root directory of the distribution if any of the above not true, no error happens.

Steps to Reproduce

# create a working dir
mkdir /tmp/test
cd /tmp/test/

# cloning modules for the test case
git clone -q https://github.com/labster/p6-file-directory-tree.git # needed as a dependency
git clone -q https://github.com/rbt/raku-File-Temp.git

# download `install-dist.raku` script from rakudo
wget -q https://raw.githubusercontent.com/rakudo/rakudo/master/tools/install-dist.raku

# Staging the distribution
raku install-dist.raku --from=p6-file-directory-tree/ --to=/tmp/test/staging --for=home  # staging the dependency
echo 2 > /tmp/test/staging/version # make sure the repo is version 2
raku install-dist.raku --from=raku-File-Temp/ --to=/tmp/test/staging --for=home          # staging the distribution
echo 2 > /tmp/test/staging/version

# change to the dist directory 
cd raku-File-Temp/

# run program that has `use lib 'lib'`
raku -I 'CompUnit::Repository::Staging#name(home)#/tmp/test/staging' /tmp/test/raku-File-Temp/t/01-load.t 
===SORRY!=== Error while compiling /tmp/test/raku-File-Temp/t/01-load.t
===SORRY!=== Error while compiling /tmp/test/raku-File-Temp/lib/File/Temp.rakumod (File::Temp)
No such method 'need' for invocant of type 'Any'.  Did you mean any of
these: 'end', 'head', 'new'?

# change to any other directory, no errors 
cd ..
raku -I 'CompUnit::Repository::Staging#name(home)#/tmp/test/staging' /tmp/test/raku-File-Temp/t/01-load.t 
1..2
ok 1 - 'use File::Temp' worked !
ok 2 - File::Temp module can be use-d ok

Worth mentioning that the error happens only when loading a dependency. meaning no error happens if doing the same thing for a distribution that doesn't depend on any module. for example running: raku -I 'CompUnit::Repository::Staging#name(home)#/tmp/test/staging' /tmp/test/p6-file-directory-tree/t/basic.t works without error, althoughit is run from withing the root directory of the dist and it has use lib 'lib'

The output for the error with RAKUDO_MODULE_DEBUG=1

RAKUDO_MODULE_DEBUG=1 raku -I 'CompUnit::Repository::Staging#name(home)#/tmp/test/staging' /tmp/test/raku-File-Temp/t/01-load.t 

 1 RMD: Requested for settings CORE.d
 1 RMD: Loading settings CORE.d
 1 RMD: Loading bytecode from CORE.d.setting.moarvm
 1 RMD: going to load Perl6::BOOTSTRAP::v6d
 1 RMD: Requested for settings CORE.c
 1 RMD: Loading settings CORE.c
 1 RMD: Loading bytecode from CORE.c.setting.moarvm
 1 RMD: going to load Perl6::BOOTSTRAP::v6c
 1 RMD: Settings CORE.c loaded
 1 RMD: Settings CORE.d loaded
 1 RMD: Requested for settings CORE.d
 1 RMD: Attempting 'lib' as a pragma
 1 RMD: Parsing specs: CompUnit::Repository::Staging#name(home)#/tmp/test/staging
 1 RMD: try-load 70EBDA25F44EBFF8734F739F5779D64914083409: /home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/core/sources/70EBDA25F44EBFF8734F739F5779D64914083409
 1 RMD: Trying to load 70EBDA25F44EBFF8734F739F5779D64914083409 from /home/hythm/.raku/precomp
 1 RMD: Trying to load 70EBDA25F44EBFF8734F739F5779D64914083409 from /home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/site/precomp
 1 RMD: Trying to load 70EBDA25F44EBFF8734F739F5779D64914083409 from /home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/vendor/precomp
 1 RMD: Trying to load 70EBDA25F44EBFF8734F739F5779D64914083409 from /home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/core/precomp
 1 RMD: Trying to load 70EBDA25F44EBFF8734F739F5779D64914083409.repo-id from /home/hythm/.raku/precomp
 1 RMD: Repo changed:
          AC3DB13075D4285C847E21235193CF0BEF98739A
          FB1B9DDBFE1E8124D5ADA982889EB4EB857DE83D
        Need to re-check dependencies.
 1 RMD: Repo chain changed:
          AC3DB13075D4285C847E21235193CF0BEF98739A
          FB1B9DDBFE1E8124D5ADA982889EB4EB857DE83D
        Need to re-check dependencies.
 1 RMD: Loading precompiled
        /home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/core/precomp/E1DDD8BF4A6E313A4834B8A0041DD9F9CF9297AD/70/70EBDA25F44EBFF8734F739F5779D64914083409
 1 RMD: Requested for settings CORE.d
 1 RMD: Successfully handled 'lib' as a pragma
 1 RMD: Attempting 'Test' as a pragma
 1 RMD:   'Test' is not a valid pragma
 1 RMD: Attempting to load 'Test'
 1 RMD:   Late loading 'Test'
 1 RMD: try-load 2D4A7CA10695CD2B374573413D261A660E282E2A: /home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/core/sources/2D4A7CA10695CD2B374573413D261A660E282E2A
 1 RMD: Trying to load 2D4A7CA10695CD2B374573413D261A660E282E2A from /tmp/test/raku-File-Temp/lib/.precomp
 1 RMD: Trying to load 2D4A7CA10695CD2B374573413D261A660E282E2A from /tmp/test/staging/precomp
 1 RMD: Trying to load 2D4A7CA10695CD2B374573413D261A660E282E2A from /home/hythm/.raku/precomp
 1 RMD: Trying to load 2D4A7CA10695CD2B374573413D261A660E282E2A from /home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/site/precomp
 1 RMD: Trying to load 2D4A7CA10695CD2B374573413D261A660E282E2A from /home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/vendor/precomp
 1 RMD: Trying to load 2D4A7CA10695CD2B374573413D261A660E282E2A from /home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/core/precomp
 1 RMD: Trying to load 2D4A7CA10695CD2B374573413D261A660E282E2A.repo-id from /tmp/test/raku-File-Temp/lib/.precomp
 1 RMD: Repo changed:
          AC3DB13075D4285C847E21235193CF0BEF98739A
          9EB60F9AD03F9A6ADB48821008B9CBBB12D9C116
        Need to re-check dependencies.
 1 RMD: Repo chain changed:
          AC3DB13075D4285C847E21235193CF0BEF98739A
          FB1B9DDBFE1E8124D5ADA982889EB4EB857DE83D
        Need to re-check dependencies.
 1 RMD: Loading precompiled
        /home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/core/precomp/E1DDD8BF4A6E313A4834B8A0041DD9F9CF9297AD/2D/2D4A7CA10695CD2B374573413D261A660E282E2A
 1 RMD: Requested for settings CORE.c
 1 RMD: Performing imports for 'Test'
 1 RMD: Imports for 'Test' done
 1 RMD: Attempting 'File::Temp' as a pragma
 1 RMD:   'File::Temp' is not a valid pragma
 1 RMD: Attempting to load 'File::Temp'
 1 RMD:   Late loading 'File::Temp'
 1 RMD: try-load 86CB8D7862063FD44A70DB1398477D85BEB819C9: /tmp/test/raku-File-Temp/lib/File/Temp.rakumod
 1 RMD: Trying to load 86CB8D7862063FD44A70DB1398477D85BEB819C9 from /tmp/test/raku-File-Temp/lib/.precomp
 1 RMD: Trying to load 86CB8D7862063FD44A70DB1398477D85BEB819C9 from /tmp/test/staging/precomp
 1 RMD: Trying to load 86CB8D7862063FD44A70DB1398477D85BEB819C9 from /home/hythm/.raku/precomp
 1 RMD: Trying to load 86CB8D7862063FD44A70DB1398477D85BEB819C9 from /home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/site/precomp
 1 RMD: Trying to load 86CB8D7862063FD44A70DB1398477D85BEB819C9 from /home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/vendor/precomp
 1 RMD: Trying to load 86CB8D7862063FD44A70DB1398477D85BEB819C9 from /home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/core/precomp
 1 RMD: Precompiling /tmp/test/raku-File-Temp/lib/File/Temp.rakumod into /tmp/test/raku-File-Temp/lib/.precomp/E1DDD8BF4A6E313A4834B8A0041DD9F9CF9297AD/86/86CB8D7862063FD44A70DB1398477D85BEB819C9.bc (   )
 2     RMD: Requested for settings CORE.d
 2     RMD: Loading settings CORE.d
 2     RMD: Loading bytecode from CORE.d.setting.moarvm
 2     RMD: going to load Perl6::BOOTSTRAP::v6d
 2     RMD: Requested for settings CORE.c
 2     RMD: Loading settings CORE.c
 2     RMD: Loading bytecode from CORE.c.setting.moarvm
 2     RMD: going to load Perl6::BOOTSTRAP::v6c
 2     RMD: Settings CORE.c loaded
 2     RMD: Settings CORE.d loaded
 2     RMD: Attempting 'File::Directory::Tree' as a pragma
 2     RMD:   'File::Directory::Tree' is not a valid pragma
 2     RMD: Attempting to load 'File::Directory::Tree'
 2     RMD:   Late loading 'File::Directory::Tree'
 2     RMD: try-load 70EBDA25F44EBFF8734F739F5779D64914083409: /home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/core/sources/70EBDA25F44EBFF8734F739F5779D64914083409
 2     RMD: Trying to load 70EBDA25F44EBFF8734F739F5779D64914083409 from /home/hythm/.raku/precomp
 2     RMD: Trying to load 70EBDA25F44EBFF8734F739F5779D64914083409 from /home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/site/precomp
 2     RMD: Trying to load 70EBDA25F44EBFF8734F739F5779D64914083409 from /home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/vendor/precomp
 2     RMD: Trying to load 70EBDA25F44EBFF8734F739F5779D64914083409 from /home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/core/precomp
 2     RMD: Trying to load 70EBDA25F44EBFF8734F739F5779D64914083409.repo-id from /home/hythm/.raku/precomp
 2     RMD: Repo changed:
              AC3DB13075D4285C847E21235193CF0BEF98739A
              FB1B9DDBFE1E8124D5ADA982889EB4EB857DE83D
            Need to re-check dependencies.
 2     RMD: Repo chain changed:
              AC3DB13075D4285C847E21235193CF0BEF98739A
              FB1B9DDBFE1E8124D5ADA982889EB4EB857DE83D
            Need to re-check dependencies.
 2     RMD: Loading precompiled
            /home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/core/precomp/E1DDD8BF4A6E313A4834B8A0041DD9F9CF9297AD/70/70EBDA25F44EBFF8734F739F5779D64914083409
 2     RMD: Requested for settings CORE.d
===SORRY!=== Error while compiling /tmp/test/raku-File-Temp/lib/File/Temp.rakumod (File::Temp)
No such method 'need' for invocant of type 'Any'.  Did you mean any of
these: 'end', 'head', 'new'?
at /tmp/test/raku-File-Temp/lib/File/Temp.rakumod (File::Temp):3
 1 RMD: Precompiling /tmp/test/raku-File-Temp/lib/File/Temp.rakumod failed: 1
===SORRY!=== Error while compiling /tmp/test/raku-File-Temp/t/01-load.t

at /tmp/test/raku-File-Temp/t/01-load.t:9

Environment

hythm7 commented 2 years ago

Output with --ll-exception:

 raku --ll-exception -I 'CompUnit::Repository::Staging#name(home)#/tmp/test/staging' /tmp/test/raku-File-Temp/t/01-load.t 
No such method 'need' for invocant of type 'Any'.  Did you mean any of
these: 'end', 'head', 'new'?
   at SETTING::src/core.c/Exception.pm6:62  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/runtime/CORE.c.setting.moarvm:throw)
 from gen/moar/Metamodel.nqp:60  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Metamodel.moarvm:throw_or_die)
 from gen/moar/BOOTSTRAP/v6c.nqp:5336  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/BOOTSTRAP/v6c.moarvm:report-method-not-found)
 from gen/moar/BOOTSTRAP/v6c.nqp:5311  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/BOOTSTRAP/v6c.moarvm:)
 from gen/moar/World.nqp:1478  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/World.moarvm:load_module)
 from gen/moar/World.nqp:1428  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/World.moarvm:do_pragma_or_load_module)
 from gen/moar/Grammar.nqp:1314  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:statement_control:sym<use>)
 from gen/moar/stage2/QRegex.nqp:1704  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/QRegex.moarvm:!protoregex)
 from <unknown>:1  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:statement_control)
 from gen/moar/Grammar.nqp:962  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:statement)
 from gen/moar/Grammar.nqp:890  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:statementlist)
 from gen/moar/Grammar.nqp:2213  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:package_def)
 from <unknown>:1  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:package_declarator:sym<module>)
 from gen/moar/stage2/QRegex.nqp:1704  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/QRegex.moarvm:!protoregex)
 from <unknown>:1  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:package_declarator)
 from gen/moar/Grammar.nqp:2302  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:scoped)
 from <unknown>:1  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:scope_declarator:sym<unit>)
 from gen/moar/stage2/QRegex.nqp:1704  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/QRegex.moarvm:!protoregex)
 from <unknown>:1  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:scope_declarator)
 from <unknown>:1  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:term:sym<scope_declarator>)
 from gen/moar/stage2/QRegex.nqp:1704  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/QRegex.moarvm:!protoregex)
 from <unknown>:1  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:term)
 from gen/moar/Grammar.nqp:3720  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:termish)
 from gen/moar/stage2/NQPHLL.nqp:1249  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:EXPR)
 from gen/moar/Grammar.nqp:3763  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:EXPR)
 from gen/moar/Grammar.nqp:962  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:statement)
 from gen/moar/Grammar.nqp:890  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:statementlist)
 from gen/moar/stage2/NQPHLL.nqp:1471  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:LANG)
 from gen/moar/Grammar.nqp:1342  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:FOREIGN_LANG)
 from gen/moar/Grammar.nqp:838  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:comp_unit)
 from gen/moar/Grammar.nqp:553  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:TOP)
 from gen/moar/stage2/QRegex.nqp:2267  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/QRegex.moarvm:parse)
 from gen/moar/stage2/NQPHLL.nqp:2301  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:parse)
 from gen/moar/stage2/NQPHLL.nqp:2217  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:execute_stage)
 from gen/moar/stage2/NQPHLL.nqp:2252  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:run)
 from gen/moar/stage2/NQPHLL.nqp:2248  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:)
 from gen/moar/stage2/NQPHLL.nqp:2244  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:compile)
 from gen/moar/stage2/NQPHLL.nqp:1919  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:eval)
 from gen/moar/stage2/NQPHLL.nqp:2154  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:evalfiles)
 from gen/moar/stage2/NQPHLL.nqp:2114  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:command_eval)
 from gen/moar/Compiler.nqp:111  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Compiler.moarvm:command_eval)
 from gen/moar/stage2/NQPHLL.nqp:2039  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:command_line)
 from gen/moar/rakudo.nqp:140  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/runtime/perl6.moarvm:MAIN)
 from gen/moar/rakudo.nqp:1  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/runtime/perl6.moarvm:<mainline>)
 from <unknown>:1  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/runtime/perl6.moarvm:<main>)
 from <unknown>:1  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/runtime/perl6.moarvm:<entry>)

   at SETTING::src/core.c/Exception.pm6:62  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/runtime/CORE.c.setting.moarvm:throw)
 from SETTING::src/core.c/control.pm6:255  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/runtime/CORE.c.setting.moarvm:die)
 from SETTING::src/core.c/CompUnit/PrecompilationRepository.pm6:456  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/runtime/CORE.c.setting.moarvm:precompile)
 from SETTING::src/core.c/CompUnit/PrecompilationRepository.pm6:59  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/runtime/CORE.c.setting.moarvm:try-load)
 from SETTING::src/core.c/CompUnit/Repository/FileSystem.pm6:89  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/runtime/CORE.c.setting.moarvm:)
 from SETTING::src/core.c/CompUnit/Repository/FileSystem.pm6:83  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/runtime/CORE.c.setting.moarvm:need)
 from gen/moar/World.nqp:1478  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/World.moarvm:load_module)
 from gen/moar/World.nqp:1428  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/World.moarvm:do_pragma_or_load_module)
 from gen/moar/Grammar.nqp:1314  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:statement_control:sym<use>)
 from gen/moar/stage2/QRegex.nqp:1704  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/QRegex.moarvm:!protoregex)
 from <unknown>:1  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:statement_control)
 from gen/moar/Grammar.nqp:962  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:statement)
 from gen/moar/Grammar.nqp:890  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:statementlist)
 from gen/moar/stage2/NQPHLL.nqp:1471  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:LANG)
 from gen/moar/Grammar.nqp:1342  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:FOREIGN_LANG)
 from gen/moar/Grammar.nqp:838  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:comp_unit)
 from gen/moar/Grammar.nqp:553  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Grammar.moarvm:TOP)
 from gen/moar/stage2/QRegex.nqp:2267  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/QRegex.moarvm:parse)
 from gen/moar/stage2/NQPHLL.nqp:2301  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:parse)
 from gen/moar/stage2/NQPHLL.nqp:2217  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:execute_stage)
 from gen/moar/stage2/NQPHLL.nqp:2252  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:run)
 from gen/moar/stage2/NQPHLL.nqp:2248  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:)
 from gen/moar/stage2/NQPHLL.nqp:2244  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:compile)
 from gen/moar/stage2/NQPHLL.nqp:1919  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:eval)
 from gen/moar/stage2/NQPHLL.nqp:2154  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:evalfiles)
 from gen/moar/stage2/NQPHLL.nqp:2114  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:command_eval)
 from gen/moar/Compiler.nqp:111  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/lib/Perl6/Compiler.moarvm:command_eval)
 from gen/moar/stage2/NQPHLL.nqp:2039  (/home/hythm/.rakubrew/versions/moar-blead/install/share/nqp/lib/NQPHLL.moarvm:command_line)
 from gen/moar/rakudo.nqp:140  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/runtime/perl6.moarvm:MAIN)
 from gen/moar/rakudo.nqp:1  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/runtime/perl6.moarvm:<mainline>)
 from <unknown>:1  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/runtime/perl6.moarvm:<main>)
 from <unknown>:1  (/home/hythm/.rakubrew/versions/moar-blead/install/share/perl6/runtime/perl6.moarvm:<entry>)
hythm7 commented 2 years ago

As a workaround for now, whenever there is a use lib 'lib' in a test file, use the Staging repository by adding the below right after:

BEGIN CompUnit::RepositoryRegistry.use-repository(CompUnit::RepositoryRegistry.repository-for-spec('CompUnit::Repository::Staging#name(home)#/tmp/test/staging'));

This terrible workaround worked for all modules that have use lib 'lib' on their test files except for one module Test::When which gave a different error Type check failed in binding to parameter '$current'; expected CompUnit::Repository but got Any (Any) it's probably the same bug but Test::When triggers it in a different way.

hythm7 commented 2 years ago

When commenting method short-id(--> Str:D) { 'staging' } from Staging class, the error disappears, this is probably because short-id method will be called on CompUnit::Repository::Installation, makes me think that the error is related to Staging is a CORE module not in rakudo core as CompUnit::Repository::Installation for example.

@niner just wondering if you could guess or know off the top of your head what could be causing this issue.

hythm7 commented 2 years ago

Looks like this commit fixes the issue. I dont see the error anymore on master. @lizmat

lizmat commented 2 years ago

Interesting. That was not what I was going for. Nonetheless, a nice result. So closing.