Skip to content

pythonPackages.sip: make sip-module name overridable#52956

Merged
orivej-nixos merged 2 commits intoNixOS:masterfrom
orivej:sip-module
Dec 27, 2018
Merged

pythonPackages.sip: make sip-module name overridable#52956
orivej-nixos merged 2 commits intoNixOS:masterfrom
orivej:sip-module

Conversation

@orivej
Copy link
Contributor

@orivej orivej commented Dec 27, 2018

Motivation for this change

This is an alternative to #52897 that trades patching pyqt5 for building another copy of sip.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@orivej orivej requested a review from FRidh as a code owner December 27, 2018 03:10
@GrahamcOfBorg GrahamcOfBorg added the 6.topic: python Python is a high-level, general-purpose programming language. label Dec 27, 2018
@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. labels Dec 27, 2018
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is based on the contents of the package at https://pypi.org/project/PyQt5-sip/ : it has only PyQt5/sip.so (and metadata files).

@veprbl
Copy link
Member

veprbl commented Dec 27, 2018

@GrahamcOfBorg build python2Packages.sip python2Packages.pyqt5 python3Packages.sip python3Packages.pyqt5

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name = "${sip-module}-${version}";
pname = sip-module;

The author of sip wants it to be a private dependency of other packages by
making it importable under different names.
pyqt5 5.11 has switched from sip to PyQt5.sip.
@orivej-nixos orivej-nixos merged commit 880de7a into NixOS:master Dec 27, 2018
@FRidh
Copy link
Member

FRidh commented Dec 27, 2018

What happens when I get two versions with different names in the same closure? I'm pretty sure we get a conflict then.

@veprbl
Copy link
Member

veprbl commented Dec 27, 2018

@FRidh I don't see any potential for conflict here. The different versions export modules with different names. In fact, there are cases where we do use both sip and pyqt5 in the same closure.

@orivej
Copy link
Contributor Author

orivej commented Dec 27, 2018

Yet the sip tool and the pyqt5 sip module may be separated further: #52968.
This would prevent a file conflict in the user environment if the user somehow installs multiple sips.

@FRidh
Copy link
Member

FRidh commented Dec 27, 2018

If you include both in the same Python env they each provide the "same" dist-info folder.

@orivej
Copy link
Contributor Author

orivej commented Dec 27, 2018

No, one is sip-4.19.13.dist-info, another is PyQt5_sip-4.19.13.dist-info.
The files in common are sipconfig.py, sipdistutils.py, bin/sip and include/sip.h. (They are gone with --no-tools option proposed in #52968.)

@veprbl
Copy link
Member

veprbl commented Dec 27, 2018

This seems to show no collisions:

# nix-env -f . -iA pythonPackages.sip pythonPackages.pyqt5
installing 'python2.7-sip-4.19.13'
installing 'python2.7-PyQt-5.11.3'
building '/nix/store/95dxdxa67353zgwsvgm3i3bpqmifxhhi-user-environment.drv'...
created 2230 symlinks in user environment

"PyQt5_sip" doesn't have a public attribute so there is no trivial way to cause collisions with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants