Skip to content

#530 [deps] serde_yaml 0.9 を yaml_serde 0.10.7 へ移行し、RUSTSEC-2024-0449 の一時除外を外す - #664

Merged
Kewton merged 1 commit into
developfrom
feature/issue-530-deps-serde-yaml-0-9-yaml-crate
Oct 12, 2026
Merged

Kewton merged 1 commit into
developfrom
feature/issue-530-deps-serde-yaml-0-9-yaml-crate

Conversation

@Kewton

@Kewton Kewton commented Oct 12, 2026

Copy link
Copy Markdown
Owner

概要

保守されていない YAML parser(serde_yaml 0.9 → unsafe-libyaml 0.2.11、RUSTSEC-2024-0449)を、YAML 組織が保守する yaml_serde 0.10.7(libyaml-rs 0.3.0)へ移します。依存名を serde_yaml のまま package rename で入れるので、src/ は変えていません。PR #663 で入れた一時的な advisory の除外を、この PR で外します。

Refs #530

変更(6 ファイル、+550 −28、1 commit)

  • Cargo.toml:serde_yaml = { package = "yaml_serde", version = "0.10.7" }。依存名は serde_yaml のままです。
  • Cargo.lock:差は次の 4 つだけです。
    • 削除:serde_yaml 0.9.34+deprecated、unsafe-libyaml 0.2.11
    • 追加:yaml_serde 0.10.7、libyaml-rs 0.3.0
    • cargo update で一緒に上がった windows-sys は戻しました。
  • deny.toml:RUSTSEC-2024-0449 の一時除外とその説明を外し、ignore = [] にしました。ほかの監査の設定とライセンスの許可は変えていません。
  • 試験:tests/issue530_yaml_migration.rs(新規、5 本)と corpus tests/corpus/apps/issue530-yaml-migration/(expectations.toml・fixtures/compatibility.json)。旧版で測った結果を期待値に記録し、公開 API で確かめます。
    • pack の受理と拒否(unknown field、duplicate key、tag、anchor/alias、merge、多文書、非文字列 key)
    • plan の診断の行・列、workflow の version の数値
    • scrub の型・要素数・key collision、サイズ・深さ・配列・スカラーの上限
  • 旧 serde_yaml は dev-dependency にも残していません。既存の YAML fixture と証跡は変えていません。成長上限のファイルと baseline も変えていません。
  • src/ の中の serde_yaml の参照は、base f1c42074 で 16 ファイル・140 行です。rename なので、どれも変更は要りません。

検証(HEAD b0b20197)

  • 15 ゲート:commandmate verify で 15/15 passed でした(fmt、clippy、cargo test --all-targets、CI の形の ruff、tests/eval、npm ci などを含みます)。
  • cargo deny check(除外なし):exit 0。advisories・bans・licenses・sources の 4 つとも ok です。
  • Linux の確認:cargo-zigbuild clippy --all-targets --target x86_64-unknown-linux-gnu は exit 0 でした。
  • 二点測定
    • develop f1c42074 の deny.toml から除外だけを外すと、cargo deny check advisories が RUSTSEC-2024-0449 で落ちます(exit 1)。この PR の HEAD では、除外なしで通ります。
    • 互換の試験は、旧版(develop)の上でもすべて通ります(5 本、corpus の回帰 7 本)。旧版との差は 0 なので、これは想定どおりです。
    • そこで検出力を確かめました。旧版で測った期待値を 1 つずつ変えると、4 通りとも試験が落ちます(plan の診断の行番号、tag-rejected の受理、scrub の mapping の要素数、duplicate key の診断の列番号)。
  • MSRV:本体の rust-version = "1.88" に対し、yaml_serde 0.10.7 の rust-version は 1.82 です。

確かめてほしい点

  • 実際の Rust 1.88 での build と、gui feature での build は手元で流していません(15 ゲートは既定の feature で、toolchain は stable)。
  • libyaml-rs は、archived の unsafe-libyaml を YAML 組織が引き継いだ unsafe Rust の fork です。safe Rust の parser への置き換えではありません(Issue 本文の「移行先と理由」のとおりです)。

🤖 Generated with Claude Code

Replace the unmaintained serde_yaml 0.9 (unsafe-libyaml, RUSTSEC-2024-0449)
with yaml_serde 0.10.7 (libyaml-rs) while keeping the dependency name
`serde_yaml`, so no production source changes. Remove the temporary
RUSTSEC-2024-0449 advisory exclusion now that the crate is gone.

Add the issue530-yaml-migration corpus (expectations.toml +
fixtures/compatibility.json) and tests/issue530_yaml_migration.rs, which
drive the public API over the pre-migration measurements: pack parser/schema
accept-reject parity (unknown field, duplicate key, tag, anchor/alias, merge,
multi-document, non-string key), plan diagnostics with line/column, workflow
version numeric values, scrub type/element-count/key-collision, and the size,
depth, sequence, and scalar limits.

計測: base f1c4207 の src/ の serde_yaml 参照は 16 ファイル・140 行・
149 token で、Issue #530 の H-24 調査と一致する。
判断: keep `version = "0.10.7"` as the Issue wrote and pin the resolved
version with Cargo.lock.
判断: revert an incidental windows-sys bump that `cargo update -p serde_yaml`
introduced for is_executable; the lock diff stays limited to removing
serde_yaml/unsafe-libyaml and adding yaml_serde/libyaml-rs.
読み替え: register the corpus case as a non-Next.js directory (like
issue513), so the generic corpus discovery picks up expectations.toml and
fixture_contains.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
@Kewton
Kewton merged commit 6b264fa into develop Oct 12, 2026
5 checks passed
@Kewton
Kewton deleted the feature/issue-530-deps-serde-yaml-0-9-yaml-crate branch October 12, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant