fix(gateway): make sgl-model-gateway a cargo workspace so maturin 1.14 accepts the parent README#27997
Merged
hnyls2002 merged 1 commit intoJun 12, 2026
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Collaborator
Author
|
/tag-run-ci-label |
Collaborator
Author
|
/tag-and-rerun-ci |
Collaborator
Author
|
Very strange issue... |
dougyster
approved these changes
Jun 12, 2026
5fa37be to
43a1ed4
Compare
43a1ed4 to
60ef806
Compare
maturin 1.14 (PyO3/maturin#3182, "Support parent-relative pyproject metadata in sdists") bounds a parent-relative `project.readme` to the cargo workspace root. sgl-model-gateway has no [workspace], so cargo metadata reports each crate's own directory as the workspace root and the python bindings' `readme = "../../README.md"` is rejected: `project.readme` path `../../README.md` resolves outside allowed metadata root `/build/sgl-model-gateway/bindings/python` This breaks every `maturin build` run from bindings/python (the dev, gateway and rocm docker images, pr-test-rust, and the PyPI release). Declare sgl-model-gateway as the workspace root with bindings/python as a member; the golang bindings and wasm examples stay standalone via `exclude`. The workspace root now contains README.md, so the existing parent-relative readme resolves inside the allowed root with no change to which README ships on PyPI. Build profiles already live at the workspace root, so the duplicate [profile.ci] in bindings/python is dropped (workspace members' profile tables are ignored by cargo). Joining the workspace also brings bindings/python/src/lib.rs under the gateway rustfmt config, so apply `cargo +nightly fmt` to it.
60ef806 to
a68f5b8
Compare
dougyster
approved these changes
Jun 12, 2026
laixinn
pushed a commit
to laixinn/sglang
that referenced
this pull request
Jun 15, 2026
…4 accepts the parent README (sgl-project#27997)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The dev docker image build recently started failing on both
build-x86andbuild-arm64:Root cause: maturin 1.14.0 added PyO3/maturin#3182 "Support parent-relative pyproject metadata in sdists", which bounds a parent-relative
project.readmeto the cargo workspace root (seeproject_layout.rs:allowed_metadata_root = if pyproject_dir.starts_with(workspace_root) { workspace_root } else { pyproject_dir }). The Dockerfiles install maturin unpinned, so they picked up 1.14.0.sgl-model-gatewayhas no[workspace]— the root crate andbindings/pythonare independent packages — socargo metadatareports each crate's own directory as its workspace root.bindings/python/pyproject.tomlthen hasreadme = "../../README.md", which resolves tosgl-model-gateway/README.md, outsidebindings/python/, and maturin rejects it.Because that
pyproject.tomlis shared by every maturin build path, this is not limited to the dev image — it also affectsdocker/gateway.Dockerfile,docker/rocm.Dockerfile,.github/workflows/pr-test-rust.yml, the PyPI release, andsgl-model-gateway/Makefile.Modification
Declare
sgl-model-gatewayas the cargo workspace root withbindings/pythonas a member (the golang bindings and wasm examples stay standalone viaexclude):Now
cargo metadatafrombindings/pythonreportssgl-model-gateway/as the workspace root, which containsREADME.md, so the existingreadme = "../../README.md"resolves inside the allowed metadata root. This is exactly the layout maturin #3182 is designed for.readmefield is untouched, still the repo-root gateway README.release/ci/dev) already exist at the workspace root, so the now-redundant[profile.ci]inbindings/python/Cargo.toml(byte-identical to the root one) is dropped — cargo ignores profile tables in workspace members anyway.Why the
lib.rsformatting changes?bindings/pythonwas previously its own standalone crate, so therustfmt sgl-model-gatewaypre-commit hook (cd sgl-model-gateway && cargo +nightly fmt -- --check) never reachedbindings/python/src/lib.rs. Making it a workspace member brings it under the gateway'srustfmt.toml(group_imports = "StdExternalCrate",imports_granularity = "Crate") for the first time, which is what the Lint job flagged. Thelib.rschange is purely that one-timecargo +nightly fmtnormalization (import grouping + chain/struct wrapping) — no logic change.Checklist
[profile.ci](used bypr-test-rust.yml --profile ci) is preserved at the workspace root, identical to the dropped member copy.Testing: https://github.com/sgl-project/sglang/actions/runs/27394688617/job/80959410404
CI States
Latest PR Test (Base): ✅ Run #27395362207
Latest PR Test (Extra): ❌ Run #27395362141