Revert "github: Minimize dependencies for document generation"

This reverts commit 2b85d4d1e5.

Reason for revert: breaks powerd compile

Original change's description:
> github: Minimize dependencies for document generation
>
> Instead of install full dependencies with `install-deps` in GitHub
> action, minimize dependencies because we use GitHub only for document
> generation.
>
> - Passed `CARGO_DOC` environment when running cargo-doc command so we
>   can skip unnecessary build flow when we just want to generate API docs.
> - Added a new script `install-docs-deps` to install only doc-related
>   dependencies.
>
> BUG=none
> TEST=test on GitHub Action at my personal repository
>
> Change-Id: Ibe988ab43215e285d946812bdd6c1536ae87b50e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3578144
> Tested-by: kokoro <noreply+kokoro@google.com>
> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
> Reviewed-by: Anton Romanov <romanton@google.com>
> Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>

Bug: none
Change-Id: Ie16b65235490071ac4e69bf3f09af3ba0c766eab
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3581836
Auto-Submit: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
This commit is contained in:
Junichi Uekawa 2022-04-12 13:09:47 +00:00 committed by Chromeos LUCI
parent 3c9351b446
commit 7af06dfc70
10 changed files with 8 additions and 58 deletions

View file

@ -20,8 +20,7 @@ jobs:
mdbook-version: 'latest'
- name: Install Dependencies
run: |
sudo apt update
./tools/install-docs-deps
./tools/install-deps
- name: Run mdbook
run: |
mkdir -p docs/target/

View file

@ -3,11 +3,6 @@
// found in the LICENSE file.
fn main() {
// Skip installing dependencies when generating documents.
if std::env::var("CARGO_DOC").is_ok() {
return;
}
cc::Build::new()
.file("src/windows/stdio_fileno.c")
.compile("stdio_fileno");

View file

@ -71,11 +71,6 @@ fn compile_protocol<P: AsRef<Path>>(name: &str, out: P) -> PathBuf {
}
fn main() {
// Skip installing dependencies when generating documents.
if std::env::var("CARGO_DOC").is_ok() {
return;
}
println!("cargo:rerun-if-env-changed=WAYLAND_PROTOCOLS_PATH");
let out_dir = env::var("OUT_DIR").unwrap();

View file

@ -3,11 +3,6 @@
// found in the LICENSE file.
fn main() {
// Skip installing dependencies when generating documents.
if std::env::var("CARGO_DOC").is_ok() {
return;
}
#[allow(clippy::single_match)]
match pkg_config::probe_library("libvda") {
Ok(_) => (),

View file

@ -20,11 +20,6 @@ fn main() {
.collect()
}
// Skip building dependencies when generating documents.
if std::env::var("CARGO_DOC").is_ok() {
return Ok(());
}
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
let proto_root = match env::var("SYSROOT") {
Ok(dir) => PathBuf::from(dir).join("usr/include/chromeos"),

View file

@ -165,11 +165,6 @@ fn virglrenderer() -> Result<()> {
}
fn main() -> Result<()> {
// Skip installing dependencies when generating documents.
if std::env::var("CARGO_DOC").is_ok() {
return Ok(());
}
#[cfg(feature = "virgl_renderer")]
virglrenderer()?;

View file

@ -38,8 +38,6 @@ for f in $ALL_FEATURES; do
fi
done
# Set an environment variable 'CARGO_DOC' here so that each build.rs can skip
# building unnecessary dependencies to generate documentations.
CARGO_DOC="true" cargo doc \
cargo doc \
--manifest-path="${MANIFEST_PATH}" \
--features="${features}" "$@"

View file

@ -15,6 +15,7 @@ sudo apt-get install --yes --no-install-recommends \
git \
jq \
libasound2-dev \
libcap-dev \
libclang-dev \
libdbus-1-dev \
libdrm-dev \
@ -27,6 +28,7 @@ sudo apt-get install --yes --no-install-recommends \
ninja-build \
openssh-client \
pkg-config \
protobuf-compiler \
python3 \
python3-pip \
python3-setuptools \
@ -54,5 +56,7 @@ rustup target add x86_64-pc-windows-gnu
# The bindgen tool is required to build a crosvm dependency.
cargo install bindgen
# Install dependencies used to generate mdbook documentation.
$(dirname "$0")/install-docs-deps
# The mdbook and mdbook-mermaid tools are used to build the crosvm book.
cargo install mdbook --no-default-features --version "^0.4.10"
cargo install mdbook-mermaid --version "^0.8.3"
cargo install mdbook-linkcheck --version "^0.7.6"

View file

@ -1,21 +0,0 @@
#!/usr/bin/env bash
# Copyright 2022 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Install dependencies to generate mdbook documentation.
# Before running this script, `apt update` needs to be executed.
set -ex
# Install packages to run build.rs in some crate:
# * libcap-dev: Used by minijail-sys/build.rs
# * protobuf-compiler: Generates Rust files in protos
sudo apt install --yes --no-install-recommends \
libcap-dev \
protobuf-compiler
# The mdbook and mdbook-mermaid tools are used to build the crosvm book.
cargo install mdbook --no-default-features --version "^0.4.10"
cargo install mdbook-mermaid --version "^0.8.3"
cargo install mdbook-linkcheck --version "^0.7.6"

View file

@ -57,11 +57,6 @@ fn build_libtpm2(out_dir: &Path) -> Result<()> {
}
fn main() -> Result<()> {
// Skip installing dependencies when generating documents.
if std::env::var("CARGO_DOC").is_ok() {
return Ok(());
}
// Use tpm2 package from the standard system location if available.
if pkg_config::Config::new()
.statik(true)