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

mpv: patch libarchive locale handling #58993

Closed
wants to merge 1 commit into from

Conversation

bb010g
Copy link
Member

@bb010g bb010g commented Apr 5, 2019

Motivation for this change

mpv's libarchive locale handling is broken on multiple Linux distributions currently due to an assumption on C.UTF-8 existing (see mpv-player/mpv#5759, mpv-player/mpv#6488). A patch (mpv-player/mpv#6438) has been submitted, but not yet merged. It'd be nice to get this in before 19.03 for those wanting to use mpv with archiveSupport simply.

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 nix-review --run "nix-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.

@endgame
Copy link
Contributor

endgame commented Apr 5, 2019

I downloaded this movie with youtube-dl, zipped it, built mpv with nix build '(with import (builtins.fetchTarball { url = "https://github.com/bb010g/nixpkgs/archive/mpv-libarchive-locale.tar.gz"; }) {}; pkgs.mpv.override { archiveSupport = true; })' and successfully played the movie through the zip file. Does that mean this is working properly?

@bb010g
Copy link
Member Author

bb010g commented Apr 5, 2019

If it fails for you without this patch, then yes. (Although I suppose that just testing this doesn't mean it's working improperly, either. :) )

@endgame
Copy link
Contributor

endgame commented Apr 5, 2019

Building mpv using nix build '(with import <nixpkgs> {}; pkgs.mpv.override { archiveSupport = true; })' gives me an mpv that fails with "Failed to recognize file format."

Looks good?

@worldofpeace
Copy link
Contributor

Upstream currently relies on the system having a "C.UTF-8" locale for libarchive, which NixOS does not have.

Hmm, aren't there patches in staging and 19.03 staging that would fix this?
Pretty sure we have that now.

@bb010g
Copy link
Member Author

bb010g commented Apr 6, 2019

Yes, that's #57974 / #58009.

So yeah, didn't see that. (Based this off NixOS/nixpkgs-channels:nixos-unstable, and been testing on a system following nixos-18.09.)

I'm not sure if this is still worth merging, as locales look to be strange and non-obvious. I could see this patch possibly helping with Nix-built binaries ran on other platforms, but I'm not sure?

https://github.com/mpv-player/mpv/blob/d6d6da4711ca1ad20e14386c4b29a955eb32322d/stream/stream_libarchive.c#L245

 mpa->locale = newlocale(LC_ALL_MASK, "C.UTF-8", (locale_t)0);

This looks like a runtime dep on locale presence to me, which would still cause issues on other distributions. Would that use case be valuable enough to check this issue on updates until something happens upstream?

@bb010g
Copy link
Member Author

bb010g commented May 7, 2019

Closing due to a patch downstream (mpv-player/mpv#6683) solving this differently, and 19.03 being the main release.

@bb010g bb010g closed this May 7, 2019
@bb010g bb010g deleted the mpv-libarchive-locale branch May 7, 2019 21:18
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