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
anki: use wrapQtAppsHook to fix execution #66796
Conversation
(Adding to the front of the list because it was I who added this expression to nixpkgs in e00c031 7 years ago. :])
can't we just use `wrapQtAppsHook` directly in the `anki` derivation?
The OP post says:
... by inheriting the hook from the `pyqtwebengine` so that QT versions match.
If we do it directly, we would need add asserts to keep QT versions used in `anki` and `pyqtwebengine` synchronized, or something similarly pointless.
|
Can we sort these plz? :)
Well, AFAICS the usual etiquette is to keep maintainers in the order of their appearance. Not that I insist doing it this way, but I feel like this would be a question deserving an RFC. :)
Unrelated, but what's the advantage of passing `lib` as an input to the derivation?
Because `lib`, semantically speaking, is not really a part of `stdenv`. It is also shorter. So, since `lib` was already in the arguments it seemed prudent to change this.
|
On 19-08-17 14:11:05, Jan Malakhovski wrote:
> can't we just use `wrapQtAppsHook` directly in the `anki` derivation?
The OP post says:
> ... by inheriting the hook from the `pyqtwebengine` so that QT versions match.
If we do it directly, we would need add asserts to keep QT versions used in `anki` and `pyqtwebengine` synchronized, or something similarly pointless.
You're right - I missed that, and it makes a lot of sense. Thanks for
the clarification!
|
pkgs/games/anki/default.nix
Outdated
@@ -158,6 +161,9 @@ buildPythonApplication rec { | |||
cp -rv anki aqt web $pp/ | |||
|
|||
wrapPythonPrograms | |||
for program in $out/bin/*; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have to do wrapPythonPrograms
in buildPythonApplication
? I thought that'd happen automatically.
Also by doing this we get two wrappers, maybe give makeWrapperArgs
"\${qtWrapperArgs[@]}"
?
From a quick run, this works as expected. |
I think "keeping the version of qt in qtwebengine and anki in sync" is the job of libsForQt5.callPackage. |
As suggested by @worldofpeace.
@worldofpeace
These are good suggestions, applied both. Thanks!
@symphorien
I think "keeping the version of qt in qtwebengine and anki" is the job of libsForQt5.callPackage.
Normally, yes, but it is `pyqtwebengine`, not `qtwebengine`, i.e. it is a package from `pythonPackages`, not from `qtPackages`.
|
# copy the manual into $doc | ||
cp -r ${manual}/share/doc/anki/html $doc/share/doc/anki | ||
''; | ||
|
||
dontWrapQtApps = true; | ||
makeWrapperArgs = [ | ||
''--prefix PATH ':' "${lame}/bin:${mplayer}/bin"'' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use the same string type for both array elements?
''--prefix PATH ':' "${lame}/bin:${mplayer}/bin"'' | |
"--prefix PATH ':' ${lame}/bin:${mplayer}/bin" |
@oxij How about calling |
Should we use the same string type for both array elements?
IMHO quotes around paths there would not hurt. (I would rather use more quotes than less in case Nix would eventually allow spaces in paths.)
Also, IMHO, a discussion of potentially superfluous quotation marks feels uncomfortably bikeshedding-ish.
@worldofpeace
@oxij How about calling `anki` with `libsForQt5.callPackage` instead of `python3Packages`?
You'd then have to use `python3Packages` directly in the expression, but you wouldn't have to use a passthru attribute in `pyqtwebengine`
Let's say `pyqtwebengine` needs some specific version of Qt (like, say, 5.6 or something) different from the default one (which it doesn't need now, but could need in the future). `anki` needs Qt environment matching that of `pyqtwebengine` it depends on.
Then, the simplest consistent way to satisfy this is to `passthru` the thing that produces the correct environment of `pyqtwebengine` from `pyqtwebengine` so that `anki` would just use it. Which I did here.
Another consistent way would be to call `anki` with `libsForQt5.callPackage` and then locally `.override` `pyqtwebengine` inside of that `anki` expression with the corresponding Qt attributes. (Which sounds similar to the thing you propose.) But this would just add another version of `pyqtwebengine` we will have to maintain and compile (since it could differ from the default one) without any practical benefit I can see.
Finally, another consistent way would be to `passthru` `libsForQt5.callPackage` used by `pyqtwebengine` instead of just `wrapQtAppsHook` and use that internally in `anki` expression to extract `wrapQtAppsHook`, but that would uber-ugly. I would rather not do that either until `anki` needs a lot, A LOT, of that `passthru` stuff.
So, can we merge this yet?
|
I agree that the |
@ttuegel isn't that the preferred/only solution for all python applications using some qt bindings in one way or another? In that case, it probably should be added to the documentation… |
@flokli If every Python package is going to start using this, then no: it is not the preferred solution and we need to actually solve the problem. |
If every Python package is going to start using this, then no: it is not the preferred solution and we need to actually solve the problem.
Okay, but how exactly?
I suppose doing this in a way consistent with the documented instructions means moving `pyqtwebengine` and similar pythonic bindings into Qt attrset so that `libsForQt5.callPackage` could resolve them. But then, `pyqtwebengine` and similar bindings are not actually a part of Qt, so I expect they would get out of sync with the rest of Qt (and between each other) and require specific older versions of Qt at least some of the time.
That is to say, in the general case, I don't see how this can be done in any other way except the way this PR does it or with the aforementioned worse alternatives.
I would happy to be proven wrong, though. Adding `passthru`s everywhere would be really ugly, I agree.
|
Can we merge this now? I have no opinion on the meta discussion, but for now it would be nice to have anki working on unstable again. |
Given that it has been a few days without new discussion and this PR is a definite improvement for now, I'll merge. Thanks @oxij for taking care of this! |
Great, thanks @oxij |
What?
At the moment running
anki
fails withThis PR fixes it, properly, by inheriting the hook from the
pyqtwebengine
so that QT versions match.Why?
The use of
wrapQtAppsHook
is now required for Qt apps. See #65399 for more info.git log
pyqtwebengine: passthru wrapQtAppsHook
anki: use wrapQtAppsHook from pyqtwebengine
anki: add myself as a maintainer
(Adding to the front of the list because it was I who added this expression to
nixpkgs in e00c031 7 years ago. :])
nix-instantiate
environmentnix-env -qaP
diffs/cc @Profpatsch @asymmetric @ttuegel