Fix docsrs build (#505)

* Add docsrs build to CI

* Put cfg flags in both RUSTFLAGS and RUSTDOCFLAGS
This commit is contained in:
Michael Rosenberg 2023-02-02 04:06:14 -05:00 committed by GitHub
parent b375b46d37
commit 3b71630d9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 6 deletions

View file

@ -69,6 +69,15 @@ jobs:
RUSTFLAGS: '--cfg curve25519_dalek_backend="simd" -C target_feature=+avx512ifma'
run: cargo build --target x86_64-unknown-linux-gnu
build-docs:
name: Build docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
- run: make doc
- run: make doc-internal
cross:
strategy:
matrix:

View file

@ -1,7 +1,12 @@
FEATURES := serde rand_core digest
export RUSTFLAGS := --cfg=curve25519_dalek_backend="simd"
export RUSTDOCFLAGS := \
--cfg docsrs \
--html-in-header docs/assets/rustdoc-include-katex-header.html
doc:
cargo +nightly rustdoc --features "$(FEATURES)" -- --html-in-header docs/assets/rustdoc-include-katex-header.html --cfg docsrs --cfg=curve25519_dalek_backend=\"simd\"
cargo +nightly rustdoc --features "$(FEATURES)"
doc-internal:
cargo +nightly rustdoc --features "$(FEATURES)" -- --html-in-header docs/assets/rustdoc-include-katex-header.html --document-private-items --cfg docsrs --cfg=curve25519_dalek_backend=\"simd\"
cargo +nightly rustdoc --features "$(FEATURES)" -- --document-private-items

View file

@ -50,8 +50,5 @@ pub mod scalar_mul;
))]
pub(crate) use self::avx2::constants::BASEPOINT_ODD_LOOKUP_TABLE;
#[cfg(any(
all(target_feature = "avx512ifma", feature = "precomputed-tables"),
all(docsrs, target_arch = "x86_64")
))]
#[cfg(all(target_feature = "avx512ifma", feature = "precomputed-tables"))]
pub(crate) use self::ifma::constants::BASEPOINT_ODD_LOOKUP_TABLE;