Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2919

pyside6-deploy fails if the directory and file of a qml element have the same name

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.8.1
    • 6.8.0.2
    • Tooling
    • None
    • macOS
    • 435e739df (dev), 238907c3b (6.8)

    Description

      While following the discussion on PYSIDE-2910 I noticed that the deploy was failing with:

      (env10) ➜  app pyside6-deploy --name Demo1 main.py
      Traceback (most recent call last):
        File "/Users/crmaurei/dev/bugs/2910/env10/lib/python3.10/site-packages/nuitka/__main__.py", line 206, in <module>
      /Users/crmaurei/dev/bugs/2910/env10/bin/python -m nuitka /Users/crmaurei/dev/bugs/2910/app/main.py --follow-imports --enable-plugin=pyside6 --output-dir=/Users/crmaurei/dev/bugs/2910/app/deployment --quiet --noinc    main()
        File "/Users/crmaurei/dev/bugs/2910/env10/lib/python3.10/site-packages/nuitka/__main__.py", line 188, in main
          MainControl.main()
        File "/Users/crmaurei/dev/bugs/2910/env10/lib/python3.10/site-packages/nuitka/MainControl.py", line 1155, in main
          _main()
        File "/Users/crmaurei/dev/bugs/2910/env10/lib/python3.10/site-packages/nuitka/MainControl.py", line 1052, in _main
          copyDataFiles(standalone_entry_points=getStandaloneEntryPoints())
        File "/Users/crmaurei/dev/bugs/2910/env10/lib/python3.10/site-packages/nuitka/freezer/IncludedDataFiles.py", line 628, in copyDataFiles
          _handleDataFile(
        File "/Users/crmaurei/dev/bugs/2910/env10/lib/python3.10/site-packages/nuitka/freezer/IncludedDataFiles.py", line 592, in _handleDataFile
          copyFileWithPermissions(
        File "/Users/crmaurei/dev/bugs/2910/env10/lib/python3.10/site-packages/nuitka/utils/FileOperations.py", line 1017, in copyFileWithPermissions
          shutil.copy2(
        File "/opt/homebrew/Cellar/python@3.10/3.10.15/Frameworks/Python.framework/Versions/3.10/lib/python3.10/shutil.py", line 434, in copy2
          copyfile(src, dst, follow_symlinks=follow_symlinks)
        File "/opt/homebrew/Cellar/python@3.10/3.10.15/Frameworks/Python.framework/Versions/3.10/lib/python3.10/shutil.py", line 256, in copyfile
          with open(dst, 'wb') as fdst:
      NotADirectoryError: [Errno 20] Not a directory: '/Users/crmaurei/dev/bugs/2910/app/deployment/main.app/Contents/MacOS/Main/Main.qml'
      [DEPLOY] Exception occurred: Traceback (most recent call last):
        File "/Users/crmaurei/dev/bugs/2910/env10/lib/python3.10/site-packages/PySide6/scripts/deploy_lib/commands.py", line 27, in run_command
          subprocess.check_call(command, shell=is_windows)
        File "/opt/homebrew/Cellar/python@3.10/3.10.15/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '[PosixPath('/Users/crmaurei/dev/bugs/2910/env10/bin/python'), '-m', 'nuitka', '/Users/crmaurei/dev/bugs/2910/app/main.py', '--follow-imports', '--enable-plugin=pyside6', '--output-dir=/Users/crmaurei/dev/bugs/2910/app/deployment', '--quiet', '--noinclude-qt-translations', '--standalone', '--macos-create-app-bundle', '--include-data-dir=/Users/crmaurei/dev/bugs/2910/app/Main=./Main', '--noinclude-dlls=*.cpp.o', '--noinclude-dlls=*.qsb', '--noinclude-dlls=*.webp', '--noinclude-dlls=libQt6Charts*', '--noinclude-dlls=libQt6Quick3D*', '--noinclude-dlls=libQt6Sensors*', '--noinclude-dlls=libQt6Test*', '--noinclude-dlls=libQt6WebEngine*', '--noinclude-dlls=*/qml/QtQuickEffectMaker/*', '--macos-app-icon=/Users/crmaurei/dev/bugs/2910/env10/lib/python3.10/site-packages/PySide6/scripts/deploy_lib/pyside_icon.icns', '--include-qt-plugins=accessiblebridge,networkaccess,networkinformation,platforminputcontexts,platforms/darwin,qml,qmltooling,scenegraph']' returned non-zero exit status 1.
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/Users/crmaurei/dev/bugs/2910/env10/lib/python3.10/site-packages/PySide6/scripts/deploy.py", line 154, in main
          command_str = nuitka.create_executable(source_file=config.source_file,
        File "/Users/crmaurei/dev/bugs/2910/env10/lib/python3.10/site-packages/PySide6/scripts/deploy_lib/nuitka_helper.py", line 185, in create_executable
          command_str, _ = run_command(command=command, dry_run=dry_run)
        File "/Users/crmaurei/dev/bugs/2910/env10/lib/python3.10/site-packages/PySide6/scripts/deploy_lib/commands.py", line 33, in run_command
          raise RuntimeError(
      RuntimeError: [DEPLOY] Command /Users/crmaurei/dev/bugs/2910/env10/bin/python -m nuitka /Users/crmaurei/dev/bugs/2910/app/main.py --follow-imports --enable-plugin=pyside6 --output-dir=/Users/crmaurei/dev/bugs/2910/app/deployment --quiet --noinclude-qt-translations --standalone --macos-create-app-bundle --include-data-dir=/Users/crmaurei/dev/bugs/2910/app/Main=./Main --noinclude-dlls=*.cpp.o --noinclude-dlls=*.qsb --noinclude-dlls=*.webp --noinclude-dlls=libQt6Charts* --noinclude-dlls=libQt6Quick3D* --noinclude-dlls=libQt6Sensors* --noinclude-dlls=libQt6Test* --noinclude-dlls=libQt6WebEngine* --noinclude-dlls=*/qml/QtQuickEffectMaker/* --macos-app-icon=/Users/crmaurei/dev/bugs/2910/env10/lib/python3.10/site-packages/PySide6/scripts/deploy_lib/pyside_icon.icns --include-qt-plugins=accessiblebridge,networkaccess,networkinformation,platforminputcontexts,platforms/darwin,qml,qmltooling,scenegraph failed with error Command '[PosixPath('/Users/crmaurei/dev/bugs/2910/env10/bin/python'), '-m', 'nuitka', '/Users/crmaurei/dev/bugs/2910/app/main.py', '--follow-imports', '--enable-plugin=pyside6', '--output-dir=/Users/crmaurei/dev/bugs/2910/app/deployment', '--quiet', '--noinclude-qt-translations', '--standalone', '--macos-create-app-bundle', '--include-data-dir=/Users/crmaurei/dev/bugs/2910/app/Main=./Main', '--noinclude-dlls=*.cpp.o', '--noinclude-dlls=*.qsb', '--noinclude-dlls=*.webp', '--noinclude-dlls=libQt6Charts*', '--noinclude-dlls=libQt6Quick3D*', '--noinclude-dlls=libQt6Sensors*', '--noinclude-dlls=libQt6Test*', '--noinclude-dlls=libQt6WebEngine*', '--noinclude-dlls=*/qml/QtQuickEffectMaker/*', '--macos-app-icon=/Users/crmaurei/dev/bugs/2910/env10/lib/python3.10/site-packages/PySide6/scripts/deploy_lib/pyside_icon.icns', '--include-qt-plugins=accessiblebridge,networkaccess,networkinformation,platforminputcontexts,platforms/darwin,qml,qmltooling,scenegraph']' returned non-zero exit status 1. and return_code1
      
      [DEPLOY] Executed file created in Demo1.app
      

      and after some investigation, Nuitka was getting confused with the 'Main' name. Renaming the directory (or the file) to have a different name, fixes the problem.

      Attachments

        Issue Links

          For Gerrit Dashboard: PYSIDE-2919
          # Subject Branch Project Status CR V

          Activity

            People

              crmaurei Cristian Maureira-Fredes
              crmaurei Cristian Maureira-Fredes
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes