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

%?RESOURCES is not available when dist is installed to inst#/my/custom/repo #1

Closed
hythm7 opened this issue Oct 20, 2019 · 2 comments
Closed

Comments

@hythm7
Copy link
Owner

hythm7 commented Oct 20, 2019

Installing dist A to /my/custom/repo and:

dist A depends on dist B,
dist B uses %?RESOURCES, then
dist A tests might fail if the test file uses dist B, because %?RESOURCES< exisitng-file > of dist B returns Nil.

The error: (where License::SPDX resources returns Nil when loaded from inst#/my/custom/repo)

🔔 Type check failed in binding to parameter '$json'; expected Str but got Nil (Nil) 
🔔   in method from-json at repo#sources/C0029D661A8CA443DB83A67FE58F3E10D590C1A0 (JSON::Class) line 90 
🔔   in method new at repo#sources/4E66FDBA4785D40812EC4D781E0EB1263E3D4196 (License::SPDX) line 138 
🔔   in sub check-license at /tmp/Test-META-0.0.16/lib/Test/META.pm (Test::META) line 179 
🔔   in block <unit> at t/020-internals.t line 55 
🔔  
💀 TST: Test::META:ver<0.0.16>:auth<github:jonathanstowe>:api<1.0> 
Nofun

The below command will fail testing phase because %?RESOURCES of License::SPDX is not available during testing Test::META

pakku install verbose trace add to /my/custom/repo Test::META

Same command work fine if installed to any of Raku's repos home site vendor
pakku install verbose trace add Test::META # works and installed to repo home by default

Offending code is here: the issue disappears when removing $*repo (in this case inst#/my/custom/repo ) from include path and test pass, I think because License::SPDX is loaded from another repo home, site or vendor where it is able to find its %?RESOURCES

@hythm7 hythm7 changed the title %?RESOURCES returns Nil during test phase of custom repo installation %?RESOURCES returns Nil during test phase in custom repo installation Oct 20, 2019
@hythm7 hythm7 changed the title %?RESOURCES returns Nil during test phase in custom repo installation %?RESOURCES returns Nil during test phase of dist installed to inst#/pat/to/some/dir Oct 2, 2020
@hythm7 hythm7 changed the title %?RESOURCES returns Nil during test phase of dist installed to inst#/pat/to/some/dir %?RESOURCES returns Nil during test phase of dist installed to inst#/path/to/some/dir Oct 2, 2020
@hythm7 hythm7 changed the title %?RESOURCES returns Nil during test phase of dist installed to inst#/path/to/some/dir %?RESOURCES is not available when dist is installed to inst#/my/custom/repo Oct 2, 2020
@hythm7
Copy link
Owner Author

hythm7 commented Oct 8, 2020

Fixed in this commit

Looks like CompUnit::RepositoryRegistry.register-name is causing the issue to %?RESOURCES.

(This issue may exist in Raku's default repos as well home site vendor, I haven't tested them yet).

Will look into CompUnit::RepositoryRegistry.register-name in Rakudo to better understand the issue
and create an issue in Rakudo

@hythm7 hythm7 closed this as completed Oct 8, 2020
@hythm7
Copy link
Owner Author

hythm7 commented Feb 13, 2021

When registering a name for CURI via CompUnit::RepositoryRegistry, the same name need to be registered everytime a new process of Raku runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant