Camelia, the Perl 6 bug

IRC log for #mojo, 2013-05-20

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:17 tempire I know
00:17 tempire I fixed it
00:17 tempire but got distracted and didn't upload it
00:23 sri indubitably
00:25 whitebook joined #mojo
00:41 shmuel joined #mojo
01:25 whitebook joined #mojo
01:56 d4rkie joined #mojo
01:56 Meiermann joined #mojo
02:33 jberger be glad you guys don't have midwest storms in Germany
02:34 jberger its like looking into a shotgun right now
02:34 jberger :o
02:44 jberger http://en.wikipedia.org/wiki/Bow_echo
02:46 jberger http://wxug.us/143gb
02:47 sri just a little rain here atm
02:48 jberger are there tornados in Europe?
02:48 jberger I don't hear of many at least
02:48 sri extremely rare
02:48 jberger I thought so
02:49 sri around here maybe one every ten or so years
02:49 * jberger can be kind of a weather geek
02:49 sri and they are pretty weak
02:49 jberger I think we average 400/year
02:49 jberger in the midwest
02:49 jberger so quite a large area
02:49 jberger but you still get nervous when you see these radar reading
02:49 jberger s
02:50 * sri has watched storm chasers
02:50 jberger oh I like that oe
02:50 jberger one
02:50 jberger thats good reality TV
02:53 jberger then again, I really don't want to see them driving into my town :-o
02:53 * jberger wonders if the stormchasers have a gps map
03:23 inokenty joined #mojo
03:24 russum1 joined #mojo
03:24 btyler joined #mojo
03:36 sh4 joined #mojo
03:41 fildon__ joined #mojo
03:46 sri fun fact, the owner of a google group can actually silence himself :)
03:57 buu joined #mojo
03:59 buu Why does mojo eat my fatal output during test scripts?
03:59 preflex_ joined #mojo
04:05 buu IT IS MADE OF SATAN AND I WILL DESTROY
04:16 buu http://scsys.co.uk:8002/249214
04:17 buu If I leave it like that, everyhing works as expected
04:17 buu If I uncomment the $self->test; line
04:17 buu All my output goes away =[
04:17 buu I'm executing this from a Mojo::Test environment
04:18 buu Test::Mojo that is
04:20 buu Is there some way to capture fatal outputs here?
04:20 buu Like a switch someplace that will output the death?
04:20 buu I'm assuming it's dying since none of my warns are being output
04:20 buu Because I can comment out the method call and all my warns show up
04:21 sri $t->app->plugins->unsubscribe('around_dispatch');?
04:22 sri normal verbose testing should give you more than enough information though
04:22 buu sri: Sorry, could you please elaborate on verbose testing? Is this the default setting or something I can enable?
04:22 sri prove -v
04:23 buu Oh, that.
04:23 buu I'm just running the test script itself right now, perl t/foo.t; and I have a bunch of warns sprinked through out the code, 1,2,3, and so on, then if I leave my method call uncommented they just stop
04:24 buu If I comment out the method call in the paste they go on from there..
04:24 buu Obviously I'm a bit perplexed and frazzled
04:24 sri well, if mojolicious catches it you'd get a 500 response
04:25 sri that's what the unsubscribe hack deactivates
04:25 buu Oh.
04:25 sri you run it before the first test and no automatic 500
04:26 buu I added that, unfortunately didn't change anything
04:26 buu sri: I just tried, in my code, changing $self->test(); to test(); and it printed the information inside test()
04:26 sri then it's something unusual
04:26 buu This is nuts.
04:27 sri otherwise we only have a few __DIE__ handler, but those just rethrow
04:28 buu sri: Oh. Ok A) I'm slightly an idiot, my problem was I was missing a declaration for $self. Which is dumb, but why didn't I get an error/
04:30 sri actually my advice with the unsubscribe was not very good, scratch that
04:31 sri the event loop will catch it
04:32 buu Oh
04:33 buu I suspect this was all my fault from the beginning, thanks a ton for listening though =]
04:33 buu I have added more checks to hopefully avoid this sort of thing.
04:33 sri if something dies you should at least see something in the logs though
04:34 buu sri: Well, I had a 'require $module' statement that was pulling it in in the first place
04:34 buu And I suspect it was dying during the initial loading of the app?
04:34 buu So I added an eval {} around it to report things
04:34 sri oh
04:34 buu But I mean, I would have thought the require would have propagated the error message; from trying to pull in the file
04:35 buu Since it will just die if it compiles something with an error
04:39 buu Anyways, added more happy little eval statements and all is right with my world!
04:52 abra joined #mojo
05:05 sh4 joined #mojo
05:09 sh4|2 joined #mojo
05:20 sri hmm
05:23 * sri wonders if we should have a MOJO_SECRET env var after reading http://daniel.fone.net.nz/blog/2013/05/20/a-​better-way-to-manage-the-rails-secret-token/
05:32 crab it's really not that big a deal
05:32 crab i just have a "secrets.conf" file that gets loaded if it exists, and is not in version control.
05:44 sri lets see
05:44 sri https://github.com/search?q=%22app-%3Esecre​t%28%22&type=Code&ref=searchresults
05:44 sri :)
05:45 basiliscos joined #mojo
05:47 crab hehe
05:47 crab app->secret(time()) is great
05:49 Britzel joined #mojo
05:49 xaka joined #mojo
05:52 zivester joined #mojo
06:26 mire_ joined #mojo
06:33 KindOne joined #mojo
06:35 Mike-PerlRecruiter_ joined #mojo
06:50 denisboyun joined #mojo
06:53 egopro joined #mojo
07:16 Vandal joined #mojo
07:16 arthas joined #mojo
07:25 cosimo joined #mojo
07:38 moritz joined #mojo
07:38 moritz oh hai
07:38 moritz I have some code that use Mojo::DOM->charset
07:38 moritz what should I replace that with, now that charset is gone?
07:40 * moritz got http://www.cpantesters.org/cpan/report​/b30bee0a-6c92-1014-8ed7-16e692c9f027 today
07:41 moritz and preferably I'd like a replacement that doesn't require bleeding edge mojolicious
07:42 jzawodn joined #mojo
08:25 marcus joined #mojo
08:25 batman joined #mojo
08:46 dod joined #mojo
09:11 dod joined #mojo
10:00 xaka joined #mojo
10:11 MeierM joined #mojo
10:28 yakudza joined #mojo
10:29 denisboyun joined #mojo
10:47 denisboyun joined #mojo
11:05 egopro joined #mojo
11:06 mire_ joined #mojo
11:11 ver joined #mojo
11:23 yakudza joined #mojo
11:33 patspam joined #mojo
11:41 patspam left #mojo
11:43 whitebook joined #mojo
12:09 bowtie joined #mojo
12:24 egopro joined #mojo
12:25 memowe stephan48: awesome, thanks!
12:26 stephan48 regarding the Subdispatch patch, please look over it i migh have forgotten to change the non form tx to the new syntax
12:31 stephan48 ah no seems to be ok
12:41 moltar joined #mojo
12:49 whitebook joined #mojo
12:56 btyler joined #mojo
13:13 depesz joined #mojo
13:13 depesz hi. is there anything that can be done to *not* get these in logs: "[debug] Careful, "layout" is a reserved stash value."?
13:17 cstamas depesz: you can change the loglevel
13:18 cstamas depesz: you will not get any debug messages then...
13:18 cstamas is anyone using debian here with mojolicious ?
13:19 depesz well, but I'd like to get debug messages - it's just that this one seems to be generated by perfectly normal % layout '...'; directive.
13:19 depesz so the "careful" thing makes me worried
13:20 cstamas depesz: which version do you use?
13:20 depesz 4.01
13:21 depesz simple: mojo generate app, and then starting it, entering the page, and in log/development.log you get these messages
13:21 cstamas i am a few versions behind, we have to wait for the others
13:21 depesz "Solved"
13:21 depesz "Solved" it by moving layout declaration to lib/app.pm with: $self->defaults(layout => 'default');
13:23 cstamas depesz: nice
13:24 bluescreen joined #mojo
13:25 denisboyun joined #mojo
13:36 egopro joined #mojo
13:38 whitebook joined #mojo
13:48 egopro joined #mojo
13:52 jberger hmmmm, that seems odd
14:12 gryphon joined #mojo
14:13 xaka joined #mojo
14:14 salparad1se joined #mojo
14:17 bluescreen joined #mojo
14:22 sh4 joined #mojo
14:31 mire_ joined #mojo
14:34 inokenty joined #mojo
14:40 egopro joined #mojo
14:43 labrown joined #mojo
14:44 rhaen joined #mojo
14:44 sri depesz: oops, my bad, i broke those helpers
14:50 good_news_everyone joined #mojo
14:50 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/nGI4pA
14:50 good_news_everyone mojo/master dcc4f1f Sebastian Riedel: fixed extends, layout and title helpers not to generate unnecessary log messages
14:50 good_news_everyone left #mojo
14:51 sri the first real 4.0 regression
15:01 depesz sri: sorry for bringing bad news :)
15:25 btyler joined #mojo
15:34 mattastrophe joined #mojo
15:37 Akron joined #mojo
15:40 sri moritz: https://github.com/kraih/mojo/blo​b/master/lib/Mojo/Message.pm#L76
15:41 Akron sri: Why not try reading secret from app->config('secret') first?
15:42 sri that's not backwards compatible
15:43 Akron ->config('mojo.secret')?
15:43 sri ewww
15:43 Akron "mojo.*" is all yours!
15:43 denisboyun joined #mojo
15:43 sri and reserved for internal use
15:43 sri if we do that for config we basically encourage the use of the stash values
15:45 sri think we'll just not change anything about the secret
15:45 Akron maybe it would be nice to introduce a 'mojo' configuration hash to set environmental stuff. Seems to be easier for shipping somehow ...
15:48 Akron Similar to the "hypnotoad" stuff.
15:50 egopro joined #mojo
15:53 d4rkie joined #mojo
16:00 rem_lex|pivo joined #mojo
16:05 mire_ joined #mojo
16:06 delias joined #mojo
16:16 * tempire twerks
16:18 xaka joined #mojo
16:18 Akron joined #mojo
16:23 tianon secret in the config or environment seem like perfect candidates for a plugin to me :)
16:23 tianon then there are no new special config keys and sri stays happy :)
16:24 sri \o\
16:24 sri /o/
16:34 connor_goodwolf joined #mojo
16:53 good_news_everyone joined #mojo
16:53 good_news_everyone [mojo] kraih tagged v4.02 at a39212b: http://git.io/fZIpHg
16:53 good_news_everyone left #mojo
17:18 memowe joined #mojo
17:29 basiliscos joined #mojo
17:34 two_tired joined #mojo
17:36 two_tired Are there any good examples of how the config files for Mojolicious::Plugin::Config should look? And how you retrieve the individual config settings?
17:39 perl2012 joined #mojo
17:39 perl2012 how do I send custom headers in Test::Mojo?
17:42 tianon two_tired: they should look like a perl hashref: { config1 => 'value1', config2 => { many => 'values' } };
17:43 two_tired cool thanks, I'll just try it out
17:45 tianon two_tired: also, http://mojolicio.us/perldoc/Mojo#config
17:45 tianon also, the docs for Mojolicious::Plugin::Config start with an example of how the .conf file should look ;)
17:46 tianon perl2012: http://mojolicio.us/perldoc/Test::Mojo#get_ok -- DNT is a custom header being sent in the examples there
17:47 perl2012 tianon - thanks - so to send multiple headers, would it be  $t->get_ok('/foo' => {DNT => 1, Header2 => 'Value' })
17:47 tianon perl2012: exactly :)
17:48 perl2012 tianon - awesome - thanks!
17:48 good_news_everyone joined #mojo
17:48 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/_2diuw
17:48 good_news_everyone mojo/master 2fec633 Sebastian Riedel: better examples for config plugins
17:48 good_news_everyone left #mojo
17:49 tianon perl2012: and in case that's not flexible enough, there's also request_ok: http://mojolicio.us/perldoc/Test::Mojo#request_ok
17:49 tianon but in general, get_ok, head_ok, etc. are probably sufficient
17:49 perl2012 yup, I think what you should me will work great.
17:49 tianon also, sri++ for being "responsive" again :)
17:50 tianon responding to questions with commits \o/
18:02 good_news_everyone joined #mojo
18:02 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/aFD_Fg
18:02 good_news_everyone mojo/master c9b6f1e Sebastian Riedel: removed a few more generic Changes entries
18:02 good_news_everyone left #mojo
18:03 sri tianon: i've done that less recently because most questions are already answered ;p
18:03 SmokeMachine joined #mojo
18:04 sri wonder if we should clear Changes every major release though
18:04 sri it's pretty big
18:04 tianon lol, indeed :)
18:04 tianon that's probably a pretty good idea, or maybe keep it down to just two major releases worth?  just spitballing :P
18:05 sri also when does a new development cycle start, with 4.0 or 4.01? :)
18:05 sri 4.01 - 5.0 kinda makes sense considering how we count new features to the next major release
18:06 al joined #mojo
18:06 sri tempire, marcus, jberger, crab: thoughts about clearing Changes?
18:07 tempire I don't see any reason to clear it
18:07 sri it's HUGE
18:08 tempire if it gets big enough to crash text editors, then there will be a problem
18:09 sri 3170 lines now
18:09 tempire so in a decade, there might be an issue
18:09 jzawodn Changes-1.x, Changes-2.x, Changes-3.x, Changes-4.x, Changes symlink to Changes-4.x
18:09 tempire I'll be developing on my google glass, though
18:10 tempire by that time
18:10 * sri shrugs
18:13 btyler joined #mojo
18:17 * sri wonders if anyone has noticed yet how much less resources the event loop and built in web servers use
18:20 memowe joined #mojo
18:22 jberger_ I'm not opposed to Changes-1.X etc
18:22 jberger_ but no symlink
18:22 jberger_ current major release should be Changes
18:22 jberger_ some platforms cannot do symlinks
18:22 jberger_ and some automated tools look for Changes
18:22 jberger_ by name
18:35 Mike-PerlRecruiter_ joined #mojo
18:42 heytrav joined #mojo
19:19 stephan48 maybe make a Changes.old file?
19:20 stephan48 1-2 majors in Changes and the rest in Changes.old, if a platform somehow needs a complete changes file... it could just easily concat the two
19:23 jnbek joined #mojo
19:25 memowe joined #mojo
19:32 tempire A large changes file is a non-problem
19:33 sri splitting it up is the last thing i'd want
19:46 SmokeMachine joined #mojo
19:47 bluescreen_ joined #mojo
20:07 ikegami left #mojo
20:49 perlite joined #mojo
21:09 alester joined #mojo
21:18 Britzel Somehow I don't udnerstand the warnimng with list context  at Mojolicious/Controller#param
21:18 Britzel I try to get a list of same-named parameters with @mylist = $self->param('nameofparms');
21:19 Britzel but that fails, the returned value is empty (not undef).
21:19 Averna joined #mojo
21:19 Britzel That's a GET request, if tha tmakes any difference.
21:23 sri here's a list context attack
21:23 sri perl -Mojo -E 'a(sub { $_[0]->render(foo => $_[0]->param("foo")) })->start' get '/?foo=bar&foo=inline&foo=%3C%25​%3D%20app-%3Esecret%20%20%25%3E'
21:24 sri or to make it even more obvious
21:24 sri perl -Mojo -E 'app->secret("ohoh!"); a(sub { $_[0]->render(foo => $_[0]->param("foo")) })->start' get '/?foo=bar&foo=inline&foo=%3C%25​%3D%20app-%3Esecret%20%20%25%3E'
21:25 Britzel argl, ok, sorry for the bandwitdh. Typo, I should probably go to bed...
21:40 lukep joined #mojo
21:58 gork joined #mojo
22:02 gork Hello all; I am starting with some Mojo development moving primarily from a mod_perl background. I am a little hung up on expanding from the standalone development & morbo server into hypnotoad. is there something similar to mod_perl PerlChildInitHandler that can run in each worker prior to it beginning to accept connections. or have i got my brain around this the wrong way
22:05 gork the trick of Mojo::IOLoop->timer(0 => sub {}); from the docs seems to run twice in each child for some reason
22:08 buu gork: Does the code in 'startup' run once per child?
22:10 sri perl -Mojo -E 'my $i = 0; Mojo::IOLoop->timer(0 => sub { say $$, "-", ++$i }); a({text => $i})->start' prefork
22:11 sri (prefork is basically hypnotoad without zero downtime restarts)
22:11 whitebook joined #mojo
22:11 sri yay for being able to test pretty much everything with oneliners
22:11 sri another good reason to have the prefork command
22:13 sri just switch the command to test differences between daemon and prefork :)
22:13 sri perl -Mojo -E 'my $i = 0; Mojo::IOLoop->timer(0 => sub { say $$, "-", ++$i }); a({text => $i})->start' daemon
22:16 sri gork: although, i wonder what kind of stuff do you need to setup in a PerlChildInitHandler?
22:16 gork well yes i should have said the timer does not double fire unless i call a helper function that sets up some async stuff via AnyEvent/EV
22:18 gork the children need to connect to a server and then  issue some commands via nonblocking io to establish an initial 'state' and then they continue to receive events from that other connection to update their state. clients connecting via the web get a copy of the initial state and then receive updates via websocket... so really the children need to delay receiving connections until they have received responses to all of their commands to determine initial state
22:19 sri sounds like bad design tbh
22:19 ron-slc joined #mojo
22:21 sri unless those initial commands take forever to finish
22:21 gork Yes technically it would be better to have mojo handling basically pub/sub stuff and an external worker doing the updates but i started trying to stuff it all into one; the initial commands take about 1s to complete and only need to be done once ever per worker
22:23 sri i'm only guessing here, but it sounds like you're trying to run event loops recursively, that's not gonna work
22:24 sri as in start another event loop from inside the timer
22:24 sri to block until you're finished
22:26 gork ah yes i am not trying to do that but i see that is most likely what is happening
22:27 sri anyway, if you've designed your code non-blocking, i'm afraid you'll have a very hard time keeping the hypnotoad worker from accepting connections
22:28 gork use of the timer was just an attempt to get blocking code running at the beginning of the worker; however i believe a more reasonable approach will be to stall the response to the worker's initial client during the request
22:28 sri on the plus side, if you've designed your non-blocking code well it doesn't matter, since incoming connections will just wait for your initial setup to finish
22:28 sri right
22:29 sri that's how Mango handles authentication, which involves multiple roundtrips
22:30 sri not that it's a great example
22:31 gork OK well it is something to start with anyway. i am obviously still getting into the right mindset here; pardon my green questions and thanks a ton for all your work
22:32 sri CONNECT support in Mojo::UserAgent would also be an example
22:32 gork roger
22:34 sri not sure how you managed to restart the event loop btw. it shouldn't be possible
22:35 * sri shrugs
22:37 gork I believe AnyEvent is detecting the recursion. i got it to spit out an error finally
22:37 gork Timer 1a80a279f61a8129e28fcfeac4eb6bd0 failed: AnyEvent::CondVar: recursive blocking wait detected at /home/gork/polymojo2 line 200
22:38 sri indeed
22:38 gork that is AE::cv->recv
23:09 whitebook joined #mojo
23:31 perl2012 joined #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary