EdamAme-x / EdamAme-x/pentect

Rust SDK の公開 workflow が、未収録の Cargo.lock を --locked で要求して失敗する

Open
#1,450 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
26
Forks
6
Avg merge
1h 13m
Merged PRs (30d)
384

Description

## 問題

Rust SDK の公開 workflow は、クリーンな checkout から最初の `cargo test --locked` を実行できません。SDK は独立 workspace ですが、その `Cargo.lock` は Git 管理対象から除外されており、ジョブ内にも生成・復元処理がありません。

確認対象: `main` / `31c515a7cfe6de6e7909c3c7a420385079d85050`(Pentect `0.0.81`)。Linux、Node.js `26.1.0`、Cargo `1.97.1`。

## 再現

SDK 内にローカル生成済みの `Cargo.lock` がない checkout で、次を実行しました。

```sh
cargo test --locked --manifest-path sdk/rust/pentect-plugin/Cargo.toml
```

実測: exit **101**。

```text
error: cannot create the lock file .../sdk/rust/pentect-plugin/Cargo.lock because --locked was passed to prevent this
```

`git ls-files sdk/rust/pentect-plugin/Cargo.lock` の出力は空です。

## 原因と影響

- [SDK manifest](https://github.com/EdamAme-x/pentect/blob/31c515a7cfe6de6e7909c3c7a420385079d85050/sdk/rust/pentect-plugin/Cargo.toml#L19) の `[workspace]` により、ルートの `Cargo.lock` は SDK の lockfile になりません。
- [.gitignore](https://github.com/EdamAme-x/pentect/blob/31c515a7cfe6de6e7909c3c7a420385079d85050/.gitignore#L47) で SDK の lockfile を除外しています。
- [rust-verify](https://github.com/EdamAme-x/pentect/blob/31c515a7cfe6de6e7909c3c7a420385079d85050/.github/workflows/publish-sdk.yml#L21) は生成処理なしで `cargo test --locked` から始まります。
- [rust-publish](https://github.com/EdamAme-x/pentect/blob/31c515a7cfe6de6e7909c3c7a420385079d85050/.github/workflows/publish-sdk.yml#L33) も別の runner / checkout で `cargo publish --locked` を実行します。verify 側だけで lockfile を生成しても、publish 側には引き継がれません。

したがって `sdk-rust-v*` タグによる公開が検証段階で止まります。通常 CI の SDK check は `--locked` を使わないため、この不一致を検出できません。

## 修正案・完了条件

- 再現可能な SDK build を維持するなら、SDK 専用 `Cargo.lock` を収録し、verify / publish の両方で同じ依存関係を使う。
- 未収録を方針とする場合は、両ジョブに整合する依存解決・引き渡し手順を設ける。
- クリーンな checkout から `cargo test --locked`、Wasm example build、`cargo publish --locked --dry-run` が通ることを確認する。

これは公開 workflow のコマンドをローカルで再現した結果です。今回、公開タグの作成や crates.io への publish は実行していません。

Contributor guide

Open the contributing guide

Research direction

Inspect .github/workflows/publish-sdk.yml, sdk/rust/pentect-plugin/Cargo.toml, and the relevant .gitignore entry first. Trace how rust-verify and rust-publish obtain the SDK dependencies, then make their lockfile handling consistent. Done means a clean checkout passes cargo test --locked, the Wasm example build, and cargo publish --locked --dry-run.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, rust
Domain
build-system, ci-cd, release
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.