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

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

Merged
merged 2 commits into from Dec 27, 2018

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.

@@ -65,7 +67,7 @@ in buildPythonPackage {
'';

postInstall = ''
ln -s ${sip}/${python.sitePackages}/PyQt5/* $out/${python.sitePackages}/PyQt5
ln -s ${sip}/${python.sitePackages}/PyQt5/sip.* $out/${python.sitePackages}/PyQt5/
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


buildPythonPackage rec {
pname = "sip";
name = "${sip-module}-${version}";
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.
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants