chore: move Rust toolchain and Cargo configuration into the workspace

This commit is contained in:
Devin AI 2026-11-10 20:07:54 +00:00
parent 9df55d637d
commit 62e4de3c82
14 changed files with 48 additions and 21 deletions

View file

@ -11,6 +11,11 @@ inputs:
runs:
using: composite
steps:
- name: Configure the Rust build environment
shell: bash
working-directory: ${{ github.workspace }}
run: bash .github/scripts/setup_rust_environment.sh
- name: Set up uv (attempt 1)
id: attempt-1
continue-on-error: true

View file

@ -19,11 +19,11 @@ while IFS= read -r file || [ -n "$file" ]; do
esac
case "$file" in
*.md | *.mdx) : ;;
pyproject.toml | */pyproject.toml | uv.lock | uv.toml | .python-version | rust-toolchain.toml | litellm/rust/* | litellm/__init__.py | litellm/proxy/proxy_server.py | litellm/*mcp* | tests/*mcp* | litellm/integrations/arize/* | tests/base_sdk_tests/* | litellm/scripts/check_mcp_sdk_install.py | .github/workflows/test-mcp-dependency-resolution.yml | .github/actions/detect-changes/* | .github/actions/setup-uv-with-retries/* | .github/actions/cache-cargo-build/* | .github/scripts/detect_changes.sh | .github/scripts/uv_sync_with_retries.sh | .github/scripts/ci/classify_changes.sh | tests/unit/test_ci_path_filter.py | tests/unit/test_detect_changes.py)
pyproject.toml | */pyproject.toml | uv.lock | uv.toml | .python-version | litellm/rust/* | litellm/__init__.py | litellm/proxy/proxy_server.py | litellm/*mcp* | tests/*mcp* | litellm/integrations/arize/* | tests/base_sdk_tests/* | litellm/scripts/check_mcp_sdk_install.py | .github/workflows/test-mcp-dependency-resolution.yml | .github/actions/detect-changes/* | .github/actions/setup-uv-with-retries/* | .github/actions/cache-cargo-build/* | .github/scripts/detect_changes.sh | .github/scripts/uv_sync_with_retries.sh | .github/scripts/ci/classify_changes.sh | tests/unit/test_ci_path_filter.py | tests/unit/test_detect_changes.py)
has_mcp_dependencies=true ;;
esac
case "$file" in
litellm/rust/* | litellm/rust_bridge/* | rust-toolchain.toml | pyproject.toml | uv.lock | tests/windows_tests/* | .github/scripts/ci/* | .github/actions/*)
litellm/rust/* | litellm/rust_bridge/* | pyproject.toml | uv.lock | tests/windows_tests/* | .github/scripts/ci/* | .github/actions/*)
has_windows_release=true ;;
esac
case "$file" in

View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail
root=$(git rev-parse --show-toplevel)
toolchain=$(sed -n 's/^[[:space:]]*channel[[:space:]]*=[[:space:]]*"\([^"]*\)".*/\1/p' "$root/litellm/rust/rust-toolchain.toml")
test -n "$toolchain"
rustup toolchain install "$toolchain" --profile minimal --component rustfmt --component clippy --no-self-update
{
echo "RUSTUP_TOOLCHAIN=$toolchain"
echo "CARGO_NET_RETRY=5"
echo "CARGO_HTTP_MULTIPLEXING=false"
echo "SQLX_OFFLINE=${SQLX_OFFLINE:-true}"
} >> "${GITHUB_ENV:?GITHUB_ENV is required}"

View file

@ -10,7 +10,7 @@ on:
- "uv.lock"
- "uv.toml"
- ".python-version"
- "rust-toolchain.toml"
- "litellm/rust/rust-toolchain.toml"
- "litellm/rust/**"
- "litellm/__init__.py"
- "litellm/_version.py"

View file

@ -9,8 +9,8 @@ on:
- "litellm/rust/clippy.toml"
- "litellm/proxy-extras/litellm_proxy_extras/migrations/**"
- "**/schema.prisma"
- ".cargo/**"
- "rust-toolchain.toml"
- "litellm/rust/.cargo/**"
- "litellm/rust/rust-toolchain.toml"
- "pyproject.toml"
- "uv.lock"
- ".github/actions/setup-uv-with-retries/**"
@ -26,8 +26,8 @@ on:
- "litellm/rust/clippy.toml"
- "litellm/proxy-extras/litellm_proxy_extras/migrations/**"
- "**/schema.prisma"
- ".cargo/**"
- "rust-toolchain.toml"
- "litellm/rust/.cargo/**"
- "litellm/rust/rust-toolchain.toml"
- "pyproject.toml"
- "uv.lock"
- ".github/actions/setup-uv-with-retries/**"

View file

@ -24,10 +24,10 @@ on:
- "litellm/llms/base_llm/ocr/**"
- "litellm/llms/custom_httpx/llm_http_handler.py"
- "Makefile"
- ".cargo/**"
- "litellm/rust/.cargo/**"
- "pyproject.toml"
- "uv.lock"
- "rust-toolchain.toml"
- "litellm/rust/rust-toolchain.toml"
- ".github/actions/setup-uv-with-retries/**"
- ".github/scripts/smoke_test_native_wheel.py"
- ".github/scripts/verify_linux_native_wheel.py"
@ -59,10 +59,10 @@ on:
- "litellm/llms/base_llm/ocr/**"
- "litellm/llms/custom_httpx/llm_http_handler.py"
- "Makefile"
- ".cargo/**"
- "litellm/rust/.cargo/**"
- "pyproject.toml"
- "uv.lock"
- "rust-toolchain.toml"
- "litellm/rust/rust-toolchain.toml"
- ".github/actions/setup-uv-with-retries/**"
- ".github/scripts/smoke_test_native_wheel.py"
- ".github/scripts/verify_linux_native_wheel.py"
@ -96,7 +96,9 @@ jobs:
with:
persist-credentials: false
- run: rustup toolchain install --no-self-update
- name: Configure the Rust build environment
working-directory: .
run: bash .github/scripts/setup_rust_environment.sh
- run: cargo fmt --all --check

View file

@ -60,6 +60,10 @@ help:
@echo "slots (default 2; 0 disables) so parallel sessions don't thrash one machine."
UV := uv
export RUSTUP_TOOLCHAIN ?= $(shell sed -n 's/^[[:space:]]*channel[[:space:]]*=[[:space:]]*"\([^"]*\)".*/\1/p' litellm/rust/rust-toolchain.toml)
export CARGO_NET_RETRY ?= 5
export CARGO_HTTP_MULTIPLEXING ?= false
export SQLX_OFFLINE ?= true
UV_RUN := $(UV) run --no-sync
BASE_REF ?=
export BASE_REF

View file

@ -68,6 +68,9 @@ RUN apk add --no-cache \
libsndfile
ENV UV_PROJECT_ENVIRONMENT=/app/.venv \
CARGO_NET_RETRY=5 \
CARGO_HTTP_MULTIPLEXING=false \
SQLX_OFFLINE=true \
UV_LINK_MODE=copy \
UV_PYTHON_DOWNLOADS=0 \
PATH="/app/.venv/bin:${PATH}"

View file

@ -54,8 +54,8 @@ features = ["extension-module"]
profile = "release"
editable-profile = "dev"
include = [
{ path = "rust-toolchain.toml", format = "sdist" },
{ path = ".cargo/config.toml", format = "sdist" },
{ path = "litellm/rust/rust-toolchain.toml", format = "sdist" },
{ path = "litellm/rust/.cargo/config.toml", format = "sdist" },
{ path = "model_prices_and_context_window.json", format = "sdist" },
"litellm/router_strategy/complexity_router/artifacts/*.json",
"litellm/router_strategy/complexity_router/fuse_presets.json",

View file

@ -16,7 +16,7 @@ targets = [{ name = "litellm-gateway", kind = "bin" }]
profile = "release"
editable-profile = "dev"
include = [
{ path = "rust-toolchain.toml", format = "sdist" },
{ path = ".cargo/config.toml", format = "sdist" },
{ path = "litellm/rust/rust-toolchain.toml", format = "sdist" },
{ path = "litellm/rust/.cargo/config.toml", format = "sdist" },
{ path = "model_prices_and_context_window.json", format = "sdist" },
]

View file

@ -339,8 +339,8 @@ features = ["extension-module"]
profile = "release"
editable-profile = "dev"
include = [
{ path = "rust-toolchain.toml", format = "sdist" },
{ path = ".cargo/config.toml", format = "sdist" },
{ path = "litellm/rust/rust-toolchain.toml", format = "sdist" },
{ path = "litellm/rust/.cargo/config.toml", format = "sdist" },
"litellm/integrations/prometheus_helpers/grafana_dashboards/**",
"litellm/proxy/_experimental/out/**",
"litellm/router_strategy/complexity_router/artifacts/*.json",
@ -392,8 +392,8 @@ exclude = [
concurrent-builds = 1
cache-keys = [
{ file = "pyproject.toml" },
{ file = "rust-toolchain.toml" },
{ file = ".cargo/config.toml" },
{ file = "litellm/rust/rust-toolchain.toml" },
{ file = "litellm/rust/.cargo/config.toml" },
{ file = "litellm/rust/Cargo.lock" },
{ file = "litellm/rust/Cargo.toml" },
{ file = "litellm/rust/crates/**/*" },

View file

@ -61,7 +61,7 @@ CI = [".github/workflows/test-unit.yml"]
("mcp-dependencies", DOCS + CLIENT, "skip"),
("windows-release", ["litellm/rust/crates/inference/src/lib.rs"], "run"),
("windows-release", ["litellm/rust_bridge/dispatch.py"], "run"),
("windows-release", ["rust-toolchain.toml"], "run"),
("windows-release", ["litellm/rust/rust-toolchain.toml"], "run"),
("windows-release", ["pyproject.toml"], "run"),
("windows-release", ["uv.lock"], "run"),
("windows-release", ["tests/windows_tests/check_windows_wheel_install.py"], "run"),