crosvm/tools/cargo-doc
Keiichi Watanabe 3c82cee8c0 tools: cargo-doc: Exclude crash-report feature
Exclude crash-report feature when generating cargo-doc because the
feature only works on Windows. This should fix GitHub action's failure
started by crrev.com/c/3765346 [1].

[1] https://github.com/google/crosvm/runs/7417889096?check_suite_focus=true

BUG=none
TEST=run ./tools/cargo-doc locally

Change-Id: I1481bf8221fc7a583b9147992d116278b4df9e05
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3780081
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Tested-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-07-21 16:57:14 +00:00

51 lines
1.1 KiB
Bash
Executable file

#!/usr/bin/env bash
# Copyright 2021 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.
set -ex
# Build cargo-doc
# $ ./tools/cargo-doc --target-dir /path/to/dir
echo "start cargo-doc"
MANIFEST_PATH=$(dirname "$0")/../Cargo.toml
echo "manifest = ${MANIFEST_PATH}"
DISABLED_FEATURES=(
audio_cras
chromeos
crash-report
libvda
power-monitor-powerd
video-decoder
video-encoder
)
ALL_FEATURES=$(
cargo metadata --manifest-path "${MANIFEST_PATH}" | \
jq -r '.packages[] |
select(.name == "crosvm") |
.features |
keys[]')
features=""
for f in $ALL_FEATURES; do
if [[ ! "${DISABLED_FEATURES[*]}" =~ $f ]]; then
features+=",${f}"
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 \
--manifest-path="${MANIFEST_PATH}" \
--workspace \
--no-deps \
--exclude crosvm-fuzz \
--features="${features}" "$@" \
--document-private-items