Repository navigation
fix: Cargo.lock差し戻しでyank済み版を再採用しない - #11
Merged
Merged
Conversation
install前のlockにあった版を無条件で下限や戻し先に使っていたため、 レジストリの候補から除外されたyank済み版が再採用されていた。 利用可能な版情報で下限を検証し、個別の差し戻しとまとめ解きへ共通で反映する。 互換系列の有効な候補がなければ未解消として報告する。 Cargoのprecise指定でもyank済み版を復活させない。 実物のCargoを使うオフライン回帰テスト3件と、下限・互換系列の検証3件を追加する。
install前の版も利用可能な版情報に含まれる場合だけ下限や戻し先に使う。 有効な候補がない場合の報告と、利用可能な旧版へ戻す既存仕様を 英語・日本語の利用文書と開発指針に反映する。 新規依存も同じsemver系列の候補だけを選ぶ。
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
概要
Rust依存の経過期間による差し戻しで、install前のCargo.lockにあったyank済み版を再採用していました。例えば、0.8.4がage未満、0.8.3がyank済み、0.8.2が利用可能な場合に、0.8.3へ戻っていました。
利用可能な同じsemver系列の版だけを下限や戻し先に使い、この例では0.8.2へ戻します。有効な候補がない場合は未解消として報告します。
原因
crates.ioアダプターはyank済み版を候補一覧から除外していますが、差し戻しの下限はinstall前のlockだけから決めていました。候補が下限より古い場合の復元処理で、除外された版を再び選んでいました。まとめ解きの最小版にも同じ下限が残っていました。
Cargoの
update --preciseはyank済み版も選べるため、Cargoコマンドの成功だけでは防げません。Cargo公式ドキュメント変更内容
Claudeとの設計相談で、アダプターが持つ候補除外を使う案と互換系列のガードを採用しました。
VersionInfoへのフラグ追加は不要です。旧版が複数ある場合は利用可能性を検査してから最大を選び、残った有効な下限を維持します。現在版の情報がキャッシュにない場合の再取得と未検証報告は既存処理で対応しています。最終レビューで指摘された新規依存の互換系列テストと文書の説明を追加しました。公開日不明の版もアダプターの一覧から外れるため、yank済みと区別できない版を再採用せず、利用可能性を検証できる候補へ限定します。キャッシュは1回の実行内のメモリだけで、永続キャッシュによる古いyank情報はありません。
検証
make ci: フォーマット、Clippy、全2,485テストが成功しました。astro-sight reviewとimpact: 呼び出し元の修正漏れなし。Closes #10