Skip to content

Fix kornia-io docs not building on docs.rs#328

Merged
edgarriba merged 1 commit intokornia:mainfrom
as1100k-forks:issue-319
Apr 2, 2025
Merged

Fix kornia-io docs not building on docs.rs#328
edgarriba merged 1 commit intokornia:mainfrom
as1100k-forks:issue-319

Conversation

@AS1100K
Copy link
Copy Markdown
Member

@AS1100K AS1100K commented Apr 1, 2025

Fixes #319

The docs.rs fails to build the documentation because gstreamer-app-sys custom build script fails. See Logs.

After inspecting the gstreamer-app-sys/Cargo.toml and it's build.rs, I came to know that enabling docsrs flag would fix the issue.

Also, gio-sys crate also uses docsrs flag to disable it's build script

I tested it on my local machine by uninstalling gstreamer, and it works.

Copy link
Copy Markdown
Member

@edgarriba edgarriba left a comment

Choose a reason for hiding this comment

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

LGTM. Have you tried locally ? or any ideas how to test that will work online

@AS1100K
Copy link
Copy Markdown
Member Author

AS1100K commented Apr 1, 2025

I ran the docs on local docs.rs container. Although it fixes the issue with gstreamer, there is also a similar issue with turbojpeg crate.

I will look into turbojpeg crate, and hopefully find a fix.

docs.rs container logs
# rustc version
rustc 1.88.0-nightly (0b45675cf 2025-03-31)# docs.rs version
docsrs 0.6.0 (ee9a3fe 2025-04-01)# build log
[INFO] running `Command { std: "docker" "create" "-v" "/root/developer/docs.rs/.rustwide-docker/builds/kornia-io-0.1.9-rc.2/target:/opt/rustwide/target:rw,Z" "-v" "/root/developer/docs.rs/.rustwide-docker/builds/kornia-io-0.1.9-rc.2/source:/opt/rustwide/workdir:ro,Z" "-v" "/root/developer/docs.rs/.rustwide-docker/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/root/developer/docs.rs/.rustwide-docker/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "DOCS_RS=1" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "3221225472" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux-micro" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "rustdoc" "--lib" "-Zrustdoc-map" "--all-features" "--config" "build.rustflags=[\"--cfg\", \"docsrs\"]" "-Zhost-config" "-Ztarget-applies-to-host" "--config" "host.rustflags=[\"--cfg\", \"docsrs\"]" "--config" "build.rustdocflags=[\"--cfg\", \"docsrs\", \"--cfg\", \"docsrs\", \"-Z\", \"unstable-options\", \"--emit=invocation-specific\", \"--resource-suffix\", \"-20250331-1.88.0-nightly-0b45675cf\", \"--static-root-path\", \"/-/rustdoc.static/\", \"--cap-lints\", \"warn\", \"--extern-html-root-takes-precedence\"]" "--offline" "-Zunstable-options" "--config=doc.extern-map.registries.crates-io=\"https://docs.rs/{pkg_name}/{version}/x86_64-unknown-linux-gnu\"" "-Zrustdoc-scrape-examples" "--target" "x86_64-unknown-linux-gnu", kill_on_drop: false }`
[INFO] [stdout] 442e983af3ef57faf7c7a5db03c4a6173a436e5c3b74c1e483347137eb3a5e2f
[INFO] running `Command { std: "docker" "start" "-a" "442e983af3ef57faf7c7a5db03c4a6173a436e5c3b74c1e483347137eb3a5e2f", kill_on_drop: false }`
[INFO] [stderr] warning: only one of `license` or `license-file` is necessary
[INFO] [stderr] `license` should be used if the package license can be expressed with a standard SPDX expression.
[INFO] [stderr] `license-file` should be used if the package uses a non-standard license.
[INFO] [stderr] See https://doc.rust-lang.org/cargo/reference/manifest.html#the-license-and-license-file-fields for more information.
[INFO] [stderr] warning: target filter specified, but no targets matched; this is a no-op
[INFO] [stderr]    Compiling cfg-expr v0.17.2
[INFO] [stderr]     Checking num-traits v0.2.19
[INFO] [stderr]     Checking crossbeam-deque v0.8.6
[INFO] [stderr]    Compiling glib-macros v0.20.7
[INFO] [stderr]    Compiling turbojpeg-sys v1.0.1
[INFO] [stderr]     Checking futures-util v0.3.31
[INFO] [stderr]     Checking rayon-core v1.12.1
[INFO] [stderr] error: failed to run custom build command for `turbojpeg-sys v1.0.1`
[INFO] [stderr] 
[INFO] [stderr] Caused by:
[INFO] [stderr]   process didn't exit successfully: `/opt/rustwide/target/debug/build/turbojpeg-sys-8362f4cf01cd747e/build-script-build` (exit status: 101)
[INFO] [stderr]   --- stdout
[INFO] [stderr]   cargo:rerun-if-changed=build.rs
[INFO] [stderr]   cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_TURBOJPEG_STATIC
[INFO] [stderr]   X86_64_UNKNOWN_LINUX_GNU_TURBOJPEG_STATIC unset
[INFO] [stderr]   cargo:rerun-if-env-changed=TURBOJPEG_STATIC
[INFO] [stderr]   TURBOJPEG_STATIC unset
[INFO] [stderr]   cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_TURBOJPEG_DYNAMIC
[INFO] [stderr]   X86_64_UNKNOWN_LINUX_GNU_TURBOJPEG_DYNAMIC unset
[INFO] [stderr]   cargo:rerun-if-env-changed=TURBOJPEG_DYNAMIC
[INFO] [stderr]   TURBOJPEG_DYNAMIC unset
[INFO] [stderr]   cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_TURBOJPEG_SHARED
[INFO] [stderr]   X86_64_UNKNOWN_LINUX_GNU_TURBOJPEG_SHARED unset
[INFO] [stderr]   cargo:rerun-if-env-changed=TURBOJPEG_SHARED
[INFO] [stderr]   TURBOJPEG_SHARED unset
[INFO] [stderr]   cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_TURBOJPEG_SOURCE
[INFO] [stderr]   X86_64_UNKNOWN_LINUX_GNU_TURBOJPEG_SOURCE unset
[INFO] [stderr]   cargo:rerun-if-env-changed=TURBOJPEG_SOURCE
[INFO] [stderr]   TURBOJPEG_SOURCE unset
[INFO] [stderr]   Building turbojpeg from source
[INFO] [stderr]   CMAKE_TOOLCHAIN_FILE_x86_64-unknown-linux-gnu = None
[INFO] [stderr]   CMAKE_TOOLCHAIN_FILE_x86_64_unknown_linux_gnu = None
[INFO] [stderr]   HOST_CMAKE_TOOLCHAIN_FILE = None
[INFO] [stderr]   CMAKE_TOOLCHAIN_FILE = None
[INFO] [stderr]   CMAKE_GENERATOR_x86_64-unknown-linux-gnu = None
[INFO] [stderr]   CMAKE_GENERATOR_x86_64_unknown_linux_gnu = None
[INFO] [stderr]   HOST_CMAKE_GENERATOR = None
[INFO] [stderr]   CMAKE_GENERATOR = None
[INFO] [stderr]   CMAKE_PREFIX_PATH_x86_64-unknown-linux-gnu = None
[INFO] [stderr]   CMAKE_PREFIX_PATH_x86_64_unknown_linux_gnu = None
[INFO] [stderr]   HOST_CMAKE_PREFIX_PATH = None
[INFO] [stderr]   CMAKE_PREFIX_PATH = None
[INFO] [stderr]   CMAKE_x86_64-unknown-linux-gnu = None
[INFO] [stderr]   CMAKE_x86_64_unknown_linux_gnu = None
[INFO] [stderr]   HOST_CMAKE = None
[INFO] [stderr]   CMAKE = None
[INFO] [stderr]   running: cd "/opt/rustwide/target/x86_64-unknown-linux-gnu/debug/build/turbojpeg-sys-a5a8a1bf6fb24135/out/build" && CMAKE_PREFIX_PATH="" LC_ALL="C" "cmake" "/opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/turbojpeg-sys-1.0.1/libjpeg-turbo" "-DCMAKE_INSTALL_DEFAULT_LIBDIR=lib" "-DCMAKE_INSTALL_PREFIX=/opt/rustwide/target/x86_64-unknown-linux-gnu/debug/build/turbojpeg-sys-a5a8a1bf6fb24135/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Debug" "-DENABLE_SHARED=0" "-DENABLE_STATIC=1" "-DREQUIRE_SIMD=ON"
[INFO] [stderr] 
[INFO] [stderr]   --- stderr
[INFO] [stderr] 
[INFO] [stderr]   thread 'main' panicked at /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/cmake-0.1.54/src/lib.rs:1119:5:
[INFO] [stderr] 
[INFO] [stderr]   failed to execute command: No such file or directory (os error 2)
[INFO] [stderr]   is `cmake` not installed?
[INFO] [stderr] 
[INFO] [stderr]   build script failed, must exit now
[INFO] [stderr]   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[INFO] [stderr] warning: build failed, waiting for other jobs to finish...
[INFO] running `Command { std: "docker" "inspect" "442e983af3ef57faf7c7a5db03c4a6173a436e5c3b74c1e483347137eb3a5e2f", kill_on_drop: false }`
[INFO] running `Command { std: "docker" "rm" "-f" "442e983af3ef57faf7c7a5db03c4a6173a436e5c3b74c1e483347137eb3a5e2f", kill_on_drop: false }`
[INFO] [stdout] 442e983af3ef57faf7c7a5db03c4a6173a436e5c3b74c1e483347137eb3a5e2f

@edgarriba
Copy link
Copy Markdown
Member

yep, something go broken with turbojpeg

@edgarriba
Copy link
Copy Markdown
Member

can you rebase this one ?

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 2, 2025

@edgarriba edgarriba merged commit 8f94afc into kornia:main Apr 2, 2025
14 checks passed
@AS1100K AS1100K deleted the issue-319 branch May 5, 2025 08:21
andrew-shc pushed a commit to andrew-shc/kornia-rs that referenced this pull request Aug 2, 2025
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

Successfully merging this pull request may close these issues.

kornia-io docs.rs docs aren't building

2 participants