slint-ui/slint · error
dev-dependencies cannot be from the workspace because…
Error message
dev-dependencies cannot be from the workspace because version must be empty {dep_name} What it means
dev-dependencies on slint/i-slint packages must not use `workspace = true` inheritance because the check requires dev-dependency declarations to carry an explicit (empty-of-workspace) version field; workspace-inherited dev-dependencies lose the explicit version the publish pipeline needs. check_dependencies rejects `CargoDependency::Workspace` for any slint/i-slint entry under `[dev-dependencies]`.
Solutions
- Replace workspace inheritance with an explicit path + version entry, e.g. `slint = { version = "=1.8.0", path = "../../api/rs/slint" }` under `[dev-dependencies]`.
- If the dependency is only used by tests, consider pointing at the test-driver or interpreter crate with an explicit version instead.
- Check the workspace root `[workspace.dependencies]` convention for how slint dev-dependencies are expected to be spelled.
Example fix
// before
[dev-dependencies]
slint = { workspace = true }
// after
[dev-dependencies]
slint = { version = "=1.8.0", path = "../../api/rs/slint" } Defensive patterns
Strategy: validation
Validate before calling
const devDeps = toml.parse(fs.readFileSync('Cargo.toml'))['dev-dependencies'] ?? {};
for (const [n, d] of Object.entries(devDeps)) {
if ((n.startsWith('slint') || n.startsWith('i-slint')) && d?.workspace) {
throw new Error(`${n} dev-dependency must not use workspace inheritance`);
}
} Prevention
- Apply workspace inheritance only to [dependencies], not [dev-dependencies] for slint crates.
- Review cargo-add / IDE-inserted `workspace = true` entries.
- Check the workspace root conventions before refactoring dependency declarations.
When it happens
Trigger: Writing `slint = { workspace = true }` under `[dev-dependencies]` in a crate's Cargo.toml and running the xtask Cargo.toml/license checks; converting a normal dependency to workspace inheritance without noticing the dev-dependency rule.
Common situations: Refactoring many Cargo.toml files to workspace dependency inheritance and applying it uniformly, including dev-dependencies; an IDE or cargo-add auto-inserting workspace inheritance.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- cargo failed
- Incorrect . Found expected
- Invalid Cargo.toml -- cannot find workspace package section…
- Missing description field
- Missing field
AI-assisted analysis of slint-ui/slint@3a7e700487 (2026-09-16).
Data as JSON: /api/errors/a59e14cf07cdc5ee.
Report an issue: GitHub.
Appendix: source
Thrown at xtask/src/license_headers_check.rs:1192
));
}
if version != &expected_version {
return Err(anyhow!(
"Version \"{}\" must be specified for dependency {}",
expected_version,
dep_name
));
}
}
}
}
}
for (dep_name, dep) in doc.dependencies("dev-dependencies").iter() {
if dep_name.starts_with("slint") || dep_name.starts_with("i-slint") {
match dep {
CargoDependency::Workspace => {
return Err(anyhow!(
"dev-dependencies cannot be from the workspace because version must be empty {dep_name}"
));
}
CargoDependency::Full { path, version } => {
if path.is_empty() {
return Err(anyhow!(
"slint package '{}' outside of the repository?",
dep_name
));
}
if !version.is_empty() {
return Err(anyhow!(
"dev-dependencies version must be empty for dependency {dep_name}"
));
}
}
}
}View on GitHub (pinned to 3a7e700487)