-
Notifications
You must be signed in to change notification settings - Fork 2
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
PyInstaller executable does not find Qt WebEngine Process #145
Comments
I'm not sure if this is relevant |
@0xWOLAND Thanks for posting. At first glance, this looks like a configuration issue, perhaps related to the PyInstaller spec, or perhaps a macOS-specific issue. However, your statement
Suggests there may be something else going on. In essence, The basic steps taken by the update client on macOS are as follows:
Perhaps something is going wrong during one of the last steps on macOS... Some questions to get more insight:
|
Another thing you could try:
|
Here is my spec file:
If I do this, the executable works. |
Update: doesn't work with |
If I run |
It seems like the file |
@0xWOLAND: tufup supports two types of updates:
Patch update files are typically much smaller, and therefore much quicker to download. The only drawback is that creation of the binary patch, on the repo side, takes a long time and a lot of memory, as explained in #105. However, you only need to do that once for every release. Patch application, on the client side, is (relatively) fast. After patch application, the resulting archive must be byte-by-byte identical to the new archive. This is verified by checking the length and hash. So, in the end, as long as the patch procedure succeeds, it should not matter whether you do a patch update or a full update, because you end up with the exact same file bundle. If you do see a difference in operation between full mode and patch mode, perhaps some error is being silenced inadvertently. Could you post the command line output of a failed update attempt on the client-side, with |
@0xWOLAND Just to be sure: Did you try setting PyInstaller<6.0 used to have a specific runtime hook doing just that, but this has been removed in pyinstaller 6.0. See pyinstaller/pyinstaller#7619 and the pyinstaller 6.0 changelog. Also see understanding-pyinstaller-hooks and changing-runtime-behavior for more info. In any case, |
Another question: what is the exact |
Seeing that your pyinstaller bundle does appear to work when you do it manually, but then does not work after tufup copies it into place, suggests that something strange may be going on with the paths. For example, an absolute path issue, or something with relative paths that do not take into account the app being in a subfolder. Tufup does not modify the files or directories inside your app bundle, but it does determine where the bundle itself is located. Did you verify that the directory structure in the |
I ran |
Not sure this is what I'm looking for. Let me clarify:
In any case, I cannot do much else without seeing a complete, minimal reproducible example. Note the emphasis on complete and minimal. ;-) It also helps to start reproducing the issue from a completely clean slate. |
Hey, I'm currently working on building a minimal reproducible example. I think I tried manually setting the os.environ["QTWEBENGINEPROCESS_PATH"] = os.path.normpath(
os.path.join(
sys._MEIPASS,
"PySide6",
"Qt",
"lib",
"QtWebEngineCore.framework",
"Helpers",
"QtWebEngineProcess.app",
"Contents",
"MacOS",
"QtWebEngineProcess",
)
)
os.environ["QTWEBENGINE_RESOURCES_PATH"] = os.path.normpath(
os.path.join(
sys._MEIPASS,
"..",
"Resources",
"PySide6",
"Qt",
"lib",
"QtWebEngineCore.framework",
"Resources",
)
)
os.environ["QTWEBENGINE_LOCALES_PATH"] = os.path.normpath(
os.path.join(
sys._MEIPASS,
"..",
"Resources",
"PySide6",
"Qt",
"lib",
"QtWebEngineCore.framework",
"Resources",
"qtwebengine_locales",
)
) which seems to get rid of the issue. However, a new issue arises: [87489:86787:0609/221319.040978:ERROR:child_process_launcher_helper_mac.cc(166)] Failed to compile sandbox policy: empty subpath pattern
[87489:86787:0609/221319.155533:ERROR:child_process_launcher_helper_mac.cc(166)] Failed to compile sandbox policy: empty subpath pattern Do you have any thoughts on how to resolve this? |
@0xWOLAND This again looks like something related to PyInstaller, QtWebEngine, and Chromium on macOS. Perhaps you can find some clues in one of the following issues/prs:
There's also an unanswered question on SO that may be related, although this is not very helpful. Just to verify: In your original post you mentioned using PyQt6, but now I see you are using PySide6? Their APIs may be nearly identical, but it's an important detail. |
Thanks for the quick reply! Here's the minimal example |
I forgot to mention that the same behavior as earlier occurs, except this error takes place instead. |
That's a good start, but minimal implies remove everything that is not required to reproduce the issue. For example:
and so on and so forth, until you have the absolute minimum necessary to reproduce the issue. |
Looks like simply disabling sandbox (following the docs) works. All I had to do is dyld[40500]: Library not loaded: @rpath/QtWebEngineCore
Referenced from:
/Users/USER/Applications/myapp/myapp Runtime.app/Contents/Frameworks/PySide6/Qt/lib/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess
Reason: tried:
'/Users/USER/Applications/myapp/myapp Runtime.app/Contents/Frameworks/PySide6/Qt/lib/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/../../../../../../../../../../QtWebEngineCore' (no such file),
'/Users/USER/Applications/myapp/myapp Runtime.app/Contents/Frameworks/PySide6/Qt/lib/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/../../../../../../../../../../QtWebEngineCore' (no such file),
'/usr/local/lib/QtWebEngineCore' (no such file),
'/usr/lib/QtWebEngineCore' (no such file, not in dyld cache)
dyld[40501]: Library not loaded: @rpath/QtWebEngineCore
Referenced from:
/Users/USER/Applications/myapp/myapp Runtime.app/Contents/Frameworks/PySide6/Qt/lib/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess
Reason: tried:
'/Users/USER/Applications/myapp/myapp Runtime.app/Contents/Frameworks/PySide6/Qt/lib/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/../../../../../../../../../../QtWebEngineCore' (no such file),
'/Users/USER/Applications/myapp/myapp Runtime.app/Contents/Frameworks/PySide6/Qt/lib/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/../../../../../../../../../../QtWebEngineCore' (no such file),
'/usr/local/lib/QtWebEngineCore' (no such file),
'/usr/lib/QtWebEngineCore' (no such file, not in dyld cache) |
As mentioned above, tufup only does It's not immediately clear to me how that would cause this relative path issue. Can you locate |
The files that exist are:
But the path
doesn't exist if I check manually. The long path above is equivalent to Relevant: pyinstaller/pyinstaller#2276 (comment) |
Sounds more and more like an exotic issue that is out-of-scope for tufup. Anyway, I don't have access to a mac (other than github runners) so cannot reproduce. Perhaps these can help: |
So it's looking for a path relative to the location of
with all the
but the actual file is in
The difference is Not sure if that has anything to do with it, but it stands out. What's the output of |
|
Looks like it was tufup/src/tufup/utils/platform_specific.py Line 259 in 4bb16ad
symlinks=True .
|
@dennisvang I am happy to close this issue |
@0xWOLAND Good find! :) |
@0xWOLAND It would probably be convenient to expose the I'll keep the issue open until that's resolved. |
@0xWOLAND The symlinks option is now available in tufup 0.9.0 (via pypi) |
@0xWOLAND Thanks! That's good to know. :) |
I have a project that uses PyQt6, specifically its QtWebSockets server and I have built it with Pyinstaller with windowed mode activated. If I extract the executable from a zipped target file produced by Tufup, it works. However, if I try to let Tufup update an older version of the package and run the newly produced executable, PyQt throws:
The following paths were searched for Qt WebEngine Process: /Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess /.../my_app.app/Contents/MacOS/QtWebEngineProcess but could not find it. You may override the default search path by using QTWEBENGINEPROCESS_PATH environment variable.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect the executable built by the auto-updater to work the same way as the target zip package that contains the PyQt app with the latest version.
System info (please complete the following information):
Any help is much appreciated! Please let me know if I can provide any more details
The text was updated successfully, but these errors were encountered: