-
Notifications
You must be signed in to change notification settings - Fork 1
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
Python runtime is configured incorrectly on Windows. #7
Comments
Hi @pushkinman, can you provide further steps to reproduce this issue? On my system, the example project works fine. I did the following steps:
|
@IVLIVS-III after running
and then the exact same error as before when trying to start debuging on windows |
@pushkinman yep, I forgot that invoking However, we discard the output of
This means, failing to run Anyways, I would have expected the app to run. Which versions of Python did you install on your system and where are the install locations? |
Python 3.11.4 |
See [#7 comment](#7 (comment)): In practice, most of the time `melos bs` is invoked, we don't want to automatically run `ffigen`. Before this commit, one had to manually revert the mostly unwanted changes from `ffigen` after every `melos bs`.
Can you run the Sadly I cannot reproduce your issue with |
You are using a windows machine, right? (to test) |
Yes, to debug this issue I use a native Windows OS (no virtualization) on mac Intel hardware, i.e. natively booting directly into Windows. |
I'm using bootcamp on Intel MacBook as well. |
It reproduces a similar error. Let me double check everything on my side, if you are saying that it works fine on your side, it should work for me as well. |
Yes, both work fine on my side… |
Hello @IVLIVS-III, we've tested your example project as well as our own one, but we still get the same error. (We've tested on different Windows machines)
|
@IVLIVS-III I've tried running
Python runtime and all dependencies are supposed to be bundled with the app and not depend on local installation of Python - is that right? |
@maxim-saplin yes, correct, everything should be bundled when running the Flutter specific plugin Thanks for this valuable insight, I will try and get a better testing setup for Windows shortly. |
@IVLIVS-III , when do you think you'll be able to check bundling for Windows? Looking forward to testing it) |
@maxim-saplin not before 5th July 2023. Edit: Since the act of solely bundling the Python runtime for Windows would not interfere with my research / bachelors thesis, I am open to review and accept a PR that addresses this issue in case you have more resources than myself, and in case you need a more timely fix than I could deliver. |
I could try submitting the PR. Though would appreciate your guidance, what should I start with) |
for macOS I settled on compiling the Python runtime myself (including code signing for Apple Distribution). See here for the patch as well as some scripts I created for simplifying the build process. I also started to port the patch to Linux and Windows, but without any luck since. To successfully bundle the runtime, one would need to sync the compiled dynamic Python library with the distributed Python stdlib (zip-file). That's what I did for macOS with the patch and custom build. I would prefer to distribute / bundle only a single stdlib-zip-file across all platforms and have custom compiled dynamic libraries that work together with this version of the stdlib. For now you could either start to
In the long term I would prefer the second option, but in the short term it might be easier to go after option 1. As long as it works, I'll be happy to accept a solution for now. |
The root cause for the above error is that the currently used (main) DLL ( See also lines 14-328 in this patch file |
OK, thanks for the direction. Will pick it up from here. |
Tried running
While I'm investigating the build process, could you please explain what are those auxiliary DLLs that need to be included statically? Besides, if I get it right, the Dart scripts clone CPython and use it to build Python runtime as standalone dynamic library? |
@maxim-saplin Looks like the issue is line endings in the patch file. At least that's what I would guess reading the error message… you could manually apply the patch, i.e. copy the lines over manually. Auxiliary DLLs are separate DLLs for each module of the Python standard library which are crated during the cpython build process. They can be statically linked into the main DLL with the Setup.local file. Yes, once complete you should have a single standalone Python dynamic library, which you could place into the windows folder (replacing |
This options sound like an easier one. Going into CPython compilation might be a dead end for me.
|
@maxim-saplin yes, I meant exactly these steps. And yes, I too feel that compiling CPython on Windows is the more difficult option. |
Do you have an advice/direction for |
I assume all modules listed here should be included. |
Quick status updated (maxim-saplin@3bcb75a):
Few times I even managed to get the UI started (fj example), yet is
Iterated more on runtime init, sporadically at different parts of Windows logs show the following error:
Note the exception code (374) - there're plenty of search results for |
great, looks kinda promising… thanks a lot for the status update. How did you fetch the error logs on Windows? |
Checked system logs via Windows Event Viewer. Will iterate over the weekend, let's see how it goes |
@IVLIVS-III , did another try. Unfortunately blindly iterating over code with little understanding of behind the scenes didn't provide any clues. Currently I don't have the capacity to proceed with further investigation. I'm happy to do testing on my Windows environment. We'll be looking forward to your inputs. Please let us know if you won't be able to do the Windows runtime next week. We might need to go with a backup plan and use PyInstaller and rely on external app and communication via files. |
@maxim-saplin I cannot guarantee that I will be able to work on the Windows runtime next week. At most I will be able to allocate 3-5 hours on Wednesday 5th July 2023. Even with your valuable advances, I don't think this time slot will be enough to solve this issue. I am committed to eventually supporting Windows, macOS, and Linux equally. But please keep in mind that my current priority is in other areas of this project. Still, I'd like to continue debugging this issue together, or at least getting additional testing from your side once I make substantial advances. |
Thanks for the update and clarifications! Let me know when you need my help with testing |
@IVLIVS-III The example project still does not work after the fix. Here is the log:
Originally posted by @pushkinman in #5 (comment)
The text was updated successfully, but these errors were encountered: