chore: checkpoint before Python removal

This commit is contained in:
2026-03-26 22:33:59 +00:00
parent 683cec9307
commit e568ddf82a
29972 changed files with 11269302 additions and 2 deletions

View File

@@ -0,0 +1,11 @@
[env]
# To disable this, simply export the variable with the value 0 or give cargo
# `--config=env.RUST_BACKTRACE=\'0\'` option.
# Note that the value should have a string type, not an integer.
RUST_BACKTRACE = '1'
[term]
quiet = false
verbose = true
color = 'always'
progress.when = 'never'

View File

@@ -0,0 +1,27 @@
---
# Checks if doc comments will have no errors on `docs.rs`.
when:
- event: [manual, push, tag]
variables:
rust_nightly_image: &rust_nightly_image 'rustlang/rust:nightly-slim'
clone:
git:
image: woodpeckerci/plugin-git
settings:
# Custom root CA certificate will be used in some local networks.
# The global environment variable WP_GIT_SKIP_VERIFY will be
# set to `true` in such environment.
skip-verify: ${WP_GIT_SKIP_VERIFY:-false}
lfs: false
steps:
- name: doc (docs.rs)
image: *rust_nightly_image
commands:
- export RUSTDOCFLAGS="-D warnings"
# Workaround to avoid build failure caused by too-old dependencies.
- cargo update
- cargo rustdoc --all-features -- --cfg docsrs

View File

@@ -0,0 +1,55 @@
---
# Checks if doc comments have no errors.
when:
- event: [manual, push, tag]
variables:
msrv_channel: &msrv_channel '1.60.0'
# Docker image of the MSRV.
rust_msrv_image: &rust_image 'library/rust:1.60.0-slim'
configure_toolchain_cmds: &configure_toolchain_cmds
- cp .woodpecker/cargo-config.toml $${CARGO_HOME}/config.toml
# Use the Rust toolchain(s) cached in the CI workspace directory.
- export RUSTUP_HOME=$${CI_WORKSPACE}/.tmp-rustup-home && test -d $${RUSTUP_HOME}
- rustc --version && cargo --version
matrix:
OPT_FEATURES:
- --features= # no features
- --features=default
- --all-features
- --features=alloc
- --features=std
clone:
git:
image: woodpeckerci/plugin-git
settings:
# Custom root CA certificate will be used in some local networks.
# The global environment variable WP_GIT_SKIP_VERIFY will be
# set to `true` in such environment.
skip-verify: ${WP_GIT_SKIP_VERIFY:-false}
lfs: false
steps:
- name: install Rust toolchain
image: *rust_image
commands:
- .woodpecker/scripts/prepare-toolchain.sh $${RUST_CHANNEL}
environment:
RUST_CHANNEL: *msrv_channel
- name: doc
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
- export RUSTDOCFLAGS="-D warnings"
- cargo doc --workspace --no-deps ${OPT_FEATURES}
- name: doc private-items
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
- export RUSTDOCFLAGS="-D warnings"
- cargo doc --workspace --no-deps ${OPT_FEATURES} --document-private-items

View File

@@ -0,0 +1,46 @@
---
# Checks if doc comments have no errors.
when:
- event: [manual, push, tag]
variables:
# Docker image of the latest stable Rust.
rust_image: &rust_image 'library/rust:slim'
configure_toolchain_cmds: &configure_toolchain_cmds
- cp .woodpecker/cargo-config.toml $${CARGO_HOME}/config.toml
# Use the Rust toolchain(s) cached in the CI workspace directory.
- export RUSTUP_HOME=$${CI_WORKSPACE}/.tmp-rustup-home && test -d $${RUSTUP_HOME}
- rustc --version && cargo --version
clone:
git:
image: woodpeckerci/plugin-git
settings:
# Custom root CA certificate will be used in some local networks.
# The global environment variable WP_GIT_SKIP_VERIFY will be
# set to `true` in such environment.
skip-verify: ${WP_GIT_SKIP_VERIFY:-false}
lfs: false
steps:
- name: install Rust toolchain
image: *rust_image
commands:
- .woodpecker/scripts/prepare-toolchain.sh $${RUST_CHANNEL}
environment:
RUST_CHANNEL: stable
- name: doc
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
- export RUSTDOCFLAGS="-D warnings"
- cargo doc --workspace --no-deps ${OPT_FEATURES}
- name: doc private-items
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
- export RUSTDOCFLAGS="-D warnings"
- cargo doc --workspace --no-deps ${OPT_FEATURES} --document-private-items

View File

@@ -0,0 +1,42 @@
---
# Checks if the sources are properly formatted.
when:
- event: [manual, push, tag]
variables:
rust_image: &rust_image 'library/rust:1.89.0-slim'
format_cmds: &format_cmds
- cp .woodpecker/cargo-config.toml $${CARGO_HOME}/config.toml
- rustup update --no-self-update $${RUST_CHANNEL} && rustup default $${RUST_CHANNEL}
- rustc --version && cargo --version
- rustup component add rustfmt
- cargo fmt --all -- --check
clone:
git:
image: woodpeckerci/plugin-git
settings:
# Custom root CA certificate will be used in some local networks.
# The global environment variable WP_GIT_SKIP_VERIFY will be
# set to `true` in such environment.
skip-verify: ${WP_GIT_SKIP_VERIFY:-false}
lfs: false
steps:
- name: rust format stable
image: *rust_image
commands:
- <<: *format_cmds
environment:
RUST_CHANNEL: stable
depends_on: []
- name: rust format beta
failure: ignore
image: *rust_image
commands:
- <<: *format_cmds
environment:
RUST_CHANNEL: beta
depends_on: []

View File

@@ -0,0 +1,24 @@
---
# Checks if MSRV is consistent with the toplevel `Cargo.toml`.
when:
- event: [manual, push, tag]
variables:
base_image: &base_image 'library/debian:12-slim'
clone:
git:
image: woodpeckerci/plugin-git
settings:
# Custom root CA certificate will be used in some local networks.
# The global environment variable WP_GIT_SKIP_VERIFY will be
# set to `true` in such environment.
skip-verify: ${WP_GIT_SKIP_VERIFY:-false}
lfs: false
steps:
- name: check
image: *base_image
commands:
- .woodpecker/scripts/check-msrv-consistency.sh

View File

@@ -0,0 +1,34 @@
#!/bin/sh
set -eu
cd "$(readlink -f "$(dirname "$0")/../..")"
# Get MSRV from the toplevel Cargo.toml
MSRV="$(sed -ne 's/^rust-version\s*=\s*[^0-9#]\([0-9.]\+\).*$/\1/p' Cargo.toml)"
echo "MSRV=${MSRV}"
MSRV_REGEX="$(echo "$MSRV" | sed -e 's/\./\\./g')"
check_readme() {
echo "checking README.md"
grep --color=always --with-filename --line-number --ignore-case 'minimum supported rust\(c\)\? version.*'"${MSRV_REGEX}" README.md
}
check_readme
check_woodpecker() {
for yml_path in .woodpecker/*.yml ; do
echo "checking ${yml_path}"
# Check `msrv_channel` variable.
if grep --quiet '^\s*msrv_channel:' "$yml_path" ; then
grep --color=always --with-filename --line-number '^\s*msrv_channel:[^#]*'"${MSRV_REGEX}"'\>' "$yml_path"
fi
# Check `rust_msrv_image` variable.
if grep --quiet '^\s*rust_msrv_image:' "$yml_path" ; then
grep --color=always --with-filename --line-number '^\s*rust_msrv_image:[^#]*'"${MSRV_REGEX}"'\>' "$yml_path"
fi
done
}
check_woodpecker
# vim: set expandtab tabstop=4 :

View File

@@ -0,0 +1,25 @@
#!/bin/sh
set -eu
cd "$(readlink -f "$(dirname "$0")/../..")"
set -x
RUST_CHANNEL="$1"
# Use the preset for CI environment.
cp .woodpecker/cargo-config.toml ${CARGO_HOME}/config.toml
# The repository should not have a directory which would be used as the cached `$RUSTUP_HOME`.
CACHED_RUSTUP_HOME=${CI_WORKSPACE}/.tmp-rustup-home && test ! -e ${CACHED_RUSTUP_HOME}
# Copy the pre-installed toolchains of the Docker container into the new `$RUSTUP_HOME`.
cp -a /usr/local/rustup ${CACHED_RUSTUP_HOME} && test -d ${CACHED_RUSTUP_HOME}
# Use the new `$RUSTUP_HOME` variable.
export RUSTUP_HOME=${CACHED_RUSTUP_HOME}
# Install the toolchain of the specified version (if not yet available locally).
rustup update --no-self-update ${RUST_CHANNEL} && rustup default ${RUST_CHANNEL}
rustc --version && cargo --version

View File

@@ -0,0 +1,170 @@
---
# Lint, build, and test.
# Clippy lint will make the subsequent build faster, and the result of the build
# is necessary for the test.
when:
- event: [manual, push, tag]
variables:
# Docker image of the latest stable Rust.
rust_image: &rust_image 'library/rust:slim'
rust_nightly_image: &rust_nightly_image 'rustlang/rust:nightly-slim'
configure_toolchain_cmds: &configure_toolchain_cmds
- cp .woodpecker/cargo-config.toml $${CARGO_HOME}/config.toml
# Use the Rust toolchain(s) cached in the CI workspace directory.
- export RUSTUP_HOME=$${CI_WORKSPACE}/.tmp-rustup-home && test -d $${RUSTUP_HOME}
- rustc --version && cargo --version
matrix:
RUST_CHANNEL:
- stable
BUILD_PROFILE:
- dev # equivalent to no --release flag (debug build)
- release # equivalent to --release flag
OPT_FEATURES:
- --features= # no features
- --features=default
- --all-features
# `minimal`: minimal dependency versions
# `direct-minimal`: minimal direct dependency versions
# `default`: default dependency versions (just ensures `Cargo.lock` exists)
# `updated`: explicitly updated dependency versions (cargo update)
RUST_DEP_VERSIONS:
- direct-minimal
- default
include:
# To see if updated dependencies break something.
- RUST_CHANNEL: stable
BUILD_PROFILE: dev
OPT_FEATURES: --all-features
RUST_DEP_VERSIONS: updated
# To see if updated toolchain reject something.
- RUST_CHANNEL: beta
BUILD_PROFILE: dev
OPT_FEATURES: --all-features
RUST_DEP_VERSIONS: direct-minimal
# To see if updated toolchain and dependencies break something.
- RUST_CHANNEL: beta
BUILD_PROFILE: dev
OPT_FEATURES: --all-features
RUST_DEP_VERSIONS: updated
clone:
git:
image: woodpeckerci/plugin-git
settings:
# Custom root CA certificate will be used in some local networks.
# The global environment variable WP_GIT_SKIP_VERIFY will be
# set to `true` in such environment.
skip-verify: ${WP_GIT_SKIP_VERIFY:-false}
lfs: false
steps:
- name: install Rust toolchain
image: *rust_image
commands:
- .woodpecker/scripts/prepare-toolchain.sh $${RUST_CHANNEL}
- name: prepare deps
image: *rust_image
commands:
# Ensure `Cargo.lock` exists.
- if [ ! -f Cargo.lock ] ; then echo "Cargo.lock is missing" >&2 ; exit 1 ; fi
when:
- matrix:
RUST_DEP_VERSIONS: default
- name: prepare deps
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
- cargo update
when:
- matrix:
RUST_DEP_VERSIONS: updated
- name: prepare deps
image: *rust_nightly_image
commands:
- rustc --version && cargo --version
- cargo update -Zminimal-versions
when:
- matrix:
RUST_DEP_VERSIONS: minimal
- name: prepare deps
image: *rust_nightly_image
commands:
- rustc --version && cargo --version
- cargo update -Zdirect-minimal-versions
when:
- matrix:
RUST_DEP_VERSIONS: direct-minimal
- name: fetch deps
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
- cargo fetch --locked
- mkdir -p .cargo
- cargo vendor --color=always --locked >> .cargo/config.toml
- name: clippy (allow warning)
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
- rustup component add clippy
- cargo clippy --version
# TODO: Deny warnings for all the workspace members once the MSRV and deps are bumped.
#- cargo clippy --color=always --frozen --workspace --all-targets --no-deps --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES} -- --deny warnings
- cargo clippy --color=always --frozen --all-targets --no-deps --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}
when:
- matrix:
RUST_DEP_VERSIONS: minimal
- matrix:
RUST_DEP_VERSIONS: direct-minimal
- matrix:
RUST_DEP_VERSIONS: default
- name: clippy
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
- rustup component add clippy
- cargo clippy --version
# TODO: Deny warnings for all the workspace members once the MSRV and deps are bumped.
#- cargo clippy --color=always --frozen --workspace --all-targets --no-deps --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES} -- --deny warnings
- cargo clippy --color=always --frozen --all-targets --no-deps --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES} -- --deny warnings
when:
- matrix:
RUST_DEP_VERSIONS: updated
- name: build
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
# TODO: Build all the workspace members once the MSRV and deps are bumped.
#- cargo build --color=always --frozen --workspace --all-targets --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}
- cargo build --color=always --frozen --all-targets --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}
- name: run tests
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
- export RUST_BACKTRACE=1
# TODO: Test all the workspace members once the MSRV and deps are bumped.
#- cargo test --color=always --frozen --workspace --all-targets --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}
- cargo test --color=always --frozen --all-targets --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}
- name: run doctests
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
- export RUST_BACKTRACE=1
# TODO: Test all the workspace members once the MSRV and deps are bumped.
#- cargo test --color=always --frozen --workspace --doc --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}
- cargo test --color=always --frozen --doc --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}

View File

@@ -0,0 +1,220 @@
---
# Lint, build, and test.
# Clippy lint will make the subsequent build faster, and the result of the build
# is necessary for the test.
when:
- event: [manual, push, tag]
variables:
msrv_channel: &msrv_channel '1.60.0'
# Docker image of the MSRV.
rust_msrv_image: &rust_image 'library/rust:1.60.0-slim'
rust_nightly_image: &rust_nightly_image 'rustlang/rust:nightly-slim'
configure_toolchain_cmds: &configure_toolchain_cmds
- cp .woodpecker/cargo-config.toml $${CARGO_HOME}/config.toml
# Use the Rust toolchain(s) cached in the CI workspace directory.
- export RUSTUP_HOME=$${CI_WORKSPACE}/.tmp-rustup-home && test -d $${RUSTUP_HOME}
- rustc --version && cargo --version
matrix:
BUILD_PROFILE:
- dev # equivalent to no --release flag (debug build)
- release # equivalent to --release flag
OPT_FEATURES:
- --features= # no features
- --features=default
- --all-features
- --features=alloc
- --features=std
- --features=alloc,serde
# `minimal`: minimal dependency versions
# `direct-minimal`: minimal direct dependency versions
# `default`: default dependency versions (just ensures `Cargo.lock` exists)
# `updated`: explicitly updated dependency versions (cargo update)
RUST_DEP_VERSIONS:
- direct-minimal
- default
- updated
clone:
git:
image: woodpeckerci/plugin-git
settings:
# Custom root CA certificate will be used in some local networks.
# The global environment variable WP_GIT_SKIP_VERIFY will be
# set to `true` in such environment.
skip-verify: ${WP_GIT_SKIP_VERIFY:-false}
lfs: false
steps:
- name: install Rust toolchain
image: *rust_image
commands:
- .woodpecker/scripts/prepare-toolchain.sh $${RUST_CHANNEL}
environment:
RUST_CHANNEL: *msrv_channel
- name: prepare deps
image: *rust_image
commands:
# Ensure `Cargo.lock` exists.
- if [ ! -f Cargo.lock ] ; then echo "Cargo.lock is missing" >&2 ; exit 1 ; fi
when:
- matrix:
RUST_DEP_VERSIONS: default
- name: prepare deps
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
- cargo update
when:
- matrix:
RUST_DEP_VERSIONS: updated
- name: prepare deps
image: *rust_nightly_image
commands:
- rustc --version && cargo --version
- cargo update --workspace -Zminimal-versions
when:
- matrix:
RUST_DEP_VERSIONS: minimal
- name: prepare deps
image: *rust_nightly_image
commands:
- rustc --version && cargo --version
- cargo update -Zdirect-minimal-versions
when:
- matrix:
RUST_DEP_VERSIONS: direct-minimal
- name: fetch deps
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
- cargo fetch --locked
- mkdir -p .cargo
- cargo vendor --color=always --locked >> .cargo/config.toml
- name: clippy (allow warning)
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
- rustup component add clippy
- cargo clippy --version
# TODO: Deny warnings for all the workspace members once the MSRV and deps are bumped.
#- cargo clippy --color=always --frozen --workspace --all-targets --no-deps --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES} -- --deny warnings
- cargo clippy --color=always --frozen --all-targets --no-deps --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}
when:
- matrix:
RUST_DEP_VERSIONS: minimal
- matrix:
RUST_DEP_VERSIONS: default
- name: clippy (allow warning, allow failure)
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
- rustup component add clippy
- cargo clippy --version
# TODO: Deny warnings for all the workspace members once the MSRV and deps are bumped.
#- cargo clippy --color=always --frozen --workspace --all-targets --no-deps --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES} -- --deny warnings
- cargo clippy --color=always --frozen --all-targets --no-deps --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}
# Build may fail because updated crates will have higher MSRV.
failure: ignore
when:
- matrix:
RUST_DEP_VERSIONS: direct-minimal
- matrix:
RUST_DEP_VERSIONS: updated
- name: build (allow failure)
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
# TODO: Build all the workspace members once the MSRV and deps are bumped.
#- cargo build --color=always --frozen --workspace --all-targets --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}
- cargo build --color=always --frozen --all-targets --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}
# Build may fail because updated crates will have higher MSRV.
failure: ignore
when:
- matrix:
RUST_DEP_VERSIONS: direct-minimal
- matrix:
RUST_DEP_VERSIONS: updated
- name: build
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
# TODO: Build all the workspace members once the MSRV and deps are bumped.
#- cargo build --color=always --frozen --workspace --all-targets --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}
- cargo build --color=always --frozen --all-targets --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}
when:
- matrix:
RUST_DEP_VERSIONS: minimal
- matrix:
RUST_DEP_VERSIONS: default
- name: run tests (allow failure)
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
- export RUST_BACKTRACE=1
# TODO: Test all the workspace members once the MSRV and deps are bumped.
#- cargo test --color=always --frozen --workspace --all-targets --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}
- cargo test --color=always --frozen --all-targets --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}
# Build may fail because updated crates will have higher MSRV.
failure: ignore
when:
- matrix:
RUST_DEP_VERSIONS: direct-minimal
- matrix:
RUST_DEP_VERSIONS: updated
- name: run tests
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
- export RUST_BACKTRACE=1
# TODO: Test all the workspace members once the MSRV and deps are bumped.
#- cargo test --color=always --frozen --workspace --all-targets --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}
- cargo test --color=always --frozen --all-targets --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}
when:
- matrix:
RUST_DEP_VERSIONS: minimal
- matrix:
RUST_DEP_VERSIONS: default
- name: run doctests (allow failure)
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
- export RUST_BACKTRACE=1
# TODO: Test all the workspace members once the MSRV and deps are bumped.
#- cargo test --color=always --frozen --workspace --doc --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}
- cargo test --color=always --frozen --doc --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}
# Build may fail because updated crates will have higher MSRV.
failure: ignore
when:
- matrix:
RUST_DEP_VERSIONS: direct-minimal
- matrix:
RUST_DEP_VERSIONS: updated
- name: run doctests
image: *rust_image
commands:
- <<: *configure_toolchain_cmds
- export RUST_BACKTRACE=1
# TODO: Test all the workspace members once the MSRV and deps are bumped.
#- cargo test --color=always --frozen --workspace --doc --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}
- cargo test --color=always --frozen --doc --profile=${BUILD_PROFILE} --no-default-features ${OPT_FEATURES}
when:
- matrix:
RUST_DEP_VERSIONS: minimal
- matrix:
RUST_DEP_VERSIONS: default