Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6-toolchain, 2017-03-27

| Channels | #perl6-toolchain index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
01:49 ilbot3 joined #perl6-toolchain
01:49 Topic for #perl6-toolchain is now Fire is step THREE! | https://github.com/perl6/toolchain-bikeshed | Channel logs: http://irclog.perlgeek.de/perl6-toolchain/today | useful prior art: https://metacpan.org/pod/CPAN::Meta::Spec
05:27 domidumont joined #perl6-toolchain
06:14 domidumont joined #perl6-toolchain
08:42 llfourn can you get your META6.json from your module like you can get your resources?
10:51 llfourn joined #perl6-toolchain
12:07 nine Not as easily.
12:08 nine You can use $*REPO.resolve(CompUnit::DependencySpecification.new(:short-name<Test>)).distribution.meta
12:47 perlpilot joined #perl6-toolchain
13:31 llfourn nine: cheers that'll do.
13:34 llfourn nine: I think a multi candidate for $*REPO methods that just take simple args. Like $*REPO.need(:short-name<Test>), would be nice.
13:38 nine But need() takes: CompUnit::DependencySpecification $spec, CompUnit::PrecompilationRepository $precomp = self.precomp-repository(), CompUnit::PrecompilationStore :@precomp-stores = Array[CompUnit::PrecompilationStore].new($precomp.store)
13:39 * llfourn takes a look at src
13:43 llfourn I think you could have a multi that just slurped *%args that weren't taken and did self.need(CompUnit::DependencySpecification.new(|%args),|@_,:@precomp-stores)
13:48 nine Much complexity just to save some typing for a very rarely needed operation
13:50 llfourn I suppose. Though every cli tool I have I would like to spit out the version in the USAGE. The best place to get it is the META6.json. It would be nice not to have to type all that to get it.
14:04 ugexe originally there was supposed to be a %?META
14:11 ugexe also note that `$*REPO.need(CompUnit::DependencySpecification.new(:short-name($name))).distribution.meta<version>;` won't work for ::FileSystem
14:12 llfourn ugexe: oh? how come?
14:12 ugexe because it doesn't set .distribution in its CompUnit
14:13 ugexe the problem there being that ::FileSystem is sort 2 repos in one... because it'll use your META6.json if you -I. but not if you -Ilib
14:14 ugexe e.g. ::FileSystem should probably  handle META6.json only, and ::AbsolutePath should be changed to handle the alternative
14:15 llfourn ugexe: I seem to get .distribution.meta using -Ilib
14:15 llfourn but it doesn't have <version> in the hash...
14:15 ugexe try ver
14:16 llfourn oh no it gives me: {auth => perl, files => {}, name => CORE, provides => {CompUnit::Repository::Staging
14:16 llfourn looks like it gives me the wrong one lol
14:16 ugexe oh, right. it invents a META6.json on the fly
14:16 llfourn oh no im an idiot
14:16 llfourn I just copied nine's code without changing it. RIP.
14:17 llfourn ok it gives me: Type check failed in binding to '$repo-id'; expected Str but got Nil (Nil)
14:17 ugexe yeah me too, it doesnt create one on the fly. it used to
14:18 llfourn (but that was because I don't have a module with the same name as my distribution)
14:19 llfourn a compunit rather
14:19 llfourn if I do it with a compunit name that exists I get: Legacy Distribution object used in code expecting an object consuming the Distribution role
14:21 ugexe heh
14:22 ugexe whats the full ll-exception?
14:22 ugexe I wonder where its calling Distribution.new at...
14:22 llfourn it only calls it when I do .meta
14:23 ugexe yeah, but it has to create the legacy distribution object somewhere
14:24 ugexe that error is a side-effect of when we switched to Distribution as a role instead of a class - its a workaround to maintain backwards compat
14:24 llfourn from SETTING::src/core/control.pm:178  (/Users/llfourn/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm:die)
14:24 llfourn from SETTING::src/core/control.pm:166  (/Users/llfourn/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm:die)
14:24 llfourn from SETTING::src/core/Distribution.pm:13  (/Users/llfourn/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm:meta)
14:24 ugexe go another few lines?
14:24 llfourn oops first line was:
14:25 llfourn at SETTING::src/core/Exception.pm:63  (/Users/llfourn/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm:throw)
14:25 ugexe Want to see *where* Distribution.new was called
14:25 ugexe er it probably doesn't track that
14:25 llfourn from gen/moar/Metamodel.nqp:1733  (/Users/llfourn/.rakudobrew/moar-nom/install/share/nqp/lib/Perl6/Metamodel.moarvm:)
14:25 * llfourn figures out where that is to be useful
14:25 ugexe I guess I could try it myself too lol
14:26 ugexe hmm I get the expected `Could not find ZefX at line 0 in:
14:27 ugexe thats installed though and not in a lib/...
14:28 ugexe yeah I get the error you got when I mv lib/Zef.pm6 lib/ZefX.pm6
14:32 llfourn $*REPO.resolve(CompUnit::DependencySpecification.new(:short-name<Spit::Compile>)).distribution.meta<ver>
14:32 llfourn that works when it's installed :)
14:32 ugexe yeah it works when things are installed
14:33 ugexe to a CURI
14:33 ugexe just not for other CURs
14:34 ugexe also for CURI you can just call .version on the CU
14:35 ugexe still dont understand where that Legacy Distribution error is getting invoked from tho
14:35 ugexe git grep "Distribution\.new" didnt reveal anything
14:38 llfourn ugexe: but it doesn't need to call new just .meta
14:38 llfourn which can be called on the type object
14:39 ugexe ah, so its setting `:distribution(Distribution)` then you think?
14:40 llfourn yeah something like that
14:40 llfourn I'm off for sleeps. Thanks for the help nine++ and ugexe++.
17:49 domidumont joined #perl6-toolchain
19:39 ugexe joined #perl6-toolchain
23:53 nbrown joined #perl6-toolchain

| Channels | #perl6-toolchain index | Today | | Search | Google Search | Plain-Text | summary