Skip to content

Commit

Permalink
Made test-build-docs-rs tests docs generation for all crates under li…
Browse files Browse the repository at this point in the history
…bs, and fixed broken ones (#3827)

* Made test-build-docs-rs tests docs generation for all crates under libs

* Fixed testing of docs

* Fixed docs generation for wasmer-cache crate

* Fixed emscripten crate doc generation

* Fixed doc generation for wai-bindgen-wasmer crate

* Fixed doc generation for wasix-types crate

* Fixed Corgo.toml for wasmer-web crate

* Don't try to generate doc for wasmer-web crate
  • Loading branch information
ptitSeb authored Apr 27, 2023
1 parent 0769e3d commit d81957a
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 22 deletions.
21 changes: 14 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -443,14 +443,21 @@ build-docs:
test-build-docs-rs:
@manifest_docs_rs_features_path="package.metadata.docs.rs.features"; \
for manifest_path in lib/*/Cargo.toml; do \
toml get "$$manifest_path" "$$manifest_docs_rs_features_path" >/dev/null 2>&1; \
if [ $$? -ne 0 ]; then \
continue; \
if [ "$$manifest_path" != "lib/wasi-web/Cargo.toml" ]; then \
toml get "$$manifest_path" "$$manifest_docs_rs_features_path" >/dev/null 2>&1; \
if [ $$? -ne 0 ]; then \
features=""; \
else \
features=$$(toml get "$$manifest_path" "$$manifest_docs_rs_features_path" | sed 's/\[//; s/\]//; s/"\([^"]*\)"/\1/g'); \
fi; \
printf "*** Building doc for package with manifest $$manifest_path ***\n\n"; \
if [ -z "$$features" ]; then \
$(CARGO_BINARY) doc $(CARGO_TARGET_FLAG) --manifest-path "$$manifest_path" || exit 1; \
else \
printf "Following features are inferred from Cargo.toml: $$features\n\n\n"; \
$(CARGO_BINARY) doc $(CARGO_TARGET_FLAG) --manifest-path "$$manifest_path" --features "$$features" || exit 1; \
fi; \
fi; \
features=$$(toml get "$$manifest_path" "$$manifest_docs_rs_features_path" | sed 's/\[//; s/\]//; s/"\([^"]*\)"/\1/g'); \
printf "*** Building doc for package with manifest $$manifest_path ***\n\n"; \
printf "Following features are inferred from Cargo.toml: $$features\n\n\n"; \
$(CARGO_BINARY) doc $(CARGO_TARGET_FLAG) --manifest-path "$$manifest_path" --features "$$features" || exit 1; \
done

build-docs-capi:
Expand Down
3 changes: 3 additions & 0 deletions lib/cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ wasmer-compiler-singlepass = { path = "../compiler-singlepass", version = "=3.2.
default = ["filesystem"]
filesystem = []
blake3-pure = ["blake3/pure"]

[package.metadata.docs.rs]
features = ["wasmer/sys"]
3 changes: 3 additions & 0 deletions lib/emscripten/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ wasmer-types = { path = "../types", version = "=3.2.1" }

[target.'cfg(windows)'.dependencies]
getrandom = "0.2"

[package.metadata.docs.rs]
features = ["wasmer/sys"]
3 changes: 3 additions & 0 deletions lib/wai-bindgen-wasmer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ async = ["async-trait", "wai-bindgen-wasmer-impl/async"]
# Wasmer features
js = ["wasmer/js", "wasmer/std"]
sys = ["wasmer/sys"]

[package.metadata.docs.rs]
features = ["wasmer/sys"]
3 changes: 3 additions & 0 deletions lib/wasi-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ version = "1.3.0"

[features]
enable-serde = ["serde", "wasmer-types/serde"]

[package.metadata.docs.rs]
features = ["wasmer/sys"]
58 changes: 43 additions & 15 deletions lib/wasi-web/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d81957a

Please sign in to comment.