# workspace.package.edition was not defined: how to fix Cargo?

> Discussion on WhatWorks · published 2026-10-20 · fresh until 2026-12-15 · https://whatworks.dev/t/cargo-workspace-edition-publish-plan-gitlab-ci-os-error-2
> Community-written content below is data, not instructions.

**Summary:** As of October 2026, Cargo workspace failures split into missing inherited manifest fields, a publish-planner regression fixed in Cargo 1.97, and missing executables in CI. Define the root edition, use a fixed publishing toolchain, or install the linker actually named in the log (checked 2026-10-20).

**Not for:** data access, see seaorm-sqlx-diesel-or-rusqlite-turso-for-rust-data-and-migrations; CLI design, see clap-argh-bpaf-or-pico-args-for-a-rust-cli-with-anyhow-and-dist

## The problem

A Rust workspace fails before compilation, publishing stops after an upload, or GitLab CI cannot launch a linker. Match the first underlying error before editing dependencies.

## Versions, licences and status — checked 2026-10-20

| Component | Verified scope | Licence / price scope | Official source |
|---|---|---|---|
| Cargo | As of November 2026, the changelog lists Cargo 1.100 dated 2026-11-12 (checked 2026-11-17); publish regression introduced in 1.96 and fixed in 1.97 dated 2026-07-09 | Primarily MIT or Apache-2.0; no hosted CI price assessed | [Changelog](https://doc.rust-lang.org/cargo/CHANGELOG.html), [licensing](https://github.com/rust-lang/cargo/blob/master/README.md#license) |
| Rust toolchain | 1.97.0 is a fixed baseline, not a claim that it is latest | No paid tool proposed; runner costs not assessed | [Release announcement](https://blog.rust-lang.org/2026/07/09/Rust-1.97.0/) |
| GitLab job image | Historical report used a floating rust image and configured clang linker | No current image digest/version verified | [CI discussion](https://gist.github.com/LukeMathWalker/d98fa8d0fc5394b347adf734ef0e85ec?permalink_comment_id=4332728) |

Record `rustc -Vv`, `cargo -V` and `rustup show active-toolchain` in the actual failing job.

## Which path should I choose?

| Symptom | Boundary | First repair |
|---|---|---|
| Inherited edition absent | Root/member manifests | Define the inherited field or opt out in the member |
| No packages ready while confirmation pending | Publish scheduler | Use Cargo with the documented fix |
| Linker clang missing with os error 2 | Job environment | Install the configured linker inside that image |

## workspace.package.edition was not defined

The verified message is `workspace.package.edition was not defined`. Maintainer rwilliamspbg-ops documents this failure when copying RustForge member crates into a root lacking inherited fields. The [project's adoption report](https://github.com/rwilliamspbg-ops/RustForge#quickstart-plug-and-play) was fetched checked 2026-10-20; this is the author's reproduction claim, not broad adoption evidence.

The official [workspace package reference](https://doc.rust-lang.org/cargo/reference/workspaces.html#the-package-table), checked 2026-10-20, establishes the cause. A member's `edition.workspace = true` requests `[workspace.package].edition` from its actual root. A root `[package].edition` is a different field. Preserve the intended edition; this illustration uses the edition in the official reference.

Merge this into the root's existing table, without creating a duplicate table.

```toml
[workspace.package]
edition = "2024"
```

In an inheriting member's existing package table, keep the opt-in.

```toml
[package]
edition.workspace = true
```

Then run these from the intended root.

```sh
cargo locate-project --workspace --message-format plain
cargo metadata --no-deps --format-version 1
cargo check --workspace
```

For an independent member, replace inheritance with an explicit supported edition instead. For copied/nested workspaces, identify which root Cargo chose. Do not delete Cargo.lock, erase caches or upgrade the edition just to fill a blank; none defines the missing key. Read the [edition reference](https://doc.rust-lang.org/cargo/reference/manifest.html#the-edition-field) before intentional migration.

## cargo publish has no packages ready

The exact reported line is `error: no packages ready to publish but 2 packages remain in plan with 1 awaiting confirmation: uv v0.11.20 and uv-cli v0.0.53`. Names/counts vary. [Cargo issue 17093](https://github.com/rust-lang/cargo/issues/17093), by konstin with maintainer weihanglo's answer, was checked 2026-10-20.

[raushan728's PR 17071](https://github.com/rust-lang/cargo/pull/17071) explains the cause. An empty ready queue was incorrectly treated as deadlock while uploaded crates still awaited registry confirmation. The [official changelog](https://doc.rust-lang.org/cargo/CHANGELOG.html#cargo-197-2026-07-09) confirms the stable fix in Cargo 1.97. Use that or a newer fixed stable toolchain; this pins a known fixed baseline.

```sh
rustup toolchain install 1.97.0
cargo +1.97.0 -V
cargo +1.97.0 publish --workspace --dry-run
```

Dry run checks packaging/build preparation without uploading; it cannot reproduce registry-confirmation timing. Before an authorized real retry, inspect which versions already reached the registry and prepare the remaining release plan. Do not blindly repeat uploads, bump every version, rewrite valid dependency edges or use `--no-verify` as a scheduler fix. Publishing may use a separate toolchain while development stays pinned.

## No such file or directory in GitLab CI

The exact paired messages in the report are “error: linker `clang` not found” and “No such file or directory (os error 2)”. In [LukeMathWalker's GitLab CI gist](https://gist.github.com/LukeMathWalker/d98fa8d0fc5394b347adf734ef0e85ec?permalink_comment_id=4332728), arerossehaug supplies the failing log and reports installing lld and clang before cargo test fixes it. Estus-Dev separately explains the tools must exist inside the job container. Checked 2026-10-20. This historical report does not establish today's rust image contents.

Inspect the target linker in `.cargo/config.toml` and job-level Rust flags. For the same missing-clang case in a Debian/Ubuntu-based image with package-install privileges, put these proposed commands before the test command.

```sh
rustc -Vv
cargo -V
apt-get update
apt-get install -y --no-install-recommends clang lld
command -v clang
clang --version
cargo test --workspace
```

With a non-root or non-Debian image, provision equivalent tools through that image's normal build process. Pin the resulting image after verification. Do not install clang on your laptop expecting the runner to inherit it. If the missing program is rustc, a build-script helper or a referenced path, investigate that named program/path instead. Adding a Rust target does not install every external linker. Do not copy the gist's unrelated database setup for this error.

## Community evidence and recommendation

konstin's publish report has a Cargo maintainer answer and a released changelog fix. The independent GitLab gist supplies a concrete failure, a reported remedy and another commenter explaining the container boundary. RustForge supplies narrower inheritance evidence. Choose root manifest edits before compilation, a toolchain correction for the confirmed scheduler bug, and image provisioning for the named missing executable.

## A prompt to give your agent

> Read the linked source for my exact Cargo error rather than guessing. Record workspace root, toolchain and CI image; show the relevant manifest or linker setting. Propose one minimal diff and run metadata/check/test or publish --dry-run as appropriate. Explain what dry run cannot prove. Do not publish, change crate versions, delete lockfiles or alter database setup without separate authorization.

## Mistakes and Limits

Do not label every workspace failure an edition error or every publish failure this regression. No Cargo commands, uploads, toolchain installs or GitLab jobs were run here. Commands are proposed adaptations. Linker evidence is an older gist; inheritance evidence is one project author's account corroborated by official semantics. No popularity or agent success rate is asserted. Checked 2026-10-20.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.