NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.66k stars 13.11k forks source link

Build failure: python311Packages.mitmproxy-macos #291753

Open matt-152 opened 4 months ago

matt-152 commented 4 months ago

Steps To Reproduce

Steps to reproduce the behavior:

  1. Run nix-shell -p python311Packages.mitmproxy-macos on OS X

Build log

> nix-shell -p python311Packages.mitmproxy-macos
this derivation will be built:
  /nix/store/dpgk1jyfgi7pgh2pzwqikn7m4513idwf-python3.11-mitmproxy-macos-0.5.1.drv
building '/nix/store/dpgk1jyfgi7pgh2pzwqikn7m4513idwf-python3.11-mitmproxy-macos-0.5.1.drv'...
Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing pypa-build-hook
Using pypaBuildPhase
Sourcing python-runtime-deps-check-hook
Using pythonRuntimeDepsCheckHook
Sourcing pypa-install-hook
Using pypaInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
Sourcing python-catch-conflicts-hook.sh
Running phase: unpackPhase
unpacking source archive /nix/store/5ai75chc9khqj3m32b0hcm21zkgf6mxy-source
source root is source/mitmproxy-macos
setting SOURCE_DATE_EPOCH to timestamp 315619200 of file source/mitmproxy-macos/redirector/network-extension/network_extension.entitlements
Running phase: patchPhase
Running phase: configurePhase
no configure script, doing nothing
Running phase: buildPhase
Executing pypaBuildPhase
Creating a wheel...
* Getting build dependencies for wheel...
* Building wheel...
Traceback (most recent call last):
  File "/nix/store/0sil1mh14v3bizfzmy8514mlfa084hbp-python3.11-pyproject-hooks-1.0.0/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
    main()
  File "/nix/store/0sil1mh14v3bizfzmy8514mlfa084hbp-python3.11-pyproject-hooks-1.0.0/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/0sil1mh14v3bizfzmy8514mlfa084hbp-python3.11-pyproject-hooks-1.0.0/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
    return _build_backend().build_wheel(wheel_directory, config_settings,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ydd7gdb419z9sd17c6ljl6pb01mrjdrv-python3.11-hatchling-1.21.1/lib/python3.11/site-packages/hatchling/build.py", line 58, in build_wheel
    return os.path.basename(next(builder.build(directory=wheel_directory, versions=['standard'])))
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ydd7gdb419z9sd17c6ljl6pb01mrjdrv-python3.11-hatchling-1.21.1/lib/python3.11/site-packages/hatchling/builders/plugin/interface.py", line 155, in build
    artifact = version_api[version](directory, **build_data)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ydd7gdb419z9sd17c6ljl6pb01mrjdrv-python3.11-hatchling-1.21.1/lib/python3.11/site-packages/hatchling/builders/wheel.py", line 411, in build_standard
    for included_file in self.recurse_included_files():
  File "/nix/store/ydd7gdb419z9sd17c6ljl6pb01mrjdrv-python3.11-hatchling-1.21.1/lib/python3.11/site-packages/hatchling/builders/plugin/interface.py", line 177, in recurse_included_files
    yield from self.recurse_forced_files(self.config.get_force_include())
  File "/nix/store/ydd7gdb419z9sd17c6ljl6pb01mrjdrv-python3.11-hatchling-1.21.1/lib/python3.11/site-packages/hatchling/builders/plugin/interface.py", line 231, in recurse_forced_files
    raise FileNotFoundError(msg)
FileNotFoundError: Forced include not found: /private/tmp/nix-build-python3.11-mitmproxy-macos-0.5.1.drv-0/source/mitmproxy-macos/redirector/dist/Mitmproxy Redirector.app.tar

ERROR Backend subprocess exited when trying to invoke build_wheel
error: builder for '/nix/store/dpgk1jyfgi7pgh2pzwqikn7m4513idwf-python3.11-mitmproxy-macos-0.5.1.drv' failed with exit code 1;
       last 10 log lines:
       >                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       >   File "/nix/store/ydd7gdb419z9sd17c6ljl6pb01mrjdrv-python3.11-hatchling-1.21.1/lib/python3.11/site-packages/hatchling/builders/wheel.py", line 411, in build_standard
       >     for included_file in self.recurse_included_files():
       >   File "/nix/store/ydd7gdb419z9sd17c6ljl6pb01mrjdrv-python3.11-hatchling-1.21.1/lib/python3.11/site-packages/hatchling/builders/plugin/interface.py", line 177, in recurse_included_files
       >     yield from self.recurse_forced_files(self.config.get_force_include())
       >   File "/nix/store/ydd7gdb419z9sd17c6ljl6pb01mrjdrv-python3.11-hatchling-1.21.1/lib/python3.11/site-packages/hatchling/builders/plugin/interface.py", line 231, in recurse_forced_files
       >     raise FileNotFoundError(msg)
       > FileNotFoundError: Forced include not found: /private/tmp/nix-build-python3.11-mitmproxy-macos-0.5.1.drv-0/source/mitmproxy-macos/redirector/dist/Mitmproxy Redirector.app.tar
       >
       > ERROR Backend subprocess exited when trying to invoke build_wheel
       For full logs, run 'nix log /nix/store/dpgk1jyfgi7pgh2pzwqikn7m4513idwf-python3.11-mitmproxy-macos-0.5.1.drv'.

Additional context

This issue breaks the mitmproxy package on OS X.

The build is failing due to a missing file: Mitmproxy Redirector.app.tar. From the mitimproxy-rs README (mitmproxy-macos' parent package), the app is "Only a binary distribution ... available on PyPI due to code signing and notarization requirements."

In other words, this package is only available via pip and is prebuilt.

This issue also affects python310Packages.mitmproxy-macos.

Notify maintainers

@boltzmannrain

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

> nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-darwin"`
 - host os: `Darwin 23.2.0, macOS 10.16`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`

Add a :+1: reaction to issues you find important.

chrnola commented 3 months ago

aarch64-darwin is similarly affected. I get the same exact error on:

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"aarch64-darwin"`
 - host os: `Darwin 23.4.0, macOS 14.4`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.21.0`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
AlexeyRaga commented 3 months ago

Same here

❯ nix-shell -p nix-info --run "nix-info -m"
 - system: `"aarch64-darwin"`
 - host os: `Darwin 23.4.0, macOS 14.4`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.19.3`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
arichtman-srt commented 3 months ago

Ditto aarch64-darwin

❯ nix-shell -p nix-info --run "nix-info -m"
 - system: `"aarch64-darwin"`
 - host os: `Darwin 23.4.0, macOS 14.4.1`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.18.1`
 - channels(arichtman): `"darwin"`
 - nixpkgs: `/Users/arichtman/.nix-defexpr/channels/nixpkgs`
amuricys commented 1 month ago

also getting it:

nix-shell -p nix-info --run "nix-info -m"
these 3 paths will be fetched (1.03 MiB download, 8.17 MiB unpacked):
 - system: `"aarch64-darwin"`
 - host os: `Darwin 23.5.0, macOS 14.5`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.21.2`
 - nixpkgs: `/nix/store/7a56nns2g9wnic8d2yd1np1wj5y8z9y9-source`