-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
macOS - Electron 3 and sharp 0.21.1 issue #1519
Comments
Hello, my best guess would be that v8.6.x of libvips is installed globally on the OS X machine. If so, sharp v0.20.x will use it, but sharp v0.21.x will download a more recent libvips v8.7.0 and use that (hence the increased disk usage). Electron and shared libraries can be a bit of a minefield so I'd recommend either upgrading or removing the globally-installed libvips. |
Hi @lovell , Thank you for your answer.
What about machines without installed libvips? We provide our app to many users and it always works. Regarding your answer - it should mean, that our application cannot generate thumbnails on machines without globally installed libvips. And the most important thing - do you have any idea regarding the main problem of this issue with the newest sharp? For me it is not a problem to use older version, but I afraid that on the newer electron versions (electron 4 is in beta) I will have to upgrade sharp and then the mentioned problem will occur. If I can do anything what can help you to investigate this issue - just let me know :) |
My reply was specific to the OS X scenario you described rather than general to everyone. sharp will look for and use a globally-installed libvips (of a minimum version, see the changelog) before downloading its own local copy. Is there a globally-installed version of libvips on the OS X machine? It is the latest version? If not, does upgrading or removing it help? |
@dziudek Were you able to make any progress with this? |
@lovell - sorry for the late reply, in fact due the holidays I totally forgot about this issue - sorry :) Regarding the issue - I have checked if sharp or libvips is installed globally on my mac:
So for me it seems that libvips is not installed globally. |
Thanks, what does |
|
Thanks, what does sharp.versions return for both versions on this machine? (This exposes which dependencies sharp found at runtime.) |
All tests has been made under Electron 3.0.11
For sharp 0.20.8 during running dev version and after creating a production package it returns:
For sharp 0.21.3 during running dev version it returns:
For sharp 0.21.3 production version (which is not working) it returns (for me it is the same as for dev version but please check by yourself):
|
Thanks for confirming. What makes the "production" version different? Could something be altering the order of require statements? Is https://github.com/GetPublii/Publii/blob/master/app/package.json the relevant list of dependencies? I notice keytar is included, which is a native module that I think might also have a dependency on glib/gobject. sharp provides its own glib/gobject but keytar might rely on a system-wide version. |
I have checked production build without keytar, also I have checked production build without generating ASAR package. In both cases the issue still exists. |
Also upgrade to Electron 4.0.2 does not help. |
Thanks, the next step is for you to isolate the difference in the "production" environment vs the working "dev" environment. (If you're using Electron 4 then please see #1522.) |
Closing due to inactivity but please feel free to re-open with details of the difference between the "production" environment and the working "dev" environment. |
@lovell can we re-open this? What information can I help you get? If I copy sharp from my node_modules into the app it works. Here is a Dif between what works (sharp) and what doesn't (sharp_backup). $ diff -rq sharp sharp_backup/ |
Okay ... I think I figured out the problem ... We're suppose to ship symlinks/aliases. Electron-packager does a deref and is actually creating copies for each symlink during electron-packager. Since they are copies instead of symlinks ... it is trying to load it multiple times instead of once? Does that seem plausible? Worked around it with an afterCopy hook: |
@JakeRadMSFT |
I switched to travis ci for macosx builds (with electron-builder) for my electron (4.2.0) app. The build runs like charme and no global vips are installed. After i download the artifact and open it on my local macosx (without global vips) i get this error: (sharp:6164): GLib-GObject-WARNING **: 09:07:12.504: cannot register existing type 'VipsObject'
(sharp:6164): GLib-CRITICAL **: 09:07:12.504: g_once_init_leave: assertion 'result != 0' failed
(sharp:6164): GLib-GObject-WARNING **: 09:07:12.504: invalid class cast from 'VipsForeignLoadCsv' to '<invalid>' Strange thing: local build has around 212mb, built with the ci: 500mb node: 10.15.3 |
https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#derefsymlinks Please see also #1725, a similar example of webpack mistreating symlinks as real files. |
Hi,
During developing the newest version of Publii I have discovered a very strange issue with using latest version of the sharp module.
On development version all is working fine, but when I create production build and start thumbnail regeneration, the regeneration process crashes with the following errors:
I have discovered that using sharp 0.20.8 solves this strange issue.
I am using Electron v.3.0.11, node v.10.14.2 of course I am also using electron-rebuild (v.1.8.2) to compile the native packages. The problem exists only on macOS (newest mojave release), on Windows 10 I did not noticed this issue.
The text was updated successfully, but these errors were encountered: