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

Installation errors (both aur and cargo) #40

Closed
punk-dev-robot opened this issue Nov 23, 2023 · 6 comments
Closed

Installation errors (both aur and cargo) #40

punk-dev-robot opened this issue Nov 23, 2023 · 6 comments

Comments

@punk-dev-robot
Copy link

I'm getting compilation errors when trying to install (both aur packages and cargo):

error[E0004]: non-exhaustive patterns: `sys::AVPixelFormat::AV_PIX_FMT_P212BE`, `sys::AVPixelFormat::AV_PIX_FMT_P212LE`, `sys::AVPixelFormat::AV_PIX_FMT_P412BE` and 3 more not covered
    --> /home/kuba/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ffmpeg-next-6.0.0/src/util/format/pixel.rs:467:15
     |
467  |         match value {
     |               ^^^^^ patterns `sys::AVPixelFormat::AV_PIX_FMT_P212BE`, `sys::AVPixelFormat::AV_PIX_FMT_P212LE`, `sys::AVPixelFormat::AV_PIX_FMT_P412BE` and 3 more not covered
     |
note: `sys::AVPixelFormat` defined here
    --> /tmp/cargo-installoyevMl/release/build/ffmpeg-sys-next-1e7951eede325f4c/out/bindings.rs:5932:1
     |
5932 | pub enum AVPixelFormat {
     | ^^^^^^^^^^^^^^^^^^^^^^
     = note: the matched value is of type `sys::AVPixelFormat`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
     |
797  ~             AV_PIX_FMT_RGBAF32LE => Pixel::RGBAF32LE,
798  ~             _ => todo!(),
     |

error[E0004]: non-exhaustive patterns: `sys::AVFrameSideDataType::AV_FRAME_DATA_VIDEO_HINT` not covered
    --> /home/kuba/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ffmpeg-next-6.0.0/src/util/frame/side_data.rs:78:15
     |
78   |         match value {
     |               ^^^^^ pattern `sys::AVFrameSideDataType::AV_FRAME_DATA_VIDEO_HINT` not covered
     |
note: `sys::AVFrameSideDataType` defined here
    --> /tmp/cargo-installoyevMl/release/build/ffmpeg-sys-next-1e7951eede325f4c/out/bindings.rs:6910:5
     |
6882 | pub enum AVFrameSideDataType {
     | ----------------------------
...
6910 |     AV_FRAME_DATA_VIDEO_HINT = 27,
     |     ^^^^^^^^^^^^^^^^^^^^^^^^ not covered
     = note: the matched value is of type `sys::AVFrameSideDataType`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
     |
128  ~             AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT => Type::AMBIENT_VIEWING_ENVIRONMENT,
129  ~             sys::AVFrameSideDataType::AV_FRAME_DATA_VIDEO_HINT => todo!(),
     |

error[E0004]: non-exhaustive patterns: `sys::AVCodecID::AV_CODEC_ID_PDV`, `sys::AVCodecID::AV_CODEC_ID_EVC`, `sys::AVCodecID::AV_CODEC_ID_RTV1` and 4 more not covered
    --> /home/kuba/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ffmpeg-next-6.0.0/src/codec/id.rs:664:15
     |
664  |         match value {
     |               ^^^^^ patterns `sys::AVCodecID::AV_CODEC_ID_PDV`, `sys::AVCodecID::AV_CODEC_ID_EVC`, `sys::AVCodecID::AV_CODEC_ID_RTV1` and 4 more not covered
     |
note: `sys::AVCodecID` defined here
    --> /tmp/cargo-installoyevMl/release/build/ffmpeg-sys-next-1e7951eede325f4c/out/bindings.rs:8222:1
     |
8222 | pub enum AVCodecID {
     | ^^^^^^^^^^^^^^^^^^
     = note: the matched value is of type `sys::AVCodecID`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
     |
1297 ~             AV_CODEC_ID_ANULL => Id::ANULL,
1298 ~             _ => todo!(),
     |

For more information about this error, try `rustc --explain E0004`.
error: could not compile `ffmpeg-next` (lib) due to 3 previous errors
error: failed to compile `wl-screenrec v0.1.1`, intermediate artifacts can be found at `/tmp/cargo-installoyevMl`.

Thank you for your work! I hope to try this software soon to replace wf-recorder for screen sharing over zoom as it is currently killing my cpu :)

@rx-py
Copy link

rx-py commented Nov 24, 2023

I have the same issue too lol, I just tried to install it on my Arch but got the same error output. typing rustc --explain E0004
printed this out:

This error indicates that the compiler cannot guarantee a matching pattern for one or more
possible inputs to a match expression. Guaranteed matches are required in order to assign
values to match expressions, or alternatively, determine the flow of execution.

Erroneous code example:

enum Terminator {
    HastaLaVistaBaby,
    TalkToMyHand,
}

let x = Terminator::HastaLaVistaBaby;

match x { // error: non-exhaustive patterns: `HastaLaVistaBaby` not covered
    Terminator::TalkToMyHand => {}
}

If you encounter this error you must alter your patterns so that every possible value of the
input type is matched. For types with a small number of variants (like enums) you should
probably cover all cases explicitly. Alternatively, the underscore _ wildcard pattern can be
added after all other patterns to match "anything else". Example:

enum Terminator {
    HastaLaVistaBaby,
    TalkToMyHand,
}

let x = Terminator::HastaLaVistaBaby;

match x {
    Terminator::TalkToMyHand => {}
    Terminator::HastaLaVistaBaby => {}
}

// or:

match x {
    Terminator::TalkToMyHand => {}
    _ => {}
}

Also, when you try to build from the source code, the same error output shows.

@russelltg
Copy link
Owner

Arch just updated to ffmpeg 6.1, which isn't supported by the ffmpeg-next crate yet.

I just pushed a commit pulling ffmpeg-next from the 6.1 enablement PRs:
zmwangx/rust-ffmpeg#165
zmwangx/rust-ffmpeg-sys#63

Unfortunately we may have to keep this patch or start maintaining a fork, as the maintainer is not responsive (they have a ad for a new maintainer on their repo, which I have sent them a few emails about filling...but oh well....)

@russelltg
Copy link
Owner

Closing as it is fixed. Let me know if yall have issues :)

@punk-dev-robot
Copy link
Author

As I'm not rust developer I don't know how to switch to using crates from your MRs. I guess I will wait for them to be merged upstream or your maintained fork. Just in case you haven't seen it the checks failed on your MR here: zmwangx/rust-ffmpeg#165

@russelltg
Copy link
Owner

russelltg commented Nov 26, 2023

cargo install --git https://GitHub.com/russelltg/wl-screenrec

Should just work. Or wl-screenrec-git from AUR.

And yes, CI failed b/c it's blocked on a similar MR by the same person ok ffmpeg-sys-next (not my MRs btw)

@punk-dev-robot
Copy link
Author

Great that did it, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants