[GNC] GnuCash 5.5 (macOS) can't get quotes, because it doesn't see JSON::Parse

Jim DeLaHunt list+gnucash at jdlh.com
Sun Dec 24 14:30:13 EST 2023


On 2023-12-24 10:25, john wrote:
>
>> On Dec 23, 2023, at 20:03, Jim DeLaHunt <list+gnucash at jdlh.com> wrote:
>>
>> ...Then I launched the GnuCash application. Now, the "Get Quotes" button in the Price Database dialogue was active, and I could retrieve quotes successfully.
>>
>> Yay!
>>
>> Conclusions I tentatively draw from this experience:
>>
>> 1. GnuCash users on macOS with Apple Silicon must be careful to run
>>    gnc-fq-update with the arch -arch x86_64 qualifier.
>> 2. gnc-fq-update fails to report at least some problems with Perl
>>    modules compiled for Apple Silicon, where the GnuCash application
>>    rejects the configuration.
>> 3. When the GnuCash application rejects the configuration due to Perl
>>    modules compiled for Apple Silicon, neither the diagnostics printed
>>    by gnucash-cli nor the telemetry in the --debug log written by the
>>    GnuCash application mentions that Perl modules compiled for the
>>    wrong architecture are the problem.
>> 4. It would be nice if the GnuCash + Finance::Quote system did not
>>    suffer from this fragility. But I understand that the root cause of
>>    the fragility is that WebKitGtk doesn't work when built for Apple
>>    Silicon, and that is not trivial to overcome.
>> 5. The Online Quotes wiki page should get some information about the
>>    need to get Perl modules compiled for x86 architecture, but I don't
>>    think I know enough to write that information correctly.
>>
>> Does that sound right?
>>
>> Again, thank you for your help, John.
> Jim,
>
> ...the parts that were actually causing the problem are /Library/Perl/5.30/darwin-thread-multi-2level/auto/DateTime/DateTime.bundle and JSON/Parse.bundle, the compiled C resources that the perl parts depend on...
Thank you for this information, John. It is way more than I know about 
how Perl modules work on multi-architecture aware macOS.
> ...GnuCash's perl scripts, finance-quote-wrapper and gnc-fq-update, are of necessity quite generic: They have to run on both Unix and Microsoft operating systems. Moreover perl itself doesn't report many errors in machine-interpretable form. It would be difficult to get the information that modules installed for the wrong architecture into a tracefile....

I see the problem. Yet I suspect that the Finance::Quote infrastructure 
is getting complex and error-prone enough that it is worth more 
attention.  I also suspect that this problem seems big to me because I 
just experienced it. It may now work for me, so that I may be able to 
ignore it for the next five years — and then the Finance::Quote 
infrastructure will seem elegant and reliable to me. :-)

One of my confusions was that "gnc-fq-update" said that the necessary 
modules were installed, while "gnucash-cli --quotes info" reported that 
one of the options was missing. How about having gnc-fq-update and 
gnucash-cli --quotes info both check not just what modules Perl say it 
has installed, but attempting to initialise Finance::Quote and retrieve 
a quote as well?  I suspect that in my case, the attempt to initialise 
Finance::Quote would have failed.  Then those diagnostics perhaps would 
have given me better information.

> As for the wiki's Online Quotes page, are the year-old directions to prefix gnc-fq-update with arch -arch x86_64 on Apple Silicon macs not clear enough? What more should it say? Perhaps something about diagnosing a failed installation and the steps needed to repair it?

I did not see those instructions, because they were about 60% of the way 
through over 100kB of text, under a heading of "Installing 
Finance::Quote on macOS" 
<https://wiki.gnucash.org/wiki/Online_Quotes#Installing_Finance::Quote_on_macOS>, 
and my framing of the problem was that I was troubleshooting an 
installed and functional Finance::Quote deployment which stopped working 
when I upgraded the GnuCash application.

So, certainly making a reference to macOS architectures in the 
troubleshooting section would help. Refactoring that page into focussed 
parts much shorter than 100 kB would help also.

Thank you again for your helpful answers, your expertise, and your 
careful building of all this mostly-elegant and mostly-reliable 
infrastructure.

Best regards,
     —Jim DeLaHunt



More information about the gnucash-user mailing list