-
Notifications
You must be signed in to change notification settings - Fork 212
Challenges in Building Documentation for ez-ffmpeg on docs.rs Due to FFmpeg 7.1 Dependency #2769
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
Comments
you could have just reopened the old issue, or commented on it, I don't have new information for you.
of course, otherwise I wouldn't have proposed it? one caveat: we only accept adding packages from the ubuntu repositories. Please also check if rust-lang/crates-build-env#168 might perhaps already include the ffmpeg version you need.
I feel like I'm repeating myself :) From my last comment:
I don't have specific examples, but any |
Apologies for opening a new issue; I do not have the necessary permissions to reopen previously closed issues. I will attempt to add FFmpeg 7 to rust-lang/crates-build-env. If successful, I will close this issue. Thank you for your understanding. |
please check first if the new version perhaps isn't already in rust-lang/crates-build-env#168 |
Apologies for any confusion earlier. Upon reviewing the proposed update to Ubuntu 24.04 (Noble) in rust-lang/crates-build-env#168, I have observed that certain FFmpeg libraries are currently at older versions within the build environment. Specifically:
Upgrading these libraries to their respective latest versions within the build environment would ensure compatibility with FFmpeg 7.0 and its features. Could you please consider updating these libraries in the build environment to support FFmpeg 7.0? This upgrade would enhance compatibility and functionality for projects relying on the latest FFmpeg features. Thank you for your attention to this matter. |
do you mean they are old in the current build environment? or that they are also old in the PR?
are they available as ubuntu package in 24.04? If yes, you will have them then. If not, we won't add them to the build image for now. Any custom installation step would be too much of a maintenance burden for our already very small team. If it's not available as ubuntu package, the remaining options are (as stated above):
|
Thank you for your input. I apologize for the confusion—I realized that my previous lookup was based on Ubuntu 24.10. At this point, it appears that for Ubuntu 24.04 the necessary FFmpeg 7.0 packages are not available as Ubuntu packages. Consequently, I'll need to explore alternative solutions (such as vendoring the required files into the crate or using conditional compilation for docs) to address this issue. |
I tried using the FFmpeg packages available on Ubuntu 24.04, but they only provide version 6.0, which doesn't meet the requirement for my code. Thanks for your help! |
You don't actually need to have the C lib around to get docs, there are many ways to go around this limitation. By using |
Thanks for the suggestion! I appreciate your input and will try to implement a solution using Just to clarify, when you mention a "docs‑rs feature," do you mean a Cargo feature that is enabled specifically during docs.rs builds (for example, via the Thanks again for your help. |
Exactly, a feature enabled via |
Thank you very much for your suggestion! With your advice, I was able to use conditional compilation to avoid compiling the high-version FFmpeg API that isn’t supported in the docs.rs environment—while still linking against the FFmpeg library in normal builds. This solution enabled docs.rs to generate the documentation correctly. I really appreciate your invaluable help! |
Crate name
ez-ffmpeg
Build failure link
https://docs.rs/crate/ez-ffmpeg/0.1.0/builds/1833652
Additional details
Issue:
In the previous issue (#2765), I highlighted the challenges faced while generating documentation for
ez-ffmpeg
on docs.rs. Specifically, the build process fails due to the absence of FFmpeg 7.1 in the current build environment. In version 0.1.1 ofez-ffmpeg
, we enabled thebuild
feature offfmpeg-sys-next
to compile FFmpeg 7.1 during the build process. However, this approach requires network access to clone the FFmpeg source code, which is restricted in the docs.rs environment.Previous Attempts:
In version 0.1.0, we attempted to build the documentation without initiating network requests, but this resulted in build failures due to missing components in the default environment. The build log detailing these errors can be found here: https://docs.rs/crate/ez-ffmpeg/0.1.0/builds/1833652
Reason for Submitting a New Issue:
The previous issue was closed without a resolution that allows
ez-ffmpeg
to build its documentation successfully on docs.rs. Given the importance of having accessible documentation for users of the crate, I am submitting this new issue to seek further guidance and potential solutions.Potential Solutions:
Add FFmpeg 7.1 to
crates-build-env
: Integrating FFmpeg 7.1 into thecrates-build-env
Docker image would allow projects likeez-ffmpeg
to build successfully without requiring network access during the docs.rs documentation generation process. We are willing to contribute by submitting a pull request to include FFmpeg 7.1 in the build environment.Detect docs.rs Environment in Build Script: By checking for the
DOCS_RS
environment variable within thebuild.rs
script, we can conditionally adjust the build process to accommodate the docs.rs environment. This approach would involve skipping network-dependent steps when theDOCS_RS
variable is detected:Utilize
[package.metadata.docs.rs]
Configuration: Leveraging the[package.metadata.docs.rs]
section inCargo.toml
allows for customization of the documentation build process on docs.rs. This configuration can specify features to be enabled or dependencies to be adjusted specifically for the docs.rs environment.Request for Guidance:
We seek advice on the feasibility of the proposed solutions or any alternative recommendations to successfully generate documentation for
ez-ffmpeg
on docs.rs. Specifically:Is adding FFmpeg 7.1 to the
crates-build-env
a viable solution, and would such a contribution be accepted?Are there best practices for configuring the build script or
Cargo.toml
to handle the absence of network access during the docs.rs build process?Environment Details:
rustc version: 1.87.0-nightly (b74da9613 2025-03-06)
docs.rs version: 0.6.0 (004a02c 2025-03-05)
We appreciate your time and assistance in resolving this issue.
The text was updated successfully, but these errors were encountered: