-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
pympress: init at 1.2.0 #62137
pympress: init at 1.2.0 #62137
Conversation
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.
A few small things I noticed on a quick first pass.
Ok, I'm completely baffled... this package is working fine for pdfs with video on Ubuntu with > pympress has_video.pdf
[ video fails ]
> nix-shell -p pympress
$ pympress has_video.pdf
[ video succeeds ] Any idea why this only works in a shell? |
This pull request has been mentioned on Nix community. There might be relevant details there: https://discourse.nixos.org/t/ld-library-path-not-set-for-application-unless-in-shell/3060/1 |
}; | ||
|
||
/* with check, segmentation fault: | ||
_gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed |
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.
Yeah, the tests would likely need to run under X.
See for example
nixpkgs/pkgs/development/libraries/libdazzle/default.nix
Lines 31 to 36 in 6c75862
checkPhase = '' | |
export NO_AT_BRIDGE=1 | |
xvfb-run -s '-screen 0 800x600x24' dbus-run-session \ | |
--config-file=${dbus.daemon}/share/dbus-1/session.conf \ | |
meson test --print-errorlogs | |
''; |
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.
thx! Do you know what the default checkPhase
is for Python? I think it's different from pkgs/stdenv/generic/setup.sh
? I'm not sure how the tests are running--there are no tests I can find in pympress repo & python -m unittest
does nothing, but the default checkPhase
is somehow calling useful tests!
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.
It is basically python setup.py test
:
${python.pythonForBuild.interpreter} nix_run_setup test |
Do you have an example of PDF with video that we could try? |
@jtojnar here's an example, note that both files need to be in same directory & must open with pdf player that supports video (eg okular or pympress in a nix-shell per #62137 (comment) ;): |
Works fine for me in pympress not executed in nix-shell. |
@jtojnar what platform? I just tested on two different NixOS machines with sandboxing and video fails unless in a shell. It worked fine however on Ubuntu. I don't think vlc is available unless in the shell for some reason |
I just ran the following commands on NixOS unstable with sandboxing enabled: $ git hub pull checkout 62137
Fetching pull/62137/head from git@github.com:NixOS/nixpkgs.git
$ nix-build -A pympress
/nix/store/wxhipgsg3qg0fajad28zv9rji76s7jb9-pympress-1.2.0
$ result/bin/pympress ~/Documents/video.pdf
[00007fb2f0006990] cache_read stream error: cannot pre fill buffer
[00007fb2f8001310] cache_read stream error: cannot pre fill buffer
[00007fb2f80189c0] mjpeg demux error: cannot peek
[00007fb2f00212e0] mjpeg demux error: cannot peek
[000000000192d270] main input error: Your input can't be opened
[000000000192d270] main input error: VLC is unable to open the MRL 'file:///home/jtojnar/Documents/bayesian_opt.mp4'. Check the log for details.
[00000000019234c0] main input error: Your input can't be opened
[00000000019234c0] main input error: VLC is unable to open the MRL 'file:///home/jtojnar/Documents/bayesian_opt.mp4'. Check the log for details.
I do see the player but clicking play does not seem to do anything: |
@tbenst any motivation to continue with this PR? |
@aanderse yes definitely. I’m a bit at a loss why video works in a nix-shell but not otherwise. Perhaps nix-shell isn’t as tight of a sandbox and can access system vlc. In that case the problem may lie with python-vlc |
I can confirm that VLC is indeed loaded on NixOS without How does the failure manifest for you? Do you see the player but it does not play? What do you have in console? |
@jtojnar ah thanks for that, and for the continued help! I'm away from my NixOS box on a poor internet connection, so I'll dive back in on this in a week or so. My recollection is I see the same error you report. Additional info is available in the log file
Which suggests that python-vlc is not finding VLC for some reason. Perhaps this is why it works (read: video plays on click) for me in |
I redownloaded the MP4 file and now the video plays. Could you rebase to resolve the merge conflict and also use separate commit per package? |
@jtojnar happy to once can confirm this issue is fixed. I just followed the exact same steps as you but video did not work. I'm also on NixOS unstable with sandboxing enabled.
|
Do you see a different error when you drop LD_LIBRARY_PATH? Or what does |
@jtojnar, nope, dropping LD_LIBRARY_PATH does not change anything. I just noticed on Ubuntu that video works when I'm in bash but not in zsh, haven't verified on NixOS yet. edit: any tips on using |
Rebased. I think the issue is per https://github.com/NixOS/nixpkgs/pull/62137/files#r289532543. Turns out find_library is basically broken (intentionally) in NixOS #27751, so source patching is only way to go. I'm trying to do this with the following line:
But this gives: Edit: I also tried |
Except for the confusing quoting, I do not see any issue at a glance. I would suggest using a patch file with |
And I do not think #27751 has anything to do with this. It only removed ldconfig lookup, not dl lookup, which seems to work fine. |
@jtojnar is there an elegant way to do a patch file with a dynamic path? Not sure how to point to As for |
See nixpkgs/pkgs/development/python-modules/pyogg/default.nix Lines 17 to 28 in 7a91369
|
Video is now working! I think this is good to go. Thanks @jtojnar for patient help. |
Made changes requested, but left postInstall wrapping as video did not work without. Also, I tried adding tests in, but got stymied by a required config file that is generated at runtime. Hopefully can leave that for future work as does appear satisfactorily functional. Edit: oops, an example layout file made it in this commit. Is there an easy way for me to copy this to ~/.config/pympress for package test, or would that break sandbox? If so the tests may work |
@jtojnar finally had a chance to debug this. Was a simple fix, patch needed to be After final review, I think this is ready to go! |
9eb7248
to
cc9b816
Compare
Co-Authored-By: Jan Tojnar <jtojnar@gmail.com>
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.
Thanks. I updated the two packages, split them into separate commits, cleaned them up a bit and fixed the licenses. The tests were just a false negatives from Python’s test runner trying to run the application for some reason, there are actually no tests.
Did not update to 1.4.1 since it is not on PyPI and only seems to relevant to Windows. 1.5.0 is still in beta.
Co-Authored-By: Jan Tojnar <jtojnar@gmail.com>
@jtojnar that's terrific, thanks so much for your patient help! I learned a lot :) |
Motivation for this change
Pympress is a simple yet powerful PDF reader designed for dual-screen presentations.
Things done
Added pympress and dependency python-vlc
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)