Nixpkgs: python3Packages.pkgconfig broken on staging due to pkg-config changes

Created on 29 May 2020  路  4Comments  路  Source: NixOS/nixpkgs

Describe the bug
Trying to build python37Packages.cython on macOS fails with an error in a setup hook:

$ nix-build . -QA python37Packages.cython 
these derivations will be built:
  /nix/store/daka1dk1fz1brphs16fscv0d95ib9ii4-python3.7-Cython-0.29.14.drv
building '/nix/store/daka1dk1fz1brphs16fscv0d95ib9ii4-python3.7-Cython-0.29.14.drv'...
builder for '/nix/store/daka1dk1fz1brphs16fscv0d95ib9ii4-python3.7-Cython-0.29.14.drv' failed with exit code 1; last 10 log lines:
  Sourcing python-remove-bin-bytecode-hook.sh
  Sourcing setuptools-build-hook
  Using setuptoolsBuildPhase
  Using setuptoolsShellHook
  Sourcing pip-install-hook
  Using pipInstallPhase
  Sourcing python-imports-check-hook.sh
  Using pythonImportsCheckPhase
  Sourcing python-namespaces-hook
  /nix/store/m6416k2rx74ms13mpjxx7lwhb6i8kyjf-python3.7-pkgconfig-1.5.1/nix-support/setup-hook: line 61: export: `NIX_@wrapperName@_TARGET_HOST_@suffixSalt@=1': not a valid identifier
error: build of '/nix/store/daka1dk1fz1brphs16fscv0d95ib9ii4-python3.7-Cython-0.29.14.drv' failed

To Reproduce
Steps to reproduce the behavior:

  1. nix-build . -QA python37Packages.cython

Expected behavior
The package should be built and packages that depend on it should build as well.

Additional context
git bisect revealed commit c71ab32a678a98ce1ec069956bc55d6ea606f55c. Other Python versions (tested 2.7) seem to have the same problem.

Notify maintainers
@Ericson2314

Metadata

 - system: `"x86_64-darwin"`
 - host os: `Darwin 19.4.0, macOS 10.15.4`
 - multi-user?: `no`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.3.3`
 - channels(parthy): `"nixpkgs-20.09pre226586.571212eb839"`
 - nixpkgs: `<HOME>/.nix-defexpr/channels/nixpkgs`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
bug python

Most helpful comment

Fixed setup hook in 7fe783903e0345c76a75c41d1ceabc8265184be5.

All 4 comments

This is the same on x86_64-linux, and IIRC also for other python versions.

EDIT: we also mentioned it here: https://github.com/NixOS/nixpkgs/pull/87814#issuecomment-633483878

So, it's not pkg-config that is broken, but python3.pkgs.pkgconfig. This Python package provides an Python interface to pkg-config. In our expression it inherits the hooks from pkg-config. With the changes made by @Ericson2314 that does not function anymore because certain variables do not get substituted. An easy fix would be to inherit those variables there as well so they can be substituted, but I suppose a more robust fix would be if this Python package would propagate pkg-config. Note this may cause it to end up in Python run-time closures.

Fixed at least Cython with 81b204e8a126a9c3c5de51cc23f0233c842de429.

Fixed setup hook in 7fe783903e0345c76a75c41d1ceabc8265184be5.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

teto picture teto  路  3Comments

ayyess picture ayyess  路  3Comments

sid-kap picture sid-kap  路  3Comments

yawnt picture yawnt  路  3Comments

matthiasbeyer picture matthiasbeyer  路  3Comments