kthakore said on Padre’s IRC channel today:
kthakore I figured out padre fail !!!!! yay! so simple. Padre couldn’t write config.yml
You may know that I always try to get people on Padre. kthakore already walked into this trap some time ago
I asked him to add a error message for this failure, but he’s a Perl SDL expert and has not much time to work on Padre, so he said
kthakore Sewi: I have no clue where this is please point me to the right direction.
Here is a walk we did together looking for the source of the problem (or: the problem in the source):
Preparing the workspace
My Padre is running with directory and function-list panels enabled which really speeds up work.
Looking at the Padre source…
…shows a Config.pm module. It might be a good start – we’re talking about config problems.
It has few methods (shown on the right side in the function list panel) even if it’s a very big file. One of the methods is called write and there is no other one with a similar name. A double click on the method name jumps to it’s declaration.
The write method is unfriendly – it doesn’t show clearly what it does: Something with a “Human” and a “Host” config, but the directory panel might help us: There is a “Config” directory and by clicking on the icon in front of the Config directory, the browser shows the content. Oh, there are also Human.pm and Host.pm.
Human.pm uses some YAML module which sounds good – our problem was config.yml. This module has a write method, too.
Here we are. We found the place where the config is being written by jumping through the source using Padres panels.
An open file dialog could do the same as the directory panel, but it’s less visible and the structure usually gets lost.
Searching for “sub ” through the files would also work – but the functions list shows the list much faster and you could even see the write method accidently even if you don’t search for it.
The hardest part is the start. Where to start, in a project like Padre which has megabytes of source code. Another idea was the filename: “config.yml” must be defined somewhere. Even if it’s being put into a constant or variable, the constant or variable must be used somewhere.
Debugging well-structured Perl projects usually means jumping through files, looking for references or referenced things, following method calls and multi-level @ISA definitions, but you’ll get a good picture of your problem and the reasons soon.
kthakore found the right place within few minutes and is creating a fix for the problem while I’m writing these lines…
