Open emilazy opened 2 months ago
Ah I always wondered why qtwebengine is build twice, thanks for solving the mystery! This is indeed some interesting design choice, why do we even have the python3Package.qt6
package set? It's not like that qt is exposing some python api?
Ping @Majiir who introduced the override in https://github.com/NixOS/nixpkgs/commit/2f5f1647c36f08195b008f6d5e4418d4e8c3dc29
Thanks for the pointer. The original PR says:
- Added a
pythonPackages.qt6
override so that qt6 modules using are built with the correctpython
version when a Python module (e.g.pyside6
) is built with a different Python package (e.g.python311
).
but I’m not sure I understand – isn’t the Python just used to run build tools for the Qt build? Does the Python version used “leak” to the outside in any way that matters?
but I’m not sure I understand – isn’t the Python just used to run build tools for the Qt build?
AFAIK, yes.
Does the Python version used “leak” to the outside in any way that matters?
It does leak through propagated dependencies, whether that matters or not is another question.
Hmm, why does it need to propagate Python if it’s solely a nativeBuildInput
?
Hmm, why does it need to propagate Python if it’s solely a
nativeBuildInput
?
Not by qt itself, but transitive dependencies.
nix why-depends --precise --all .#qt6.full .#python3
shows it hiding in a bunch of shebangs.
Makes sense. Hopefully we can hear back from the original PR author about whether this is truly necessary or not. Letting the two Pythons coexist in the same dependency tree should be a core strength of Nix…
Letting the two Pythons coexist in the same dependency tree should be a core strength of Nix…
Python throws a monkey wrench into that idea because it necessitates a rather widely-scoped PYTHONPATH for anything to work and you can't mix python versions in a single PYTHONPATH. It gets populated by propagated deps automagically because the PYTHONPATH must also include all transitive deps.
Sure, but that shouldn’t matter if it’s just shebangs on scripts with their own hermetic PYTHONPATH
, right?
As long as it's hermetic, sure but if anything on the outside needs to depend on it, it no longer works.
What I mean is, for scripts it should work fine because they manage their own PYTHONPATH
, right? And since Python is just used for the WebEngine build, it shouldn’t be propagating any actual non‐script Python packages; everything it pulls in should be an application.
On https://github.com/NixOS/nixpkgs/pull/247618 you can see that before I had made the qt6
change, I had seen build failures for python311Packages.pyside6
while python310Packages.pyside6
built fine. I then found that in the 3.11 case, some propagated build inputs were missing from PYTHONPATH
. (See this Discourse thread.) To be honest, I don't fully understand all the implications of this change. Sorry I can't be more help.
On #247618 you can see that before I had made the
qt6
change, I had seen build failures forpython311Packages.pyside6
whilepython310Packages.pyside6
built fine.
Doesn't seem to be an issue now
I then found that in the 3.11 case, some propagated build inputs were missing from
PYTHONPATH
. (See this Discourse thread.)
Some are still missing (namely libselinux
), but at least the python version matches for the rest.
…because, I think, it propagates its Python to the Qt build, even though there’s no reason those should need to be shared.