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

subtitles-rs: init at 20180611 #48139

Closed
wants to merge 1 commit into from
Closed

subtitles-rs: init at 20180611 #48139

wants to merge 1 commit into from

Conversation

teto
Copy link
Member

@teto teto commented Oct 10, 2018

Tooling to deal with video subtitles.

Motivation for this change

I have tested only the subtitles2srt binary.
If my memory is correct, I stole the derivation from @symphorien 's overlay.

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)
  • Fits CONTRIBUTING.md.

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: subtitles-rs

Partial log (click to expand)

shrinking /nix/store/qydihppjfr1qqls1mxq19xhshf4bbnfg-subtitles-rs/bin/subtitles2srt
shrinking /nix/store/qydihppjfr1qqls1mxq19xhshf4bbnfg-subtitles-rs/bin/vobsub2png
shrinking /nix/store/qydihppjfr1qqls1mxq19xhshf4bbnfg-subtitles-rs/bin/opusraw2txt
shrinking /nix/store/qydihppjfr1qqls1mxq19xhshf4bbnfg-subtitles-rs/bin/substudy-backend
shrinking /nix/store/qydihppjfr1qqls1mxq19xhshf4bbnfg-subtitles-rs/bin/substudy
strip is /nix/store/428gs2z4b8f9byvghzlpbjwjb3a7jwxx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/qydihppjfr1qqls1mxq19xhshf4bbnfg-subtitles-rs/bin
patching script interpreter paths in /nix/store/qydihppjfr1qqls1mxq19xhshf4bbnfg-subtitles-rs
checking for references to /build in /nix/store/qydihppjfr1qqls1mxq19xhshf4bbnfg-subtitles-rs...
/nix/store/qydihppjfr1qqls1mxq19xhshf4bbnfg-subtitles-rs

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: subtitles-rs

Partial log (click to expand)

shrinking /nix/store/vcpa6pshk2rgnb0qah91756x2dn5nn2j-subtitles-rs/bin/vobsub2png
shrinking /nix/store/vcpa6pshk2rgnb0qah91756x2dn5nn2j-subtitles-rs/bin/subtitles2srt
shrinking /nix/store/vcpa6pshk2rgnb0qah91756x2dn5nn2j-subtitles-rs/bin/substudy
shrinking /nix/store/vcpa6pshk2rgnb0qah91756x2dn5nn2j-subtitles-rs/bin/submodel
shrinking /nix/store/vcpa6pshk2rgnb0qah91756x2dn5nn2j-subtitles-rs/bin/substudy-backend
strip is /nix/store/dxf1m7dhc4qb655bdljc1fsd74v1nag3-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/vcpa6pshk2rgnb0qah91756x2dn5nn2j-subtitles-rs/bin
patching script interpreter paths in /nix/store/vcpa6pshk2rgnb0qah91756x2dn5nn2j-subtitles-rs
checking for references to /build in /nix/store/vcpa6pshk2rgnb0qah91756x2dn5nn2j-subtitles-rs...
/nix/store/vcpa6pshk2rgnb0qah91756x2dn5nn2j-subtitles-rs

@symphorien
Copy link
Member

(I don't have an overlay to my knowledge)
makeWrapper in the args appears unused.
What happens if you make doCheck true ? Do you mind leaving a comment about what fails ?


rustPlatform.buildRustPackage rec {
name = "subtitles-rs";
version = "20180611";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are releases in the Github repo. Would it be possible to use the latest one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried and it failed. See my last message

Tooling to deal with video subtitles.
@teto
Copy link
Member Author

teto commented Nov 8, 2018

I tried to package the release given at http://github.com/emk/subtitles-rs/issues/46

  version = "substudy_v0.4.5";

  src = fetchFromGitHub {
    owner = "emk";
    repo = "subtitles-rs";
    rev = version;
    sha256 = "0q79q7irn7ac206s5ysla65g4dq0na0arj82jrip9qb155mww7vz";
  };

which ended up with


unpacking source archive /nix/store/jf562xpnwxsx3bm4hbdavllid2v0n97p-subtitles-rs-vendor
patching sources
configuring
building
Running cargo build --release
error: no matching version `= 0.3.8` found for package `log`
location searched: registry `https://github.com/rust-lang/crates.io-index`
versions found: 0.4.0, 0.3.9
required by package `substudy-backend v0.1.0 (file:///build/source/backend)`
note: keeping build directory '/tmp/nix-build-subtitles-rs.drv-1'
builder for '/nix/store/f7s47pa6nmmcldzb1z6cfp7h97ziig56-subtitles-rs.drv' failed with exit code 101
error: build of '/nix/store/f7s47pa6nmmcldzb1z6cfp7h97ziig56-subtitles-rs.drv' failed

Then I enabled the tests

running 5 tests
test file_path_checks_validity ... ok
test html::display_produces_canonical_string ... ok
test html::parse_valid_html_fragments ... ok
test html::error_on_invalid_html_fragments ... ok
test parse_metadata ... ok

test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/cli_test_dir-d4c5577aca0a75b3

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/common_failures-b08bd1639fd8bda5

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/opusraw2txt-bcb7ef4b434e6d08

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/opusraw2txt-72556968f130f9f8

running 2 tests
test parse_large_file ... ignored
test parse_file ... ok

test result: ok. 1 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/submodel-ca26d8664a0841c1

running 4 tests
test pair_frequency ... ok
test grapheme_frequency ... ok
test word_frequency ... ok
test write_model ... ok

test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/submodel-a329f3a14d407533

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/substudy-b4a2e54f0381c7cb

running 16 tests
test decode::test_smart_decode ... ok
test align::test_alignment ... ok
test merge::test::merge_long ... ok
test export::csv::test_episode_prefix ... ok
test merge::test::merge_one ... ok
test merge::test::merge_zero ... ok
test merge::test::merge_short ... ok
test srt::test::subtitle_file_from_path ... ok
test srt::test::subtitle_file_to_string ... ok
test srt::test::subtitle_to_string ... ok
test srt::test::zero_duration_subtitle ... ok
test time::test_timestamp ... ok
test video::test_stream_decode ... ok
test clean::test_clean_subtitle_file ... ok
test srt::test::detect_language ... ok
test align::test_combine_files ... ok

test result: ok. 16 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/tests-06c00a0c7482236a

running 8 tests
test cmd_export_review ... FAILED
test cmd_export_csv ... FAILED
test cmd_list_tracks ... FAILED
test cmd_export_tracks ... FAILED
test show_help ... ok
test show_version ... ok
test cmd_clean ... ok
test cmd_combine ... ok

failures:

---- cmd_export_review stdout ----
thread 'cmd_export_review' panicked at 'assertion failed: output.status.success()', substudy/tests/tests.rs:99:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

---- cmd_export_csv stdout ----
thread 'cmd_export_csv' panicked at 'assertion failed: output.status.success()', substudy/tests/tests.rs:82:5

---- cmd_list_tracks stdout ----
thread 'cmd_list_tracks' panicked at 'assertion failed: output.status.success()', substudy/tests/tests.rs:129:5

---- cmd_export_tracks stdout ----
thread 'cmd_export_tracks' panicked at 'assertion failed: output.status.success()', substudy/tests/tests.rs:115:5


failures:
    cmd_export_csv
    cmd_export_review
    cmd_export_tracks
    cmd_list_tracks

test result: FAILED. 4 passed; 4 failed; 0 ignored; 0 measured; 0 filtered out

As I am not familiar with rust, I don't intend to fix these. If that's not acceptable, I can maintain this package locally.

@symphorien
Copy link
Member

The failure does not seem spurious: substudy is run with these arguments and fails.
https://github.com/emk/subtitles-rs/blob/23c8a245290ba696e8f3eacf013eafacbd979070/tests/tests.rs#L74-L82

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: subtitles-rs

Partial log (click to expand)

shrinking /nix/store/rnankrd0dnllnclakzv6vvjqfl12h2bd-subtitles-rs/bin/submodel
shrinking /nix/store/rnankrd0dnllnclakzv6vvjqfl12h2bd-subtitles-rs/bin/substudy-backend
shrinking /nix/store/rnankrd0dnllnclakzv6vvjqfl12h2bd-subtitles-rs/bin/substudy
shrinking /nix/store/rnankrd0dnllnclakzv6vvjqfl12h2bd-subtitles-rs/bin/vobsub2png
shrinking /nix/store/rnankrd0dnllnclakzv6vvjqfl12h2bd-subtitles-rs/bin/opusraw2txt
strip is /nix/store/vcc4svb8gy29g4pam2zja6llkbcwsyiq-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/rnankrd0dnllnclakzv6vvjqfl12h2bd-subtitles-rs/bin
patching script interpreter paths in /nix/store/rnankrd0dnllnclakzv6vvjqfl12h2bd-subtitles-rs
checking for references to /build in /nix/store/rnankrd0dnllnclakzv6vvjqfl12h2bd-subtitles-rs...
/nix/store/rnankrd0dnllnclakzv6vvjqfl12h2bd-subtitles-rs

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: subtitles-rs

Partial log (click to expand)

shrinking /nix/store/wp6jybnjll3msai2spmwsharhn80f2sy-subtitles-rs/bin/subtitles2srt
shrinking /nix/store/wp6jybnjll3msai2spmwsharhn80f2sy-subtitles-rs/bin/vobsub2png
shrinking /nix/store/wp6jybnjll3msai2spmwsharhn80f2sy-subtitles-rs/bin/opusraw2txt
shrinking /nix/store/wp6jybnjll3msai2spmwsharhn80f2sy-subtitles-rs/bin/substudy-backend
shrinking /nix/store/wp6jybnjll3msai2spmwsharhn80f2sy-subtitles-rs/bin/substudy
strip is /nix/store/p9akxn2sfy4wkhqdqa3li97pc6jaz3r1-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/wp6jybnjll3msai2spmwsharhn80f2sy-subtitles-rs/bin
patching script interpreter paths in /nix/store/wp6jybnjll3msai2spmwsharhn80f2sy-subtitles-rs
checking for references to /build in /nix/store/wp6jybnjll3msai2spmwsharhn80f2sy-subtitles-rs...
/nix/store/wp6jybnjll3msai2spmwsharhn80f2sy-subtitles-rs

@mmahut
Copy link
Member

mmahut commented Aug 10, 2019

Are there any updates on this pull request, please?

@teto
Copy link
Member Author

teto commented Aug 10, 2019

I'll maintain it in my overlay for now.

@teto teto closed this Aug 10, 2019
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