diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index ff722bc96e748..0000000000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Upload documentation to GitHub Pages - -on: - push: - branches: - - main - -# Sets permissions of `GITHUB_TOKEN` to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -jobs: - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-22.04 - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Rust toolchain - run: TARGET=x86_64-unknown-linux-gnu sh ./ci/install-rust.sh - - name: Generate documentation - run: LIBC_CI=1 sh ci/dox.sh - - name: Setup Pages - uses: actions/configure-pages@v3 - - name: Fix permissions - run: rm -f ./target/doc/.lock - - name: Upload artifact - uses: actions/upload-pages-artifact@v2 - with: - path: 'target/doc' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v2 diff --git a/README.md b/README.md index 43d706d0f2a64..29d2a4b6160f7 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ newer Rust features are only available on newer Rust toolchains: ## Platform support -[Platform-specific documentation (HEAD)][docs.head]. +You can see the platform(target)-specific docs on [docs.rs], select a platform you want to see. See [`ci/build.sh`](https://github.com/rust-lang/libc/blob/HEAD/ci/build.sh) @@ -107,4 +107,3 @@ dual licensed as above, without any additional terms or conditions. [Documentation]: https://docs.rs/libc/badge.svg [docs.rs]: https://docs.rs/libc [License]: https://img.shields.io/crates/l/libc.svg -[docs.head]: https://rust-lang.github.io/libc/#platform-specific-documentation diff --git a/ci/dox.sh b/ci/dox.sh deleted file mode 100644 index 6dd1e4a2282c7..0000000000000 --- a/ci/dox.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env sh - -# Builds documentation for all target triples that we have a registered URL for -# in liblibc. This scrapes the list of triples to document from `src/lib.rs` -# which has a bunch of `html_root_url` directives we pick up. - -set -ex - -TARGET_DOC_DIR="target/doc" -README="README.md" -PLATFORM_SUPPORT="platform-support.md" - -rm -rf "$TARGET_DOC_DIR" -mkdir -p "$TARGET_DOC_DIR" - -if ! rustc --version | grep -E "nightly" ; then - echo "Building the documentation requires a nightly Rust toolchain" - exit 1 -fi - -rustup component add rust-src - -# List all targets that do currently build successfully: -# shellcheck disable=SC1003 -grep '[\d|\w|-]* \\' ci/build.sh > targets -sed -i.bak 's/ \\//g' targets -grep '^[_a-zA-Z0-9-]*$' targets | sort > tmp && mv tmp targets - -# Create a markdown list of supported platforms in $PLATFORM_SUPPORT -rm $PLATFORM_SUPPORT || true - -printf '### Platform-specific documentation\n' >> $PLATFORM_SUPPORT - -while read -r target; do - echo "documenting ${target}" - - case "${target}" in - *apple*) - # FIXME: - # We can't build docs of apple targets from Linux yet. - continue - ;; - *) - ;; - esac - - rustup target add "${target}" || true - - # Enable extra configuration flags: - export RUSTDOCFLAGS="--cfg freebsd11" - - # If cargo doc fails, then try with unstable feature: - if ! cargo doc --target "${target}" \ - --no-default-features --features const-extern-fn,extra_traits ; then - cargo doc --target "${target}" \ - -Z build-std=core,alloc \ - --no-default-features --features const-extern-fn,extra_traits - fi - - mkdir -p "${TARGET_DOC_DIR}/${target}" - cp -r "target/${target}/doc" "${TARGET_DOC_DIR}/${target}" - - echo "* [${target}](${target}/doc/libc/index.html)" >> $PLATFORM_SUPPORT -done < targets - -# Replace
with the contents of $PLATFORM_SUPPORT -cp $README $TARGET_DOC_DIR -line=$(grep -n '
' $README | cut -d ":" -f 1) - -{ head -n "$((line-1))" $README; cat $PLATFORM_SUPPORT; tail -n "+$((line+1))" $README; } > $TARGET_DOC_DIR/$README - -cp $TARGET_DOC_DIR/$README $TARGET_DOC_DIR/index.md - -RUSTDOCFLAGS="--enable-index-page --index-page=${TARGET_DOC_DIR}/index.md -Zunstable-options" cargo doc - -# Tweak style -cp ci/rust.css $TARGET_DOC_DIR -sed -ie "8i " $TARGET_DOC_DIR/index.html -sed -ie "9i " $TARGET_DOC_DIR/index.html - -# Copy the licenses -cp LICENSE-* $TARGET_DOC_DIR/ diff --git a/src/lib.rs b/src/lib.rs index dc8f8312072e5..1b6f0c077ab24 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,8 +1,4 @@ //! libc - Raw FFI bindings to platforms' system libraries -//! -//! [Documentation for other platforms][pd]. -//! -//! [pd]: https://rust-lang.github.io/libc/#platform-specific-documentation #![crate_name = "libc"] #![crate_type = "rlib"] #![allow(