🦋 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__ ugexe: what do you think about some new zef options: (1) remove all but the latest version of installed modules, (2) install the latest of all known modules, and (3), install modules named in a text (or JSON) file 11:21
nemokosch I think this is also a point that somebody must have raised earlier: zef install can install modules that it can't uninstall 11:33
the resolution is not the same
tbrowder__ an example? 11:41
nemokosch zef install IO::String installs Text::CSV 11:50
zef uninstall IO::String won't uninstall it
lizmat because Text::CSV depends on it? 11:53
tbrowder__ early on (and up until recently) i had the idea root could install system-wide modules for all users, but that turns out to be a nightmare. now i think the default is for whomever the user is, each user should manage his own.
nemokosch lizmat: because Text::CSV, the distribution exposed IO::String, a module 11:54
and it happens to have a higher version than IO::String, the distribution
lizmat does the Text::CSV version have an :auth? then maybe uninstall with that :auth? 11:55
tbrowder__ but i still have to test to see what happens when i, as root, install a module.
nemokosch I would be surprised if zef uninstall IO::String:auth<blah> would suddenly uninstall it but who knows 11:56
tbrowder__ originally, as root, i was installing to the site where rakudo was installed--bad juju for sure!
lizmat hmmm.. I guess you're right, you can only uninstall dists
nemokosch you know my opinion already 11:58
lizmat yes :-) 11:59
nemokosch The least controversial take is: it should be written with huge red bold letters that dependencies are not the distributions but modules which are associated to distributions
I'm willing to bet that most Raku users don't know it
hell, perhaps most Raku users don't know that there is a difference between "module" and "distribution" and why would they expect it 12:00
tbrowder__ nemokosch: i have always made my META6.json files have "modules distros" as dependencies, not modules inside other modules. 12:19
a 12:20
otherwise it makes no sense to me
nemokosch so you mean that if you used Cro::HTTP::Client, you would declare Cro::HTTP as the dependency? 12:25
ugexe uninstalling modules in general is not something to be taken lightly, particularly when you can have multiple versions installed 12:29
it is very easy to think that way though if you are just thinking about one or two things in isolation
tbrowder__ i would look at raku.land looking for Cro::HTTP::Client. gonna do that now
yes 12:30
i would put Cro::HTTP as dependency
nemokosch now, if everyone just did that, there would be no need to present modules as dependencies 12:31
which would solve all the problems of "modules as dependencies" 12:32
tbrowder__ i don't understand. are you saying zef will suck out only that module?
nemokosch no, and that's why it was always a bad idea
it's as if we started using keywords in the place of URL's, saying that a Google search will resolve them either way 12:33
what gets installed is always the distribution
tbrowder__ well i'm just a simple man, the way i use it is the way i saw it being used. i started with panda and zef grew out of that 12:34
nemokosch to be honest, I don't think zef as a tool is at fault 12:35
the very idea zef is built upon is the problem
tbrowder__ some of the very old modules reflect the wild west nature of the ecosystem as it started.
nemokosch zef does a decent job at making a terrible idea work reasonably well
tbrowder__ i guess what i call a "module" is now a "distribution" 12:36
so i'm a "distro" author.. who woulda ever thunk it. ma!
nemokosch :DDD 12:37
what do META files look like in Perl? 12:38
ugexe if our Version object had a way to make a range that is less-than a version (similar to how e.g. 1.8+ is a range that is greater than a version) then the uninstall thing would Just Work via like `zef uninstall SomeThing:ver<1.8->` (which would theoretically uninstall all modules less than version 1.8) 12:39
nemokosch github.com/Grinnz/Mojo-DOM58/blob/...A.json#L72 this is what I'm thinking of 12:40
Perl wraps modules up into distributions BUT it lets you define individual metadata for each of them
tbrowder__ i was just going to say our zef/fez system is worlds above cpan. and from limited experience with ruby, python, npm, and rust: better than those, too
not to speak of modern fortran 12:41
nemokosch better in what regard?
tbrowder__ use, visibility,... 12:42
community
ease of use
nemokosch I don't know, I've never had any problems with npm 12:43
neither with pip but I admittedly barely used that
tbrowder__ raku.land needs some help, but getting better (needs to move to github imho)
nemokosch yeah that's a touchy topic 12:44
by the way, raku.land is also themed around distributions, not modules.
tbrowder__ yes, i see that, 'cause that's the way lizmat's old system worked, too 12:45
lizmat my old system ? 12:46
tbrowder__ i would like to help raku.land but gitlab is too much pain for me now
yes the search bar on raku.org (or wherever it was)
you were the only person i remember working with it 12:47
gotta go...
librasteve I would like to zef install a directory via the resources in META6.json, but get this: ===> Install [FAIL] for Dan::Polars:ver<0.0.3>:auth<zef:librasteve>:api<1.1>: 'resources/dan/src' is a directory, cannot do '.open' on a directory 12:51
here's the META6.json resources tag: "resources": [ "dan/src", "libraries/dan" ], 12:52
is this possible? if so how to do it?
(libraries/dan is actually the so file libraries/libdan.so ... that part works fine) 12:54
ugexe you have to declare every file, not directory 12:55
i.e. dan/src/myfile1.c, dan/src/myfile1.h, etc 12:56
librasteve well that's ok for the src files, but i would also like to bring in the deps creatd by rust cargo build during the build phase ... something like "resources": [ "dan/src", "dan/target/debug/deps", "libraries/dan" ], 12:58
BUT there are 289 of these and that makes it a tad tricky ;-) 12:59
ugexe write something to populate it for you
say CompUnit::Repository::FileSystem.new(prefix => $*CWD.add("lib")).distribution.meta<resources> 13:01
evalable6 ()
ugexe for instance
(point it at the lib directory specifically so it doesn't use the existing META6.json and has to generate one)
then we print the output of the resources section of the META6.json data it guesses for the lib dir 13:02
you might have to modify the things in libraries/ though, i dunno if it can properly guess those
modify the things prefixed with libraries/ rather 13:03
librasteve okay ... I think I get the drift here ... 13:04
looks at the docs docs.raku.org/type/CompUnit/Reposi...FileSystem 13:07
so Build.rakumod is run # assuming one is cloned into the Dan::Polars git repository... i guess? 13:08
anyway I will make some attempt to try this and no doubt be back soon with more questions 13:10
thanks!
ugexe Build.rakumod gets run when its associated distribution gets installed, or when someone runs `zef build .` in a distributions repo 13:11
ugexe i wonder though if you couldnt just populate those before you author the module 13:11
if the files will always be the same for everyone then it shouldnt be done in Build.rakumod 13:12
although you still would probably run e.g. `make` that uses those files in Build.rakumod 13:13
librasteve the build process runs cargo build based on the Cargo.toml and this pulls in the rust deps for the rust source and that is when the deps are made (specifics would depend on the version of rust and all the deps that the rust polars library needs and will no doubt vary over time) 13:14
ugexe i suppose if some rust tool is generating those files at build time you'd have to generate in Build.rakumod, so nevermind all of that lol
librasteve and the rust deps are pinned with names like ffi_convert-8a839fdf5c77098d.d so I can't predict those either and you tell me that META6.json cannot have wildcards afaict 13:16
must dash 13:17
thanks for the pointer so far ... that will certainly open up a new front
Xliff \o 13:28
tbrowder__ on another subject, the "distro" i was having trouble with the last few days is Font::FreeType which does have a Build.rakumod at the top level. it builds and tests fine on three of my 4 debian hosts running raku. until yesterday it would not install on my new main host. it would get to a point and complain about a Slip that wasn't an IO path. that "slip" was triggered somehow by an exported variable pointing to a %?RESOURCES 13:33
file which is a system libray: libft6.so
late yesterday the installation finally worked. i do not understand Slips at all, but i hope someone can shed light on the problem. i wonder if i'm having a corrupted file somewhere or a system failure. 13:37
ugexe i think there code might be wrong
tbrowder__ i will ask on the debain list and hope a raku person is watching 13:38
ugexe %?RESOURCES<libraries/ft6>
they have that in their code
github.com/pdf-raku/Font-FreeType-.../libraries
but the file name listed in there (for linux) is libfreetype.so
%?RESOURCES<libraries/ft6> would point at like libraries/libft6.so 13:39
tbrowder__ yes, i changed that to <libraries/libft6.so> in their repo but didn't get far there.
ugexe it'd need to be changed to libraries/freetype
%?RESOURCES<libraries/freetype> 13:40
tbrowder__ well they point to both libraries. the freetype on works
it uses both libraries, one as a resource for generating the other 13:41
ugexe ah ok, so it does generate a libft.so file 13:42
libft6.so rather
tbrowder__ yes
so there is some guessng magic going on i can't get a "handle" on 13:43
i'll have to keep working with david the "distro" author 13:44
thanks for taking a look, nick 13:45
ugexe you might want to debug some of the values here -- github.com/pdf-raku/Font-FreeType-...od#L33-L34 13:46
you can clone that repo, cd into it, add some debug statements to print out what %vars is getting populated with, then run `zef build .`
or you could just run those freetype-config commands explicitly i suppose 13:48
that'll be useful to pass to the author
Geth ecosystem/main: d97d3700a4 | (Elizabeth Mattijsen)++ | META.list
Remove Term::termios

Now lives in the zef ecosystem
14:20
markb17 why dies True ~~ Int return True is this a bug? 14:50
nemokosch Bool descends from Int, it seems 14:52
hm, maybe all enums do 14:53
markb17 is this an issue with all enums?
nemokosch m: enum Direction <Left Right>; say Direction ~~ Int; 14:54
Raku eval True
nemokosch I suspect this is deliberate
markb17 then how do you tell the difference 14:55
nemokosch what would you like to do? 14:57
markb17 I need to tell if somethin is an Int and not a Bool 15:00
i guess i could use $x ~~ Int and $x !~~ Bool 15:01
nemokosch you could use .^name that returns a string or .WHAT that returns a type object 15:07
smartmatch is rather a match, not an equivalence check. If something is derived from Int it is an int
markb17 btw how do you submit bugs for the new doc site? 15:09
nemokosch there is a repo for content and one for the website 15:15
github.com/Raku/doc github.com/Raku/doc-website 15:16
lizmat m: True.WHAT =:= Int 15:28
camelia WARNINGS for <tmp>:
Useless use of "=:=" in expression ".WHAT =:= Int" in sink context (line 1)
lizmat m: my $a = 42; $a.WHAT =:= Int
camelia WARNINGS for <tmp>:
Useless use of "=:=" in expression ".WHAT =:= Int" in sink context (line 1)
lizmat m: my $a = 42; say $a.WHAT =:= Int 15:29
camelia True
lizmat m: my $a = True; say $a.WHAT =:= Int
camelia False
lizmat markb17 ^^
tbrowder__ ugexe: thanks. i'll wait on that for now. i got the repo to build fine on my "problem" host after i corrected the lib name we saw plus commenting out what i think is an incorrect test causing one failure. i've submitted a PR to the author 16:02
Xliff m: say False ~~ (True, False).any 16:52
camelia True
Xliff ^^ markb17, also
nemokosch that's not a good idea 18:01
True smartmatches anything to True, and False smartmatches anything to False
this is in order to support when in place of if 18:02
tbrowder__ ugexe: david says he was referring to your 2016 Advent article on the 19:14
special nature of RESOURCES<libraries> and I saw that's what he's counting on. somehow, it didn't work reliably on my one host. when i made the library name the actual name all was well on my main host. 19:17
thebb hope someone does a raku implementation of bluesky soon atproto.com/community/projects#at-...mentations 19:21
nemokosch well volunte- 19:32
tbrowder__ ugexe: david says he's keeping the repo as is (bummer). since it does rely on zef's magic, is it possible it's too much magic for some systems? in the meantime, i'll try your debugging suggestion. 20:00
ugexe that functionality is built into the core 20:11
m: say $*VM.platform-library-name("ft6".IO) 20:12
camelia "libft6.so".IO
ugexe tbrowder__: I think you should in that issue 1) the generated Makefile and 2) the output of `tree` inside the repo (so we can see all the files that exist and were generated 3) the output of running `zef build . --debug` inside the repo 20:19
i think you should post in that issue^
tbrowder__ will do 20:32
SmokeMachine lizmat: for splitting those method arguments, I'm thinking on doing something like this: 20:57
m: gist.github.com/FCO/56139e86d474cb...ace31fa293
camelia {a => 1, c => 2}
tbrowder__ ugexe: using zef and the current version of Font::FreeType, i have removed and successfully installed it 3 out of 4 times. it's installed now, i closed the PR. i did look at the vars, tree, and Makefile and all looked as expected. i must have bit flips from space radiation or something. keeping fingers crossed. 21:04
tbrowder__ and thank you very much for your help! 22:11