🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
tbrowder__ hi, in a module repo Foo i have a file Foo/resources/files/bar.txt. i try "raku -It 15:46
erg: raku -I. t/test.t and get failure. test.t has "$m = %?RESOURCES<files/bar.txt>.absolute; is $m, IO::Path" and it fails. in file META6.json i have "resources:" [ "files/bar.txt" ]". how can i test the file is found? 15:52
[Coke] Is the Foo a subdir in your clone, or == the top level of the repo? 16:01
also, what does $m contain before you call is? 16:02
also: you mean "resources":, not "resources:", yes?
tonyo ahh - so basically just building the dependency graph? 16:06
tbrowder__: .absolute turns that into a Str 16:09
tbrowder__: could jsut be: ok %?RESOURCES<files/bar.txt>.IO.f # tests that the file exists 16:11
[Coke] i think you don't need .IO there. 16:13
docs indicate it returns an IO already
tonyo it returns Distribution::Resource 16:19
which may be an IO but .f doesn't work on it directly
so i doubt it
tbrowder__ Foo is top level dir 16:22
tonyo and [Coke]'s question is a good one, re: also: you mean "resources":, not "resources:", yes? 16:23
tbrowder__ good ideas, guys...i' 16:24
i was using is instead of ok 16:25
hm, ckng Meta fr resources... 16:26
yes, my typo here, i do have "resources": 16:27
tonyo ah okay, did the `ok` work for you? `is` should work but you should be checking for type Str after calling .absolute 16:34
ugexe only modules have access to %?RESOURCES 16:39
ugexe you can add some subroutine to your module that does something like `sub MYRESOURCES() is implementation-detail { return %?RESOURCES }` and then in your tests do my $resources = MYRESOURCES(); say $resources<files/bar.txt> 16:41
tonyo ugexe++ 16:42
tbrowder__ ugexe: thanks! (again) 16:50
tbrowder__ ok, that works. thank you. that really needs to be in the docs near the def of var %?RESOURCES. i swear there is an example somewhere...searching source... 17:06
tonyo tbrowder__: if you link the page i'll update it 17:07
tbrowder__ i can't find it... 17:12
i think the trick is the fact the sub in lib gets precompiled. then the magic happens. 17:14
tonyo haha
is there a place to see what talks are already submitted for oct conference?
or is there any interest in a talk about the ecosystem stuff? if so, which parts/aspects of it? 17:15
tbrowder__ love to hear plans of the sqlite idea for better performance installing/searching for module distros. module distro best practices 17:17
tonyo if we go that route then my json indexer willn't be necessary 17:21
if we want to go that route i can hack on it and do a little thing on it 17:22
definitely can do a talk on the latter
[Coke] docs.raku.org/language/variables#%%3FRESOURCES 17:38
(the search for that *does* work, thankfully. :) 17:39
and it does not mention that you have to be in a module, so good catch 17:40
tonyo did you already fix it? the first sentence in there is `%?RESOURCES is a compile-time variable available to the code of a Distribution.` 20:31
[Coke] distribution != Module 20:35
and I think that difference matters base don what ugexe said.
PRs to clean it up very welcome.
ugexe ideally we could say something like Module::Name::<%?RESOURCES> or some such 20:41
tonyo it'd be nice for those to be exposed 20:45
elcaro Got an issue with my recent fez upload 23:02
fez review is ok, but I get an email saying "Error reading META from your last upload"
json is valid... so I'm not sure what the issue is. Error message could be more helpful. 23:03
Hmm... comparing to previous versions... I added `:auth` id to my depends module. Maybe it doesn't like it? 23:08
hmm, tried removing the auth tag and it didn't help. Any ideas, anyone? 23:12
[Coke] can you show your META6.json file? 23:21
elcaro github.com/0racle/raku-Inline-J/bl...META6.json 23:32
Perl and Python both read it fine, the JSON is not malformed 23:36
Apart from bumping the version, the only thing I did was remove "NativeCall" from depends, because it's in core. 23:37
I had also added `:auth` to the other dependency, but removed it and still getting the email advising error