Skip to content
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

Build failure: pyinstaller #383565

Open
3 tasks done
axman6 opened this issue Feb 20, 2025 · 0 comments
Open
3 tasks done

Build failure: pyinstaller #383565

axman6 opened this issue Feb 20, 2025 · 0 comments
Labels
0.kind: build failure A package fails to build

Comments

@axman6
Copy link
Contributor

axman6 commented Feb 20, 2025

Nixpkgs version

  • Unstable (25.05)

Steps to reproduce

When building pkgsStatic.python3Packages.pyinstaller, wheel (I believe) fails to determine the size of a pointer during installation, log output below. I would try the suggested fix of passing --target-arch to the build but I'm unsure how to do that with the pyinstaller derivation.

I haven't found a fix yet but the fact that the makeWrapperArgs attr explicitly includes glibc instead of the appropriate libc for the build seems suspicious. I've tried hacking around with things to see if I can get something to work - with a flake with nixos-unstable as an input:

        packages.pyinstaller-pkg = pkgs.pkgsStatic.python3Packages.pyinstaller;
        packages.py-pyinstaller = pkgs.pkgsStatic.python3.withPackages (py: [
          py.pyinstaller
          ]
        );

        packages.pyinstaller-pkg-2 = pkgs.pkgsStatic.python3Packages.pyinstaller.override { 
            glibc = pkgs.pkgsStatic.musl;
        };
        packages.py-pyinstaller-2 = pkgs.pkgsStatic.python3.withPackages (py: [
          (py.pyinstaller.override { glibc = pkgs.pkgsStatic.musl; })
          ]
        );

the versions with -2 fail with trying to build glibc. The latter two fail with

       > No precompiled bootloader found or compile forced. Trying to compile the bootloader for you ...
       > Setting top to                           : /build/pyinstaller-6.12.0/bootloader 
       > Setting out to                           : /build/pyinstaller-6.12.0/bootloader/build 
       > Python Version                           : 3.12.8 (main, Dec  3 2024, 18:42:41) [GCC 14.2.1 20241116] 
       > MSVC target(s)                           : not found 
       > Checking for 'gcc' (C compiler)          : x86_64-unknown-linux-musl-gcc 
       > Checking size of pointer                 : not found 
       > Could not determine pointer size. Use `--target-arch' to manually set the pointer size (32bit or 64bit).
       > (complete log in /build/pyinstaller-6.12.0/bootloader/build/config.log)
       > ERROR: Failed compiling the bootloader. Please compile manually and rerun

(I'm not suggesting this is likely to be the fix, but not having the package depend on glibc would make it more portable).

Looking in the build directory from --keep-failed, these are the references I found to --target-arch but I'm not sure how to integrate that with the derivation:

/tmp/nix-build-python3.12-pyinstaller-6.12.0-x86_64-unknown-linux-musl.drv-8/pyinstaller-6.12.0 $ rg -e '--target-arch' .
./bootloader/build/config.log
474:from /build/pyinstaller-6.12.0/bootloader: Could not determine pointer size. Use `--target-arch' to manually set the pointer size (32bit or 64bit).

./bootloader/Vagrantfile
265:    py -3 ./waf all --target-arch=64bit
266:    py -3 ./waf all --target-arch=32bit

./bootloader/wscript
145:        '--target-arch',
215:            "Could not determine pointer size. Use `--target-arch' to manually set the pointer size (32bit or 64bit)."
224:    Handle --target-arch options, or use the same architecture as the compiler.
354:        # chosen --target-arch. Option -m32/-m64 has to be passed to cflags and linkflages.

./doc/bootloader-building.rst
35:using the :option:`--target-arch` option – given the appropriate compiler and
39:  python ./waf all --target-arch=32bit
289:  selected by using the ``--target-arch=`` option.

./doc/feature-notes.rst
291:via the :option:`--target-arch` switch. Valid values are ``x86_64``, ``arm64``,

./doc/CHANGES.rst
2057:  ``python waf --target-arch=64bit-arm all``. If built on an ARM machine,
2058:  ``--target-arch=64bit-arm`` is the default. (:issue:`7257`)
2060:  ``python waf --target-arch=64bit-arm --clang all``. (:issue:`7257`)
3154:* Add ``--target-arch`` command-line switch to select target architecture

./doc/usage.rst
716:          ``--target-arch=32bit`` to the ``waf`` command.

./PyInstaller/building/makespec.py
616:        '--target-architecture',
617:        '--target-arch',

pyinstaller/pyinstaller#6006 looks like the most relevant issue I could find but not particularly relevant (mostly issues related to linking to OpenWRT's zlib).

Can Hydra reproduce this build failure?

No, Hydra cannot reproduce this build failure.

Link to Hydra build job

https://hydra.nixos.org/build/284942770

Relevant log output

# from nix log /nix/store/ysq2z3lqh5gwb7c7zx9zw7x4klza2cwc-python3.12-pyinstaller-5.13.2-x86_64-unknown-linux-musl.drv
Processing /build/pyinstaller-5.13.2
  Running command Preparing metadata (pyproject.toml)
  running dist_info
  creating /build/pip-modern-metadata-9b0no5pw/pyinstaller.egg-info
  writing /build/pip-modern-metadata-9b0no5pw/pyinstaller.egg-info/PKG-INFO
  writing dependency_links to /build/pip-modern-metadata-9b0no5pw/pyinstaller.egg-info/dependency_links.txt
  writing entry points to /build/pip-modern-metadata-9b0no5pw/pyinstaller.egg-info/entry_points.txt
  writing requirements to /build/pip-modern-metadata-9b0no5pw/pyinstaller.egg-info/requires.txt
  writing top-level names to /build/pip-modern-metadata-9b0no5pw/pyinstaller.egg-info/top_level.txt
  writing manifest file '/build/pip-modern-metadata-9b0no5pw/pyinstaller.egg-info/SOURCES.txt'
  reading manifest file '/build/pip-modern-metadata-9b0no5pw/pyinstaller.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'COPYING.txt'
  writing manifest file '/build/pip-modern-metadata-9b0no5pw/pyinstaller.egg-info/SOURCES.txt'
  creating '/build/pip-modern-metadata-9b0no5pw/pyinstaller-5.13.2.dist-info'
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pyinstaller
  Running command Building wheel for pyinstaller (pyproject.toml)
  running bdist_wheel
  running build
  running build_bootloader
  No precompiled bootloader found or compile forced. Trying to compile the bootloader for you ...
  Setting top to                           : /build/pyinstaller-5.13.2/bootloader
  Setting out to                           : /build/pyinstaller-5.13.2/bootloader/build
  Python Version                           : 3.12.6 (main, Sep  6 2024, 19:03:47) [GCC 13.3.0]
  Checking for 'gcc' (C compiler)          : x86_64-unknown-linux-musl-gcc
  Checking size of pointer                 : not found
  Could not determine pointer size. Use `--target-arch' to manually set the pointer size (32bit or 64bit).
  (complete log in /build/pyinstaller-5.13.2/bootloader/build/config.log)
  ERROR: Failed compiling the bootloader. Please compile manually and rerun setup.py
  error: subprocess-exited-with-error
  
  × Building wheel for pyinstaller (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /nix/store/wfbjq35kxs6x83c3ncpfxdyl5gbhdx4h-python3-3.12.6/bin/python3.12 /nix/store/xdgmgzz3ng0bl0x5r6vmx0arqnfwsfj1-python3.12-pip-24.0/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /build/tmp5qchkco_
  cwd: /build/pyinstaller-5.13.2
  Building wheel for pyinstaller (pyproject.toml) ... error
  ERROR: Failed building wheel for pyinstaller
Failed to build pyinstaller
ERROR: Failed to build one or more wheels

Additional context

No response

System metadata

  • system: "x86_64-linux"
  • host os: Linux 6.8.0-49-generic, Ubuntu, 22.04.5 LTS (Jammy Jellyfish), nobuild
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.20.3
  • nixpkgs: /nix/store/0zchvfmj0wpf8nnqzgivq9b3yl8lyrm1-source

Notify maintainers

@h7x4

Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

@axman6 axman6 added the 0.kind: build failure A package fails to build label Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: build failure A package fails to build
Projects
None yet
Development

No branches or pull requests

1 participant