Skip to content

Commit 0c473d7

Browse files
committed
Build for xplats, test on local docs.rs
1 parent 4602684 commit 0c473d7

File tree

3 files changed

+23
-15
lines changed

3 files changed

+23
-15
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,7 @@ rprompt = "2"
7777
whoami = "1.5"
7878

7979
[package.metadata.docs.rs]
80+
default-target = "x86_64-unknown-linux-gnu"
81+
targets = ["x86_64-unknown-linux-gnu", "aarch64-apple-darwin", "aarch64-apple-ios", "x86_64-pc-windows-msvc"]
8082
features = ["apple-native", "windows-native", "linux-native-sync-persistent", "crypto-rust"]
83+
cargo-args = ["-Z", "build-std"]

build-xplat-docs.sh

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#!/bin/bash
2-
if [[ "$OSTYPE" == "linux"* ]]; then
3-
cargo doc --no-deps --features=linux-native-sync-persistent $OPEN_DOCS
4-
cargo doc --no-deps --features=sync-secret-service $OPEN_DOCS
5-
cargo doc --no-deps --features=linux-native $OPEN_DOCS
6-
elif [[ "$OSTYPE" == "darwin"* ]]; then
7-
cargo doc --no-deps --features=linux-native --target aarch64-unknown-linux-musl $OPEN_DOCS
8-
cargo doc --no-deps --features=windows-native --target aarch64-pc-windows-msvc $OPEN_DOCS
9-
cargo doc --no-deps --features=apple-native --target aarch64-apple-darwin $OPEN_DOCS
10-
cargo doc --no-deps --features=apple-native --target aarch64-apple-ios $OPEN_DOCS
11-
fi
2+
3+
FEATURES="apple-native, windows-native, linux-native-sync-persistent, crypto-rust"
4+
TARGETS=(
5+
"x86_64-unknown-linux-gnu"
6+
"aarch64-apple-darwin"
7+
"aarch64-apple-ios"
8+
"x86_64-pc-windows-msvc"
9+
)
10+
11+
for TARGET in "${TARGETS[@]}"; do
12+
cargo +nightly doc --no-deps --features "$FEATURES" --target "$TARGET" -Zbuild-std $OPEN_DOCS
13+
done

src/lib.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ compile_error!("This crate cannot use both the sync and async versions of any cr
206206
//
207207
#[cfg(any(
208208
all(target_os = "linux", feature = "linux-native"),
209-
all(feature = "linux-native-sync-persistent", doc)
209+
all(target_os = "linux", feature = "linux-native-sync-persistent", doc)
210210
))]
211211
#[doc(cfg(all(target_os = "linux")))]
212212
pub mod keyutils;
@@ -218,9 +218,12 @@ pub mod keyutils;
218218
))]
219219
pub use keyutils as default;
220220

221-
#[cfg(all(
222-
any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"),
223-
any(feature = "sync-secret-service", feature = "async-secret-service"),
221+
#[cfg(any(
222+
all(
223+
any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"),
224+
any(feature = "sync-secret-service", feature = "async-secret-service"),
225+
),
226+
all(target_os = "linux", feature = "linux-native-sync-persistent", doc),
224227
))]
225228
#[doc(cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd")))]
226229
pub mod secret_service;
@@ -242,7 +245,7 @@ pub use secret_service as default;
242245
feature = "linux-native-async-persistent",
243246
)
244247
),
245-
all(feature = "linux-native-sync-persistent", doc),
248+
all(target_os = "linux", feature = "linux-native-sync-persistent", doc),
246249
))]
247250
#[doc(cfg(all(target_os = "linux")))]
248251
pub mod keyutils_persistent;

0 commit comments

Comments
 (0)