nginxinc / ngx-rust

Rust binding for NGINX
Apache License 2.0
713 stars 59 forks source link

crate documentation at docs.rs fails to build #85

Open bavshin-f5 opened 3 weeks ago

bavshin-f5 commented 3 weeks ago

Neither of the crates has a documentation available. This happens because docs.rs builds are performed in an isolated environment without network access and with limited filesystem access, therefore nginx-sys fails to fetch and build the dependencies.

Logs: ``` [INFO] running `Command { std: "docker" "create" "-v" "/home/cratesfyi/workspace-builder/builds/ngx-0.4.1/target:/opt/rustwide/target:rw,Z" "-v" "/home/cratesfyi/workspace-builder/builds/ngx-0.4.1/source:/opt/rustwide/workdir:ro,Z" "-v" "/home/cratesfyi/workspace-builder/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/home/cratesfyi/workspace-builder/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" "6442450944" "--cpus" "6" "--user" "1001:1001" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:2788e3201cd34a07e3172128adcd8b3090168a8e3bcc40d7c032b9dda1df7d1c" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "rustdoc" "--lib" "-Zrustdoc-map" "-Z" "unstable-options" "--config" "build.rustdocflags=[\"-Z\", \"unstable-options\", \"--emit=invocation-specific\", \"--resource-suffix\", \"-20231130-1.76.0-nightly-87e1447aa\", \"--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" "-j6" "--target" "x86_64-unknown-linux-gnu", kill_on_drop: false }` [INFO] [stderr] WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap. [INFO] [stdout] 4ff50542616c16f9e6936f68b5420444e406f0fc316bab0bf9567271ca7c6653 [INFO] running `Command { std: "docker" "start" "-a" "4ff50542616c16f9e6936f68b5420444e406f0fc316bab0bf9567271ca7c6653", kill_on_drop: false }` [INFO] [stderr] warning: Target filter specified, but no targets matched. This is a no-op [INFO] [stderr] Compiling nginx-sys v0.2.1 [INFO] [stderr] error: failed to run custom build command for `nginx-sys v0.2.1` [INFO] [stderr] [INFO] [stderr] Caused by: [INFO] [stderr] process didn't exit successfully: `/opt/rustwide/target/debug/build/nginx-sys-72198d03140dc169/build-script-build` (exit status: 1) [INFO] [stderr] --- stderr [INFO] [stderr] Error: Os { code: 30, kind: ReadOnlyFilesystem, message: "Read-only file system" } [INFO] running `Command { std: "docker" "inspect" "4ff50542616c16f9e6936f68b5420444e406f0fc316bab0bf9567271ca7c6653", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "4ff50542616c16f9e6936f68b5420444e406f0fc316bab0bf9567271ca7c6653", kill_on_drop: false }` [INFO] [stdout] 4ff50542616c16f9e6936f68b5420444e406f0fc316bab0bf9567271ca7c6653 ```

The build environment already has most of the things we need, we'll only have to deliver the NGINX itself and make it build against the system libs. A possible approach can be copied from the openssl crate: a new nginx-src crate that embeds a git submodule with the latest stable NGINX source.