Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

META6.json causes an issue when it's in lib (why?) #2641

Open
AlexDaniel opened this Issue Jan 24, 2019 · 6 comments

Comments

Projects
None yet
3 participants
@AlexDaniel
Copy link
Member

AlexDaniel commented Jan 24, 2019

  1. Clone JSON::WebToken
  2. Run PERL6LIB=lib perl6 t/01_basic.t and you'll get an error (shown below)
  3. Rename META6.json file in the root directory of the repo to anything else, like NOT-META6.json
  4. The error goes away.

Error:

Use of uninitialized value of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
  in any statement_control at /home/alex/.rakudobrew/moar-master/install/share/nqp/lib/Perl6/Grammar.moarvm line 1
Use of uninitialized value of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
  in any statement_control at /home/alex/.rakudobrew/moar-master/install/share/nqp/lib/Perl6/Grammar.moarvm line 1
===SORRY!===
Cannot resolve caller new(IO::Path:U: Any:U, :CWD(Str)); none of these signatures match:
    (IO::Path: Str $path, :$SPEC = { ... }, Str:D :$CWD, *%_)
    (IO::Path: Str $path, :$SPEC = { ... }, :$CWD = { ... }, *%_)
    (IO::Path: Cool $path, :$SPEC = { ... }, :$CWD = { ... }, *%_)
    (IO::Path: :$basename!, :$dirname = "", :$volume = "", :$SPEC = { ... }, :$CWD = { ... }, *%_)
    (IO::Path: *%_)

The test file has this:

use lib '.';

So that's why files in the cwd play some role, but is it wrong to have a META6.json file in your lib?

This issue did not exist in 2018.12.

Ping @ugexe.

@AlexDaniel AlexDaniel changed the title META6.json is now used when it's in lib (why?) META6.json causes an issue when it's in lib (why?) Jan 24, 2019

@AlexDaniel AlexDaniel referenced this issue Jan 24, 2019

Closed

[WIP] Blin 2019.01 #2638

13 of 13 tasks complete
@ugexe

This comment has been minimized.

Copy link
Member

ugexe commented Jan 24, 2019

It is expecting the directory ‘.’ to act as two separate distributions: lib/ and t/Util.pm6

Instead the test should require $?FILE.parent.add(‘Util.pm’) or use lib $?FILE.parent.absolute

@AlexDaniel

This comment has been minimized.

Copy link
Member Author

AlexDaniel commented Jan 24, 2019

@ugexe can you elaborate a little bit? For example, why did it work before?

@ugexe

This comment has been minimized.

Copy link
Member

ugexe commented Jan 25, 2019

Because now it doesn't ignore the META6.json if one exists, whereas before it would ignore the META6.json if the requested module-file existed and wasn't in the META6.json. The META6.json is authority, so if it exists it then it gets used. Otherwise there is no sure way to test using only the modules you have declared without installing them first, among other things.

AlexDaniel added a commit to AlexDaniel/JSON-WebToken that referenced this issue Jan 26, 2019

Move t/Util.pm6 into a separate dir
The code in test files assumes that `use lib ‘.’` will get both `lib/`
and `t/Util.pm6`.  It used to work in 2018.12 and earlier, but it
won't work in upcoming rakudo releases. See rakudo/rakudo#2641 for
more info.

AlexDaniel added a commit to AlexDaniel/JSON-WebToken that referenced this issue Jan 26, 2019

Move t/Util.pm6 into a separate dir
The code in test files assumes that `use lib ‘.’` will get both `lib/`
and `t/Util.pm6`. It used to work in 2018.12 and earlier, but it
won't work in upcoming rakudo releases. See rakudo/rakudo#2641 for
more info.

@AlexDaniel AlexDaniel added LTA and removed regression BLOCKER labels Jan 26, 2019

@AlexDaniel

This comment has been minimized.

Copy link
Member Author

AlexDaniel commented Jan 26, 2019

I submitted a PR that resolves the issue for the module. Removing the blocker label as I don't it affects anything else (please prove me wrong :) ).

However, the error message is really weird, and IMO can be improved.

ugexe added a commit that referenced this issue Jan 27, 2019

@ugexe

This comment has been minimized.

Copy link
Member

ugexe commented Jan 27, 2019

This now gives the compile time error:

===SORRY!===
Could not find t::Util at line 4 in:
    /Users/ugexe/repos/rakudo/JSON-WebToken
    /Users/ugexe/repos/rakudo/JSON-WebToken/lib
    /Users/ugexe/.perl6
    /Users/ugexe/repos/rakudo/install/share/perl6/site
    /Users/ugexe/repos/rakudo/install/share/perl6/vendor
    /Users/ugexe/repos/rakudo/install/share/perl6
    CompUnit::Repository::AbsolutePath<140608224271232>
    CompUnit::Repository::NQP<140608214995880>
    CompUnit::Repository::Perl5<140608214995920>
@AlexDaniel

This comment has been minimized.

Copy link
Member Author

AlexDaniel commented Jan 28, 2019

Looks nice. I've added testneeded in case we can have tests for this, but feel free to handle this ticket any way you want.

@AlexDaniel AlexDaniel referenced this issue Feb 18, 2019

Closed

[WIP] Blin 2019.02 #2705

9 of 9 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.