🦋 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:00
reportable6 left
00:02
reportable6 joined
|
|||
ugexe | because its set as a my class variable, so its already been set before runtime | 00:05 | |
github.com/rakudo/rakudo/blob/8975...akumod#L12 | |||
looks like it is a regression from github.com/rakudo/rakudo/commit/06...25cb559e4e | 00:06 | ||
hythm | Thanks | 00:12 | |
so this is a genuine bug? if so I can create an issue | |||
ugexe | i kinda think so. i would at least expect it to work with `BEGIN %*ENV<RAKUDO_LOG_PRECOMP> = 1; ...` | 00:38 | |
00:39
hythm left
|
|||
ugexe | i guess it could also be argued its not a bug. so i dunno | 00:40 | |
m: BEGIN %*ENV<RAKUDO_MODULE_DEBUG> = 1; use Test; | 00:44 | ||
camelia | 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 source at ./rakudo-m-inst-2/share/perl6/core/sources/7446BEA8D62DB1C72975C92A521818D4… |
||
ugexe | that works though, which is why i lean towards it might be a bug | ||
although maybe that isn't a good example | 00:45 | ||
because it might really be | |||
m: use Test; BEGIN %*ENV<RAKUDO_MODULE_DEBUG> = 1; | |||
camelia | ( no output ) | ||
ugexe | even though i set it at BEGIN time, the `use Test` also happens then and immediately before | 00:46 | |
and in the case of RAKUDO_LOG_PRECOMP, when else should it check the ENV variable but compile time? and if it happens at compile time, its gonna be sequenced before the first character of user code e.g. %*ENV<...> = ... | 00:47 | ||
i suppose from a purely technical standpoint it is not a bug | 00:51 | ||
01:00
hythm joined
|
|||
hythm | I see. Thanks for the detailed explanation. | 01:00 | |
01:06
codesections left
01:09
Manifest0 left
01:54
wayland joined
02:03
edr left
03:03
linkable6 left,
evalable6 left
03:04
evalable6 joined,
linkable6 joined
04:04
benchable6 left,
squashable6 left,
unicodable6 left,
tellable6 left,
notable6 left,
reportable6 left,
evalable6 left,
committable6 left,
linkable6 left,
statisfiable6 left,
bloatable6 left,
releasable6 left,
reportable6 joined,
unicodable6 joined
04:05
committable6 joined,
statisfiable6 joined,
releasable6 joined,
tellable6 joined,
squashable6 joined,
linkable6 joined
04:06
benchable6 joined,
evalable6 joined
04:07
notable6 joined,
bloatable6 joined
04:23
hythm left
04:46
raiph left
05:24
jgaz left
05:41
derpydoo joined
06:00
reportable6 left
06:02
reportable6 joined
06:07
siavash joined
06:26
xinming left
06:28
xinming joined
06:55
MoC joined
07:23
kjp left
07:27
kjp joined
07:30
deoac left
07:44
squashable6 left
07:46
squashable6 joined
07:56
siavash left
08:51
eseyman left
09:01
manu_ joined
09:02
manu_ is now known as eseyman
09:59
Manifest0 joined
10:07
Sgeo left
10:30
derpydoo left
10:41
wayland left
10:42
wayland joined
10:49
MoC left
11:29
lichtkind joined
11:36
teatwo joined
11:37
tea3po joined
11:39
teatime left
11:40
teatwo left
12:00
reportable6 left
12:03
reportable6 joined
12:12
codesections joined
12:40
simcop2387 left,
perlbot left
12:42
perlbot joined
12:43
simcop2387 joined,
wayland76 joined,
wayland left
|
|||
tbrowder__ | hi, i'm runnng into a prob building a new module. it has a script meant for the root user to execute, but a reqular user should be able to run other parts of it. the problem is the script uses routines from a lib/ module and i get permission problems with lib/.precomp. | 12:52 | |
for a regular user. | 12:53 | ||
lizmat | no precompilation ? | ||
tbrowder__ | there is an existing lib/.precomp created by root, and the a normal user gets access denied when trying to use the script | 12:54 | |
12:55
codesections left,
thelio joined
|
|||
tbrowder__ | i haven't yet tried manually setting permissions, but i've never seen this behavior before. | 12:55 | |
perhaps i should have ensured the precomp was created by the reg user, but a more general solution would be nice to have | 12:56 | ||
i'm not sure that is possible without an explict root incantation | 12:58 | ||
chmod 777 | 12:59 | ||
lib | 13:00 | ||
but using correct syntax | 13:03 | ||
13:26
guessed joined
|
|||
guessed | hi how can i catch this situation | 13:28 | |
m: put Whatever + 1; CATCH { default { .^name.put } } | |||
camelia | Use of uninitialized value of type Whatever in numeric context 1 in block <unit> at <tmp> line 1 |
||
guessed | with CATCH or with // or with orelse is there a way? | 13:29 | |
it is outputting 0 + 1 = 1, i like to detect the inappropriateness and output something different for example | 13:30 | ||
lizmat | m: put Whatever + 1; CONTROL { default { .^name.put } } | 13:39 | |
camelia | CX::Warn | ||
lizmat | warnings are CONTROL exceptions, so you need a CONTROL block instead of a CATCH block | ||
tbrowder__ | note the perms prob is only in the dev repo, i don't there should be a prob with zef installation and use | 13:43 | |
13:44
thelio left
|
|||
lizmat | could you post a --ll-exception gist of the failure? | 13:45 | |
I mean, it should try to write to the first writeable dir | |||
ugexe | if you're getting errors from a lib/.precomp then it sounds like you aren't installing the module | 13:48 | |
in which case the location of that lib/ folder is probably the only relevant thing | 13:49 | ||
in your case it sounds like you are doing something that causes it to want to re-precompile | 13:50 | ||
for instance, changing the repo chain | |||
so i suppose you should tell us A) the full path of the module and how you are adding it to raku (i.e. -I mylib/lib, RAKULIB=mylib/lib, etc) B) how you are invoking raku to use the script as root (like `raku -Ilib bin/myscript.raku) C) how you are invoking raku to use the script as non-root | 13:52 | ||
i just did `sudo raku -Ilib bin/zef search HTTP`, and then `raku -Ilib bin/zef search HTTP` and it worked. so from what i can tell it should work fine | 14:00 | ||
although in that case my regular user already has access to lib/, i.e. lib/ is not under /root/ | 14:02 | ||
hmm, if i do `sudo mkdir foo` then `raku -Ifoo -Ilib bin/zef search HTTP` it gives a bunch of problem messages | 14:06 | ||
gist.github.com/ugexe/d9dce407dd9b...33f891782f | |||
seems related to github.com/rakudo/rakudo/blob/75c6...od#L49-L50 | 14:07 | ||
guessed | Lizmat thanks how i can integrate that to conditionally assign value to variable like `my $var = do { Whatever + 1; CONTROL { default { -2 } } }` | 14:09 | |
for this to be -2 but this gives Any right now | 14:10 | ||
lizmat | m: my $var is default(-2) | 14:13 | |
camelia | ( no output ) | ||
lizmat | not sure what you actually want to achieve | 14:14 | |
ugexe | strangely in my gist the error occurs with version-matcher and auth-matcher, but never api-matcher | 14:15 | |
14:15
raiph joined
|
|||
guessed | i wanted to initalize a variable from either `f()` or `g()`. First i call `&f` and it can give that Warning. If it does, i then call &g and initialize $var with it. `is-default(g())` didn't quite work i guess its compile time or something. i now do `my $var = do { f(); CONTROL { default { } } } // g();` | 14:38 | |
so thanks and my other qeuestion is why | |||
m: sub f { $^a, $^b }; f(5, 6) | |||
camelia | ( no output ) | ||
guessed | works but | ||
m: sub f { $^a, $^b }; f.(5 xx 2) | |||
camelia | ===SORRY!=== Error while compiling <tmp> Calling f() will never work with declared signature ($a, $b) at <tmp>:1 ------> sub f { $^a, $^b }; ⏏f.(5 xx 2) |
||
guessed | does not | ||
m: sub f { $^a, $^b }; f.(5, 6) | 14:39 | ||
camelia | ===SORRY!=== Error while compiling <tmp> Calling f() will never work with declared signature ($a, $b) at <tmp>:1 ------> sub f { $^a, $^b }; ⏏f.(5, 6) |
||
guessed | &f.(5, 6) works though | ||
is this expected (you can ignore 5 xx 2 one it was a mistake copying) | |||
lizmat | f(5.6) // g(7,8) | 14:40 | |
?? | |||
guessed | but it doesnt fail so it doesnt go to second part | 14:41 | |
lizmat | my $a = f(5,6) // g(7,8) | ||
guessed | Whatever + 100 warns and gives back 100 | ||
lizmat | so is the warning the problem, or the value ? | ||
guessed | warning | 14:42 | |
so i now do `my $var = do { f(); CONTROL { default { } } } // g();` after your CONTROL input | |||
warning and the value are both problems | |||
if &f warns, suppress the warning, ignore what it returns, and assign whatever g() gives instead | 14:43 | ||
lizmat | docs.raku.org/language/statement-p...es#quietly | ||
guessed | quielty suppresses but doesnt ignore the value returned | 14:44 | |
and so g() isn't called | |||
gfldex | m: quietly do our $work;¶ | ||
camelia | ===SORRY!=== Error while compiling <tmp> Bogus statement at <tmp>:1 ------> quietly do our $work;⏏¶ expecting any of: prefix term |
||
gfldex | m: quietly do { our $work }; | 14:45 | |
camelia | ( no output ) | ||
guessed | im happy with ``my $var = do { f(); CONTROL { default { } } } // g();` not sure if it gets shorter but i don't know of course | 14:46 | |
my other question is: | 14:47 | ||
m: sub f { $^a, $^b }; f.(5, 6) | |||
camelia | ===SORRY!=== Error while compiling <tmp> Calling f() will never work with declared signature ($a, $b) at <tmp>:1 ------> sub f { $^a, $^b }; ⏏f.(5, 6) |
||
guessed | this is erroring, is it expected | ||
it doesnt error if &f.(5, 6) is used | |||
15:04
jgaz joined
|
|||
lizmat | sorry, was afk for a bit | 15:19 | |
so you only want call g() if there is a warning ? | 15:20 | ||
guessed | yes | 15:22 | |
gfldex | Is there actually a case where the `.()`-form is required? | 15:23 | |
guessed | sigilless vars? | ||
lizmat | no, I was wondering why you were using &f.(5.6) instead of just f(5,6) | ||
guessed | i wasnt using &f.(5, 6) or f(5, 6) | ||
i was using f.(5, 6) | |||
lizmat | "it doesnt error if &f.(5, 6) is used" | 15:24 | |
OOC, why f.(5,6) ? | |||
gfldex | m: sub f { sub g { say 'g' } }; f.(); | ||
camelia | g | ||
gfldex | That is the only case I can thing of. | 15:25 | |
guessed | m: my \f = { $^a, $^b}; f(3, 4) | ||
camelia | ===SORRY!=== Error while compiling <tmp> Variable '&f' is not declared. Perhaps you forgot a 'sub' if this was intended to be part of a signature? at <tmp>:1 ------> my \f = { $^a, $^b}; ⏏f(3, 4) |
||
guessed | m: my \f = { $^a, $^b}; f.(3, 4).put | ||
camelia | 3 4 | ||
gfldex | And if I see that in a production code-base, I will run away screeming. :-> | ||
guessed | for the record my f() and g(), and f.(5, 6) were separate questions | 15:26 | |
lizmat | m: my &f = { $^a, $^b}; f(3, 4).put | ||
camelia | 3 4 | ||
lizmat | guessed: still wondering whether your "only if warning" isn't a symptom you're trying to counter, rather than an underlying issue | 15:27 | |
if the underlying issue is undefinedness, then maybe another approach would be better | |||
nemokosch | gfldex made a really good case here, that was really hard to read | 15:45 | |
f.(5,6) for some &f is basically f()(5, 6) | 15:46 | ||
this is so confusing I'm not sure it should even be allowed | |||
guessed | i see now, i didnt understand when gfldex wrote it | 15:47 | |
from documentation it says useful for method calls | |||
nemokosch | I don't know, I can't say clearly what seems so irregular about this | 15:48 | |
guessed | lizmat: im passed a code object. i call it with `Whatever` first. It can give a warning if the code does arithmetic. If it does, i call it with an integer. | ||
nemokosch | it's the intersection of two contradictory abstractions | ||
guessed | sometimes it really expects Whatever, so it doesnt give a warning | 15:49 | |
btw how do I understand it was warning versus failing versus dying? | 15:50 | ||
15:50
squashable6 left
|
|||
nemokosch | well, the code continued to run and gave no trace | 15:50 | |
a Failure is basically an Exception masquerading as a value, it will only explode when you start to treat it like a value | 15:52 | ||
15:52
squashable6 joined
|
|||
so in this sense that's not a third option | 15:52 | ||
related thought: don't ever test for emptiness using .elems | 15:53 | ||
(unfortunately, the core didn't follow this principle early enough) | 15:54 | ||
m: say 'So empty I can't even believe it!' if (^Inf).elems | |||
Raku eval | Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Two terms in a row at /home/glot/main.raku:1 ------> say 'So empty I can'⏏t even believe it!' if (^Inf).elems expecting any of: infix infix stopper postfix statement end statement modifier statement modifier loop | ||
nemokosch | oops the apostrophe | ||
m: say 'So empty I can't even believe it!' if (^Inf).elems | 15:55 | ||
Raku eval | |||
nemokosch | negations are a hard topic... | ||
15:55
derpydoo joined
|
|||
the condition was actually for the case when there are elements | 15:55 | ||
m: say 'So empty I can't even believe it!' unless (^Inf).elems | |||
Raku eval | Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Two terms in a row at /home/glot/main.raku:1 ------> say 'So empty I can'⏏t even believe it!' unless (^Inf).elems expecting any of: infix infix stopper postfix statement end statement modifier statement modifier loop | ||
nemokosch | okay I'm gonna unalive myself 💀 | 15:56 | |
m: sub is-empty($x) { $x.elems }; if is-empty(^Inf) { say 'This is so empty I can't even believe it.'; } | 15:57 | ||
Raku eval | |||
nemokosch | okay, whatever, today I can't think straight | ||
the point is that you would expect something like this to be not empty but if you use a check for the number of elements, the check will be False, as if it had truly 0 elements | 15:58 | ||
m: (^Inf).elems | |||
Raku eval | Exit code: 1 Cannot .elems a lazy list onto a Range in block <unit> at main.raku line 1 | ||
nemokosch | this is the reason | ||
lizmat | and how did this apply to guessed problem? | 15:59 | |
nemokosch | this does not apply to the problem, this applies to fail vs die vs warn | ||
lizmat | ack | 16:00 | |
nemokosch | .elems produces a Failure that can turn into a False value and do nothing "exceptional" | ||
but in other situations, like the last snippet, it can escalate into an Exception | |||
this is why I said it wasn't really a third option | 16:01 | ||
lizmat | my $var; CATCH { when CX::Warn { $var = g(7,8) } }; $var = f(5,6) | ||
oops, CONTROL of course :-) | 16:08 | ||
afk& | 16:17 | ||
16:32
jpn joined
17:13
jpn left
17:14
jpn joined
17:20
deoac joined
17:34
codesections joined
18:05
MoC joined
18:58
MoC left
19:00
codesections left
19:02
Sgeo joined
19:09
hythm joined
19:18
raiph left
19:30
deoac left
19:31
jpn left
19:33
jpn joined
19:34
jpn joined
19:50
jpn left
19:56
jpn joined
|
|||
tbrowder__ | i thought i was clear but the perm problem was during module dev in a local repo, not while zef installing it. i just corrected perms on my local lib dir and all was fine. it just surprised me, but it shouldn't have. i was slinging sudo around like crazy. | 20:08 | |
ugexe: what do you think about making "--serial" the default zef install and upgrade commands? | 20:10 | ||
*default option for install and upgrade commands? | 20:11 | ||
20:34
jpn left
20:52
guessed left
20:53
hythm left
21:15
ProperNoun left
21:16
ab5tract left
21:17
ab5tract joined
21:26
codesections joined
21:28
codesections left
21:30
codesections joined
21:58
kdon joined
22:22
codesections left
22:30
codesections joined
22:39
jpn joined
22:43
kdon left
22:57
kdon joined
|
|||
ugexe | I dunno, I like how the non serial behavior often shows problems that should be fixed like incorrectly declared depends | 23:05 | |
I think I’d be more open to some sort of mechanism that can tell if it needs to rebuild and run tests for subsequent commands | |||
23:07
jpn left
|
|||
ugexe | Which I mention because the only argument for wanting to use serial is to speed up installing dependency chains that aren’t declared fully/properly | 23:09 | |
23:09
jpn joined
|
|||
ugexe | It also means you can’t do certain tasks in parallel in the future like install two different distributions at the same time | 23:11 | |
23:26
lichtkind left
23:29
Camaleon joined
23:30
AlexDaniel joined
|
|||
AlexDaniel | e: say 42 | 23:30 | |
evalable6 | 42 | ||
tellable6 | 2023-03-07T02:40:12Z #raku <jdv> AlexDaniel ok | ||
2023-05-21T15:55:41Z #raku-dev <jdv> AlexDaniel who can fix missing builds on whateverable.6lang.org? | |||
2023-05-22T21:27:12Z #raku-dev <jdv> AlexDaniel around? whateverable builds are not happy. | |||
AlexDaniel | hello | ||
okay, last one is… wait when's that | 23:31 | ||
May 10th but part of 2023.09 release? What am I looking at exactly :o | |||
23:36
tea3po left,
tea3po joined
23:40
Camaleon left
23:46
jpn left
23:47
Vyrus left,
Vyrus joined
23:48
jpn joined
23:54
teatwo joined
23:57
tea3po left
|