Skip to content

Commit

Permalink
Fix docsrs build (#505)
Browse files Browse the repository at this point in the history
* Add docsrs build to CI

* Put cfg flags in both RUSTFLAGS and RUSTDOCFLAGS
  • Loading branch information
rozbb authored Feb 2, 2023
1 parent b375b46 commit 3b71630
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
5 changes: 1 addition & 4 deletions src/backend/vector/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 3b71630

Please sign in to comment.