Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnucash: update webkit-gtk dependency #8069

Closed
wants to merge 1 commit into from

Conversation

jjstickel
Copy link
Contributor

  • change webkit-gtk3 dependency to webkit2-gtk
  • add post-patch reinplace to enable webkit2-gtk

Closes: https://trac.macports.org/ticket/52404

Description

I changed the path dependency to a direct port dependency. If it should remain a path dependency for webkit2-gtk, just let me know what it should be and I will amend the commit. I also labeled it bugfix because of https://trac.macports.org/ticket/60977 .

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 10.15.6 19G73
Xcode 11.6 11E708

Verification

Have you

  • checked your Portfile with port lint?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?

@macportsbot
Copy link

Notifying maintainers:
@drkp for port gnucash.

@macportsbot
Copy link

Travis Build #13306 Errored.

Lint results
--->  Verifying Portfile for gnucash
--->  0 errors and 0 warnings found.

The build timed out.

@mf2k
Copy link
Contributor

mf2k commented Aug 13, 2020

In order for anyone who has this port installed to see this change, the revision must be increased by 1.

* change webkit-gtk3 dependency to webkit2-gtk
* add post-patch reinplace to enable webkit2-gtk

Closes: https://trac.macports.org/ticket/52404
@jjstickel
Copy link
Contributor Author

In order for anyone who has this port installed to see this change, the revision must be increased by 1.

Done.

@macportsbot
Copy link

Travis Build #13309 Errored.

Lint results
--->  Verifying Portfile for gnucash
--->  0 errors and 0 warnings found.

The build timed out.

@drkp
Copy link
Contributor

drkp commented Aug 14, 2020

Have you confirmed that this works, in particular with reports? It doesn't seem to for me - all the reports are rendered blank.

I'm also getting

  Referenced from: /usr/lib/libarchive.2.dylib
  Expected in: /opt/local/lib/libiconv.2.dylib
 in /usr/lib/libarchive.2.dylib

errors, which suggests that this is a problem with gnucash adding /opt/local to DYLD_LIBRARY_PATH when it starts up. (It does that to find some of the plugin libraries... I thought I had fixed that at some point in the past.)

@jjstickel
Copy link
Contributor Author

Have you confirmed that this works, in particular with reports? It doesn't seem to for me - all the reports are rendered blank.

Reports are blank for me, too. I never use reports and so didn't think to check that part.

I'm also getting
...
errors, which suggests that this is a problem with gnucash adding /opt/local to DYLD_LIBRARY_PATH when it starts up. (It does that to find some of the plugin libraries... I thought I had fixed that at some point in the past.)

I get those as well when I tried running a report.

@jralls
Copy link

jralls commented Aug 14, 2020

Since GnuCash uses WebKit solely to generate reports it seems rather pointless to link it against a version of WebKit that doesn't render them.

That said, if someone in the MacPorts community can figure out why GnuCash works with WebKit2 on Linux but not on Mac and can offer a patch to fix it we'd love to get a PR!

@kencu
Copy link
Contributor

kencu commented Aug 15, 2020

I've been updating our webkit2-gtk ports the past while, and there are a few small patches we have to use to get it to build, but up to now, seemed everything was working. I'm also familiair with building gnucash. What would be the most effective way to debug this for you? Is there some kind of logging-enhanced env var to set, or some simple reproducer to focus on? Does it happen only with the quartz variant? As you know, webkit2-gtk is a behemoth...

@jjstickel
Copy link
Contributor Author

@kencu, FWIW, I installed with +x11, and the reports are blank for me.

@jralls
Copy link

jralls commented Aug 15, 2020

@jjstickel, Interesting about the reports on x11. Does the toy browser work (I've forgotten its name, it's part of the WebKit build)? All GnuCash does with text reports is write them to a temp file and then point the GtkWebKitWebView at them.

@kencu, I haven't tried webkit2 in GnuCash for a couple of years mostly because it's such a PITA to build. The last time I did the text reports displayed but the graphs would go off into javascript la-la land and never come back. I couldn't figure out how to debug it and the WebKitGtk guys weren't interested in helping so I took the easy way out of switching GnuCash to the WebKit1 API.

@kencu
Copy link
Contributor

kencu commented Aug 15, 2020

Does the toy browser work (I've forgotten its name, it's part of the WebKit build)?

The MiniBrowser works perfectly on +x11 and +quartz, I use it all the time.

All GnuCash does with text reports is write them to a temp file and then point the GtkWebKitWebView at them.

Perhaps someone might put a sample temp file here -- is it html? -- and we can see what is going on with that.

The last time I did the text reports displayed but the graphs would go off into javascript la-la land and never come back

And yet it works on Linux, you say? Maybe with an example file we might see why this happens.

@jralls
Copy link

jralls commented Aug 17, 2020

I don't know that that will be productive, but here you go:
income.html.zip

I expect that the minibrowser will have no trouble with it. It's GnuCash that has trouble, so build it with WebKit2 using this PR, generate graphical report and debug away. Since another user has reported that it doesn't even work to display a text report it's perhaps worthwhile to investigate that first.

The temporary report files are written to $TMPDIR and have names like gnc-report-XXXXXX.html (yes, they're made with mktemp.).

@kencu
Copy link
Contributor

kencu commented Aug 17, 2020

I downloaded that file, and it opens up blank with every browser I tried on MacOS -- Safari, quicklook, Google Chrome, and "Arctic Fox" all show a blank window.

At least that's a clue, I guess. I have no idea how to fix it, but perhaps someone does.

@kencu
Copy link
Contributor

kencu commented Aug 17, 2020

Oh -- a clue:

file:////Applications/Gnucash.app/Contents/Resources/share/gnucash/chartjs/Chart.bundle.min.js

MacPorts installs it's applications in /Applications/MacPorts/.

@jralls
Copy link

jralls commented Aug 17, 2020

OK, I don't use MacPorts. Edit the file and adjust the path. Being html it's plain text.

@kencu
Copy link
Contributor

kencu commented Aug 17, 2020

Is it possible that

file:////Applications/Gnucash.app/Contents/Resources/share/gnucash/chartjs/Chart.bundle.min.js

is being written into the html reports, even if the application is in /Applications/MacPorts/Gnucash.app?

If so -- there's the problem, perhaps.

@jralls
Copy link

jralls commented Aug 17, 2020

Or make your own: Reports>Income and Expense>Income Piechart. You can find the temporary file as noted above or use the export button on the GnuCash toolbar to write a copy anywhere you please.

@jralls
Copy link

jralls commented Aug 17, 2020

s being written into the html reports, even if the application is in /Applications/MacPorts/Gnucash.app?

No, the path that's written is to where ever share/gnucash is. Like I said, I don't use MacPorts. I dunno about MacPorts application bundles, but the ones I build for distribution can be put anywhere the user pleases. /Applications is where I please so that's where the path in the report points to.

@kencu
Copy link
Contributor

kencu commented Aug 18, 2020

Macports is installing that file here:

/opt/local/share/gnucash/chartjs/Chart.bundle.min.js

Next -- we see where gnucash on MacPorts is thinking that file is when it writes the html file...

@kencu
Copy link
Contributor

kencu commented Aug 18, 2020

the (edited) file displays properly in Safari, Google Chrome, Arctic Fox, and MiniBrowser, but not with Quicklook.

@kencu
Copy link
Contributor

kencu commented Aug 18, 2020

I can't make any headway here:

$ gnucash
Traceback (most recent call last):
  File "/opt/local/share/gnucash/python/init.py", line 6, in <module>
    from gi import require_version
ModuleNotFoundError: No module named 'gi'
Found Finance::Quote version 1.49.
dyld: Symbol not found: _sqlite3_intarray_bind
  Referenced from: /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
  Expected in: /opt/local/lib/libsqlite3.0.dylib
 in /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
dyld: Symbol not found: _sqlite3_intarray_bind
  Referenced from: /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
  Expected in: /opt/local/lib/libsqlite3.0.dylib
 in /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
dyld: Symbol not found: _sqlite3_intarray_bind
  Referenced from: /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
  Expected in: /opt/local/lib/libsqlite3.0.dylib
 in /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
dyld: Symbol not found: _sqlite3_intarray_bind
  Referenced from: /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
  Expected in: /opt/local/lib/libsqlite3.0.dylib
 in /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
dyld: Symbol not found: _sqlite3_intarray_bind
  Referenced from: /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
  Expected in: /opt/local/lib/libsqlite3.0.dylib
 in /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
dyld: Symbol not found: _sqlite3_intarray_bind
  Referenced from: /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
  Expected in: /opt/local/lib/libsqlite3.0.dylib
 in /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData

back to those who use this port -- needs some major surgery -- or perhaps just download the prebuilt binary and use that?

@jjstickel
Copy link
Contributor Author

back to those who use this port -- needs some major surgery -- or perhaps just download the prebuilt binary and use that?

Thank you for the effort. I was using the prebuilt binary until recently when the Gnucash port worked again (for awhile, before webkit-gtk3 breakage). The macports version just loads faster and, I hoped, would be easier to diagnose and tweak aqbanking and ofx import issues. Since I do not use reports, I can keep using macports gnucash with my local portfile, but I sure hope some others can help keep it going. I'm willing to help test, and do a little hacking, if someone points me in the right direction.

@drkp
Copy link
Contributor

drkp commented Sep 30, 2020

Okay, it looks like we have working reports if we apply this patch + fix up the environment to avoid the dyld problems mentioned above (#8069 (comment)).

Actually, I'm trying this with gnucash 4.2 since I was in the middle of updating the port, but I don't have any reason to think there are any relevant changes there.

Not sure why this works with MacPorts and its version of webkit2 but apparently not the prebuilt binary -- the issue with the environment is MacPorts-specific (and, as I mentioned above, something that I was pretty sure we fixed before; maybe the fix got broken by the move to cmake or something)

I'll push a patch later tonight.

@jralls
Copy link

jralls commented Sep 30, 2020

Did you test graph reports, e.g. Reports>Assets & Liabilities>Asset Piechart?

@drkp
Copy link
Contributor

drkp commented Sep 30, 2020

Did you test graph reports, e.g. Reports>Assets & Liabilities>Asset Piechart?

Yes, all the reports I tried (both graph and text) look fine!

@drkp
Copy link
Contributor

drkp commented Sep 30, 2020

I have only tried it with the x11 version of webkit2 so far. I'm dusting off a machine with a +quartz install to test that.

@jralls
Copy link

jralls commented Sep 30, 2020

Very good. Fingers crossed that it works on Quartz.

drkp added a commit to drkp/macports-ports that referenced this pull request Sep 30, 2020
 * switch to webkit2-gtk instead of outdated webkit-gtk3
 * add patch to fix DYLD_LOAD_PATH

Closes: https://trac.macports.org/ticket/52404
Closes: macports#8069
@drkp
Copy link
Contributor

drkp commented Sep 30, 2020

Looks like it works on +quartz, too.

Each report spawns a WebKitWebProcess that creates its own dock icon, which is a little weird, but apart from that the text and graph reports I tried (Income Piechart, Net Worth Barchart, Transaction Report) look okay.

@drkp drkp closed this in b10120c Sep 30, 2020
@jjstickel jjstickel deleted the gnucash-webkit2 branch October 1, 2020 01:58
@kencu
Copy link
Contributor

kencu commented Oct 21, 2020

Well, who would have believed my patch from 2 years ago actually worked fine, except for gnucash monkeying around with DYLD_LIBRARY_PATH that I didn't know was being done...

@jralls
Copy link

jralls commented Oct 27, 2020

Followup: I got it built in gtk-osx by pinching the macports patches and adding a couple more that I think were mostly required from building with Xcode-12's clang (so you might want to get them from gtk-osx). I've pushed a commit to GnuCash maint changing CMakeLists.txt so your patch won't be necessary in GnuCash 4.3.

I'll ask on webkit-gtk about the bogus WebKitWebProcess showing up in the dock, the task switcher, and on the menubar. It's pretty annoying. There's also a StackOverflow about it.

@jralls
Copy link

jralls commented Oct 30, 2020

And the answer, actually worked out by the browser project Nyxt: Call [NSApp setActivationPolicy: NSApplicationActivationPolicyProhibited] on the WebKitWebProcess. Gtk-OSX patch.

@jralls
Copy link

jralls commented Nov 8, 2020

Well, who would have believed my patch from 2 years ago actually worked fine, except for gnucash monkeying around with DYLD_LIBRARY_PATH that I didn't know was being done...

That's something of a left over. I've removed it for 4.3, replacing it with the more generally correct LTDL_LIBRARY_PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6 participants