🦋 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. |
|||
00:22
lichtkind left
00:25
donaldh left
|
|||
wayland76 | I'm getting the following for my new module: ===> Testing [FAIL]: Class::Loader::Dynamic:ver<0.0.3>:auth<zef:wayland> | 01:06 | |
However, when I cd to the relevant store (ie. ~/.zef/store/dist/4BC1FDFCA2C6DCFB47BD5CEFF7A10134B9A1125E/ ) and run "raku 01-basic-tests.rakutest", it works | 01:07 | ||
My question is, why is it failing in zef, but not when I run it the normal way? | 01:08 | ||
This also fails with no errors: zef test ~/.zef/store/dist/C7B5AF8A86707F9E52997AF0748FFB9FCFA3B704/ | 01:10 | ||
01:14
hulk joined
01:15
wayland joined,
wayland76 left
01:16
kylese left
|
|||
ugexe | for one you are using `use lib "lib"` inside of a test | 01:18 | |
tellable6 | 2025-04-20T04:06:40Z #raku <wayland> ugexe Thanks for the regex tip! I started trying EVAL, but didn't get it working, and assumed there was an easier way. | ||
ugexe | second, in the situations where you should use `use lib "lib"` or -Ilib, you should actually be using `use lib "."` or -I. | 01:19 | |
but again don't `use lib "lib"` or `use lib "."` in your tests | |||
wayland | ugexe: Thanks! So I should replace it with 'use lib "."? | 01:20 | |
ugexe | "but again don't `use lib "lib"` or `use lib "."` in your tests" | ||
wayland | Do I just leave it out altogether then? | 01:21 | |
ugexe | yes | ||
wayland | Great, thanks! | ||
Time for version 0.0.4 :p | |||
ugexe | i dunno if that will fix it your issue but it might | 01:22 | |
the other thing is you said you ran `raku 01-basic-tests.rakutest` | |||
and in your test you are using relative paths | |||
test runners run from the distribution root, but from inside the t directory | 01:23 | ||
you should be using absolute paths to avoid those type of issues | |||
wayland | Oh! Right. That'd do it. | 01:25 | |
ugexe | `:paths([$*PROGRAM.parent.child('lib'), $*PROGRAM.parent]),` | 01:26 | |
something like that | |||
i'd suggest putting your test module from t/*.rakumod into t/lib | 01:27 | ||
wayland | I'm not sure I understand "test runners run from the distribution root, but from inside the t directory". Do they pass in some option to change directory? | ||
OK, that sounds good. I was just copying another module I'd seen :) | |||
ugexe | no, they just run it from the distribution root | ||
i.e. `raku t/my-test.rakutest`, not `raku my-test.rakutest` | 01:28 | ||
wayland | OK, That all sounds useful. I'll give it a go. Thanks! | ||
ugexe | and thus `raku -I. t/my-test.rakutest` | 01:29 | |
01:49
stanrifkin_ left
|
|||
ugexe | You should always try to install your code before you release | 01:54 | |
Or set up a e.g. GitHub action that does zef install . | 01:55 | ||
wayland | Oh! I didn't realise that zef install would take a path. That sounds good. | 01:56 | |
Amusingly, I'm doing this so that I can make a tool that will, amongst other things, do checks before release. | 01:57 | ||
Just discovered zef test --verbose. Now I can hopefully help myself. Current error: "Parse errors: No plan found in TAP output" (at least I know how to fix that one :) ) | 02:02 | ||
02:15
hulk left,
kylese joined
03:12
guifa left
|
|||
ugexe | it can take a name, path, or a url | 03:24 | |
03:56
Aedil joined
04:30
kylese left
04:33
kylese joined
04:40
guifa joined
05:24
floyza joined
05:30
kylese left,
kylese joined
06:20
floyza left
|
|||
librasteve | these days i mostly use “ zef install . —force-install “ during module dev (especially if working on script and module code side by side | 06:25 | |
) | |||
wayland | librasteve: That's what I've started doing today, and I'm finding bugs in all my modules :( :) | 06:26 | |
librasteve | esp if you have resources and so on | 06:27 | |
are you using mi6 ? | |||
wayland | If I have a CSV data file in my module, and I want to read that after it's installed, what's the recommended way of getting that path? | ||
librasteve | i would spurt from a Build.rakumod HEREDOC, another way is to cp over from a resources file …. digs around | 06:28 | |
wayland | librasteve: In answer to your question, have you seen gist.github.com/wayland/255bc081ed...a05fbe7b69 ? | 06:29 | |
librasteve: Resources looks like what I want -- thanks! | 06:30 | ||
librasteve | github.com/librasteve/raku-CLI-AWS...ld.rakumod is the former (ugexe prolly won't like this one) | 06:32 | |
github.com/librasteve/raku-Dan-Pol...n/Build.pm is the latter (or this ;-0) | 06:34 | ||
iirc there is a repo (Inline::Perl5) that shows best practice github.com/niner/Inline-Perl5 & search 'resources' ... the idea is that there should be a set of "blessed" mechanisms such as "builder": "Distribution::Builder::MakeFromJSON", in the META6.json as a way for the community to constrain what Builders can run and where to police against malicious code installation - I have seen any docs on this tho | 06:42 | ||
maybe this is a way in raku.land/github:ugexe/Distribution::Common | 06:44 | ||
[anyway I defer to ugexe and others in all these matters] | |||
oh - sorry lol | 06:45 | ||
now I have seen it ... I use make-docs (borrowed from FCO) in my Air project btw github.com/librasteve/Air/blob/mai...-docs.raku | 06:47 | ||
wayland | So it seems we currently have about 7 partially-overlapping tools for this. | 06:55 | |
07:03
wayland left,
Sgeo left,
Aedil left
|
|||
librasteve | I would characterize more as there is a coalition of thought leaders (ugexe, coke, tonyo, etc) who want to make raku / zef / fez the best and most secure module ecosystem period and they are driving ever tighter policing standards and that we are somewhere on the journey from no standards at all to this stretch goal and that the take up is variable since older modules were released before the standards were | 07:15 | |
introducded ... could we do better / go faster ... well sure - but this is a smallish OSS community so folks are stretched and imo they have done a good job in striving for and making progress in that direction. already the Build.rakumod & resources approach prevents modules just dumping stuff into the client willy nilly - there has to be a code step and thus this code can be inspected and alerted by anyone who looks at it and | |||
I think that this is well established and controlled via zef as you have found ... better docs of this would help in explaining what's going on and why and in increasing adoption (sorry my career in marketing is showing) | |||
[don't mean to rant, soz] | 07:16 | ||
07:54
wayland joined
|
|||
wayland | librasteve: No worries :), and zef/fez are pretty good at what they do, but I've done a comparison of 6 tools (including fez, but not zef), and they each seem to have strong points and big holes. As you've seen, I'm working on something to address this, but I want it to work well with what we already have. I'm also expecting to have 0% overlap with zef. | 08:01 | |
I'm pleased with the better policing and security though :) | 08:02 | ||
08:07
abraxxa-home joined
08:09
abraxxa-home left
|
|||
wayland | m: my $r = Distribution::Resource.new(); say $r.Str() | 08:09 | |
camelia | Cannot resolve caller repository-for-spec(CompUnit::RepositoryRegistry:U: Any:U); none of these signatures matches: (CompUnit::RepositoryRegistry $:: Str:D $spec, CompUnit::Repository :$next-repo, *%_ --> CompUnit::Repository:D) (CompUnit:… |
||
wayland | Interesting! It also complains about deprecated code on my machine. | 08:10 | |
If I don't put .Str then the error in my code is: Type check failed in binding to parameter '$filename'; expected Str but got Distribution::Resource | 08:11 | ||
08:11
abraxxa-home joined
|
|||
wayland | I also get the same error if I call .absolute, .is-absolute, and various other things on the resource. | 08:13 | |
I think it's a bug in Distribution::Resource if I can't even do .Str on it any more. | 08:15 | ||
08:33
lichtkind joined
09:19
jpn joined
09:33
jpn left
09:49
yeahitsme joined
10:15
Aedil joined
10:19
bdju left
10:22
bdju joined
10:33
jpn joined
10:39
jpn left
10:40
jpn joined
11:00
jpn left
11:26
jpn joined
11:40
stanrifkin joined
|
|||
El_Che | timo: testing now | 12:00 | |
timo | thank you | ||
El_Che | timo: no, thank you :) | 12:01 | |
12:01
guifa left
12:06
jpn left
12:50
jpn joined
13:25
jpn left
13:28
jpn joined
|
|||
grondilu | Hello. | 13:29 | |
m: class Foo {}; print (Mu, Foo, pi, Foo).grep: Foo ff Foo | 13:30 | ||
camelia | ( no output ) | ||
grondilu | m: class Foo {}; print (Mu, Foo, pi, Foo).grep: {Foo ff Foo} | ||
camelia | Use of uninitialized value of type Foo in string context. Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful. in block <unit> at <tmp> line 1 Use of uninitialized value of type Foo in string context. M… |
||
grondilu | m: class Foo {}; dd (Mu, Foo, pi, Foo).grep: { Foo ff Foo } | ||
camelia | (Foo, Foo).Seq | ||
wayland | Btw, if anyone is wondering about my Distribution::Resource.Str complaint, it turns out if you read the source that the correct option is Distribution::Resource.IO.Str. | 13:31 | |
grondilu | 🤔 | ||
can't I use type checks in a flip-flop? | 13:32 | ||
tbrowder | hi, i just ran into some perl ppl on debian users complaining about perl's regex performance due to backtracking. my raku version vs. perl version was much faster 😃 but i doubt if i made any converts--stubborn bunch they are | ||
grondilu | m: class Foo {}; dd (Mu, Foo, pi, Foo).grep: { $_ ~~ Foo ff Foo } | 13:34 | |
camelia | (Foo, Foo).Seq | ||
grondilu | m: class Foo {}; dd (Mu, Foo, pi, Foo).grep: { $_ ~~ (Foo ff Foo) } | ||
camelia | ().Seq | ||
grondilu | m: class Foo {}; dd (Mu, Foo, pi, Foo).grep: { $_ ~~ (Foo fff Foo) } | 13:35 | |
camelia | ().Seq | ||
grondilu | m: class Foo {}; dd (Mu, Foo, pi, Foo).grep: { Foo fff Foo } | ||
camelia | (Foo, 3.141592653589793e0, Foo).Seq | ||
grondilu | ah | ||
naru hodo | 13:38 | ||
grondilu watches too much anime lol | |||
m: class Foo {}; class Bar {}; dd (Mu, Foo, pi, Bar, Foo).grep: { Foo ff Bar } | |||
camelia | (Foo, 3.141592653589793e0, Bar, Foo).Seq | ||
grondilu | 🤔 | 13:39 | |
why no stop at Bar?? | |||
FWIW I'm trying to use this operator to check if a chess piece is pinned. Not sure it's gonna make it easier, but I want to give it a shot. | 13:40 | ||
seems more fun that using boring loops. | 13:41 | ||
*than | |||
m: class Foo {}; class Bar {}; dd (Mu, Foo, pi, Bar.new, Foo).grep: { Foo ff Bar } | |||
camelia | (Foo, 3.141592653589793e0, Bar.new, Foo).Seq | ||
13:41
jpn left
|
|||
grondilu | m: class Foo {}; class Bar {}; dd (Mu, Foo, pi, Bar.new, Foo).grep: { Foo fff Bar } | 13:42 | |
camelia | (Foo, 3.141592653589793e0, Bar.new, Foo).Seq | ||
grondilu | doesn't make much sense | ||
m: class Foo {}; class Bar {}; dd (Mu, Foo, pi, 42, Foo).grep: { Foo fff 42 } | 13:43 | ||
camelia | (Foo, 3.141592653589793e0, 42, Foo).Seq | ||
coranila | caret where you wanna exclude the end point; e,g, Foo ff^ Foo | 13:44 | |
grondilu | m: class Foo {}; class Bar {}; dd (Mu, Foo, pi, 42, Foo).grep: { Foo fff Int } | 13:46 | |
camelia | (Foo, 3.141592653589793e0, 42, Foo).Seq | ||
grondilu | the rhs is supposed to mark the stop condition | ||
m: class Foo {}; class Bar {}; dd (Mu, Foo, pi, 42, Foo).grep: { Foo ff Int } | |||
camelia | (Foo, 3.141592653589793e0, 42, Foo).Seq | ||
grondilu | oh wait | ||
it starts a new cycle doesn't it? | 13:47 | ||
m: class Foo {}; class Bar {}; dd (Mu, Foo, pi, 42, "yo").grep: { Foo ff Int } | |||
camelia | (Foo, 3.141592653589793e0, 42).Seq | ||
grondilu | naru hodo | ||
m: class Foo {}; class Bar {}; dd (Mu, Foo, pi, Bar, "yo").grep: { Foo ff Bar } | |||
camelia | (Foo, 3.141592653589793e0, Bar).Seq | ||
grondilu | pretty cool | ||
ugexe | "wayland>Btw, if anyone is wondering about my Distribution::Resource.Str complaint, it turns out if you read the source that the correct option is Distribution::Resource.IO.Str" | 13:48 | |
no that is actually wrong | |||
the correct option is to not stringify Distribution::Resource paths | |||
im pretty sure the warning messages states what should be done instead (use the Distribution::Resource directly, i.e. %?RESOURCES<foo>.slurp(:close)) | 13:49 | ||
otherwise you are precompiling the path into the precomp file (since you are stringifying it apparently), and that path changes between the time the distribution is staged to be installed and where it is ultimately installed. now that path points at the wrong location. the application might work for awhile because usually staging happens in /tmp, but eventually /tmp is cleared and now your app is | 13:50 | ||
broken | |||
from the docs: Note that paths and names of resource files can be mangled in an installed distribution, so do not rely on their values in any other case besides using them as keys for the %?RESOURCES variable. | 13:51 | ||
see github.com/rakudo/rakudo/issues/5504 | 13:55 | ||
13:56
abraxxa-home left
|
|||
ugexe | Distribution.Str, Distribution.IO.(any stringification method) are the same as far as the issue is concerned | 13:56 | |
wayland | ugexe: Hmm. If I don't put .Str then the error in my code is: Type check failed in binding to parameter '$filename'; expected Str but got Distribution::Resource. Looks like I'll have some digging to do. Thanks! | ||
ugexe | how are you using it | ||
like if whatever you are passing it to needs a file name then it isnt going to work | 13:57 | ||
wayland | I'm passing it to the "parse" function of something that will read the resource and spit it out. | 13:58 | |
Ie. turn it from a CSV into data that gets used by the code. | 13:59 | ||
ugexe | the easiest thing would probably be to replace your `Str $filename` with `IO::Handle $resource` and then pass the handled returned from %?RESOURCE<foo>.open() | 14:00 | |
wayland | Anyway, it's midnight here, so I'm going ti have to call it quits for now. I'll make a note of what you said, and come back to it later (probably Friday) | ||
ugexe | then you can $resource.slurp(:close) or anything else that isn't explicitly using a path | ||
wayland | OK, so .IO will work, just not .IO.Str? | ||
ugexe | i dont know if .IO returns a handle or an IO::Path | 14:01 | |
github.com/rakudo/rakudo/blob/298f...umod#L7-L8 | |||
i would probably avoid using .IO unless you really know what you're doing | |||
again, call `.open()` to get a handle and work with that (but don't try to extract the path from that handle either) | 14:02 | ||
my $resource = %?RESOURCES<foo>.open(); say $resource.slurp(:close); | 14:03 | ||
note the lack of .IO | |||
wayland | OK, that sounds workable. I mean, I'll have to add some code to work with handles, but that's probably pretty achievable. | ||
Yeah, it's using Text::CSV under the hood, and that looks like it can use a handle. | 14:07 | ||
Goodnight :) | |||
[Coke] | git question - when doing a git pull, do folks here think about whether or not to do a rebase, always do with or without a rebase? | 14:27 | |
(I am locked into "always rebase" so much I have an alias since like day 2 of git usage that I always use instead of raw pull) | |||
jdv | thats a religious debate | ||
i always pull --rebase | 14:28 | ||
[Coke] | just wondering if I'm being weird about it. | ||
rb = pull --rebase | |||
15:11
morena joined
|
|||
tbrowder | i don't use --rebase, but i probably should. i just murfled a release prep probably because i should have used --rebase | 15:37 | |
Voldenet | I never rebase, it loses the info about merging | 15:51 | |
it helps in cases where stuff collides logically with other people's code somehow | 15:52 | ||
especially if it's discovered later | |||
jdv | see:) religious. | 15:53 | |
Voldenet | commits history isn't supposed to be clean, but represent the real state, it really helps bisecting, reverting and cherry-picking later | ||
it's not really religious, it's simply useful to have more details | 15:54 | ||
jdv | i prefer a more linear easier to reason about hist. | ||
willy nilly merging quickly becomes incomprehensible | |||
Voldenet | in the projects I work with git history turns into guitar hero tabs | 15:55 | |
but that's fine | |||
jdv | its about curation vs raw meaninglessness | ||
cool:) | |||
Voldenet | indeed, the talk is similar to "should you squash unrelated commits if they're on the same feature branch" | 15:56 | |
jdv | yup | ||
Voldenet | imo it needs per-case treatment - if you think your merge is going to make n-way merge mess, then rebase | 15:57 | |
otoh rebasing is very elegant and cases where two branches collide are rare | 16:01 | ||
and clear linear history can be useful too | 16:03 | ||
so the question's asking whether to apply a hammer or a screwdriver ultimately - I work usually with nails, so I use hammer :P | 16:04 | ||
16:11
Aedil left
16:32
human-blip left
|
|||
timo | Stop. Screwdriver time! | 16:38 | |
16:42
Aedil joined
16:45
lichtkind left
|
|||
Voldenet | hit those nails with a handle :> | 16:53 | |
melezhik. | . | 17:13 | |
17:14
stanrifkin left
|
|||
.tell tonyo: does fez echo system provide “hashless” URLs to download distros from ? For example currently 360.zef.pm/S/PA/SPARROW6/72fcb20bc...1fc.tar.gz contains some hash which is not very convenient for alpine maintainers to build the module using APK file format . Ideally module_name+version URL is wanted | 17:17 | ||
tellable6 | melezhik., I'll pass your message to tonyo | ||
antononcube | I consider making a package for downloading YouTube transcripts and metadata. What is a good name? 1) WWW::YouTube 2) YouTube | ||
(I think option 1 is better.) | 17:18 | ||
melezhik. | This is a question asked by one of alpine maintainers who aims to create alpine package for Sparrow6 ( and all its dependencies) | ||
17:42
lichtkind joined
|
|||
librasteve | yeah - (1) | 17:57 | |
18:01
yeahitsme left,
jpn joined
18:11
floyza joined
18:28
Aedil left
|
|||
:pet_the_htmx: | 18:30 | ||
guess you have to join HTMX discord to get that | 18:31 | ||
18:41
morena left
19:10
bdju left
19:11
bdju joined
|
|||
antononcube | Hmm... this can created and uploaded here. | 19:18 | |
19:53
jpn left
|
|||
wayland | antononcube: I'm not fussed about the WWW:: but I think there are probably other YouTube modules that could be written/useful; maybe [WWW::]YouTube::Metadata or something? | 20:54 | |
antononcube | Yeah. I plan to have metadata retrieved with "WWW::YouTube" / "YouTube". But I doubt I will go further than using URLs. | 20:56 | |
wayland | One YouTube module I'd probably use someday would be one that will manage a live stream for you (ie. automatically create a live stream with certain data at a predefined time of week) | 21:05 | |
21:09
jpn joined
21:14
jpn left
|
|||
antononcube | This is the Wolfram resource function I made and submitted today: www.wolframcloud.com/obj/antononcu...ranscript/ | 21:18 | |
The Raku package is going to have that function first. But, I see that YouTube Data API provides other data, not just captoins. | 21:19 | ||
[Coke] | m: use Test; dies-ok { run "false" } | 21:32 | |
camelia | ok 1 - | ||
[Coke] | excellent. | 21:33 | |
21:34
lichtkind left
22:12
wayland left
22:15
guifa joined
22:38
guifa left
22:43
jpn joined
22:49
jpn left
22:50
jpn joined
22:55
jpn left,
human-blip joined
23:09
Guest34 joined
23:13
Guest34 left
23:15
Sgeo joined
23:51
jpn joined
23:56
jpn left
|