indygreg/PyOxidizer

Wrong workflow and issues around MVC type apps (depth of modules and files like dirs or .txt .csv .ini etc. ext) and venv

Opened this issue · 1 comments

Hi,

This tool giving promise to game changer around Python and compiling to .exe
I'm coming here after long experience with Nuitka, etc. and wan provide some feedback and suggestion what I meeting and problems..

  1. Should be first function to check modules after this adding extra files or compile (now first is compilation) - coz at end.. in .bzl file can be situation as not added file or module, eg. case with MVC.. - I'm not sure that I doing this in right way, but when using my advanced aps as MVC where is eg. OpenGL, etc. PySide6, then each module and especially View, Controller, Model can have other libs, and this tool not care about discovery this.. and each must by added manual (this is what I meet).
  • also not sure about add_pypi_package for this libs, in case are for download in this process, etc. in case something in libs (in venv) can be used as modified, this is not the right vector I think (regarding point 2) - I found issues around cases when in depth of MVC are dirs or .txt .csv .ini etc. ext used (eg. listing, finding - for PyOxidizer sounds like modules or something)
  1. Tool not discovering related modules with MVC as modules called inside Model, View, Controller, eg. Model.MainModels or Model.MainModels.SubModel and more Model.MainModels.SubModel.TypeSubModel (I add this all as packages)
  • if in this long pat exist not class type module but not related test.py files, then is disovered : ) ..then each not called in main MVC files as test_2.py test_prototype.py etc. as secured code is taken in to PyOxidizer as something important, but not main MVC : )
  1. Exist bad case with temp in C:\Users\ManPython\AppData\Local\Temp\sdafsadfas - should be next to project or other path to select in compilation process, it's due memory and page fill and huge project that can do situation as no memoery to continue process
  • big misunderstanding with all around type path as / or \ (should be used a solution as from pathlib import Path, PureWindowsPath)
  1. Right now most of apps when trying compile working in mode: policy.resources_location = "filesystem-relative:prefix", but in mode policy.resources_location = "in-memory" not... (look at the log)
   Compiling main v0.1.0 (C:\Users\ManPython\AppData\Local\Temp\pyoxidizerKdVXFK\main)
   Compiling pyo3-macros v0.17.3
   Compiling python-oxidized-importer v0.9.0
error: linking with `link.exe` failed: exit code: 0xc0000006
  |
  = note: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.39.33519\\bin\\HostX64\\x64\\link.exe"

..ble ble ble.. as other pathes
and:

  = note:
          main.543l122bhtdpnbb9.rcgu.o : fatal error LNK1000: Internal error during IMAGE::Pass2


note: `link.exe` returned an unexpected error

note: the Visual Studio build tools may need to be repaired using the Visual Studio installer

note: or a necessary component may be missing from the "C++ build tools" workload

error: could not compile `main` due to previous error
error[PYOXIDIZER_PYTHON_EXECUTABLE]: adding PythonExecutable to FileManifest

    Caused by:
        0: building Python executable
        1: building executable with Rust project
        2: cargo build failed
      --> .\pyoxidizer.bzl:43:5
       |
    43 |     files.add_python_resource(".", exe)
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PythonExecutable.to_file_manifest()


error: adding PythonExecutable to FileManifest

Caused by:
    0: building Python executable
    1: building executable with Rust project
    2: cargo build failed
  • the 43 line is return files

log_2024-05-28.txt

Regarding problems with venv

pyoxidizer run
resolving 1 targets
resolving target install
resolving target exe
error[CF05]: Extraneous parameter passed to function call
      --> .\pyoxidizer.bzl:12:12
       |
    12 |       dist = default_python_distribution(
       |  ____________^
    13 | |         type="virtualenv",
    14 | |         path=venv_path
    15 | |     )
       | |_____^ Extraneous parameter in function call


error: Extraneous parameter passed to function call

Not sure it's correctly resolved (or regression): #297