{"record":{"id":"a59e14cf07cdc5ee","repo":"slint-ui/slint","slug":"dev-dependencies-cannot-be-from-the-workspace-because","errorCode":null,"errorMessage":"dev-dependencies cannot be from the workspace because version must be empty {dep_name}","messagePattern":"dev-dependencies cannot be from the workspace because version must be empty (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/src/license_headers_check.rs","lineNumber":1192,"sourceCode":"                            ));\n                        }\n                        if version != &expected_version {\n                            return Err(anyhow!(\n                                \"Version \\\"{}\\\" must be specified for dependency {}\",\n                                expected_version,\n                                dep_name\n                            ));\n                        }\n                    }\n                }\n            }\n        }\n\n        for (dep_name, dep) in doc.dependencies(\"dev-dependencies\").iter() {\n            if dep_name.starts_with(\"slint\") || dep_name.starts_with(\"i-slint\") {\n                match dep {\n                    CargoDependency::Workspace => {\n                        return Err(anyhow!(\n                            \"dev-dependencies cannot be from the workspace because version must be empty {dep_name}\"\n                        ));\n                    }\n                    CargoDependency::Full { path, version } => {\n                        if path.is_empty() {\n                            return Err(anyhow!(\n                                \"slint package '{}' outside of the repository?\",\n                                dep_name\n                            ));\n                        }\n                        if !version.is_empty() {\n                            return Err(anyhow!(\n                                \"dev-dependencies version must be empty for dependency {dep_name}\"\n                            ));\n                        }\n                    }\n                }\n            }","sourceCodeStart":1174,"sourceCodeEnd":1210,"githubUrl":"https://github.com/slint-ui/slint/blob/3a7e700487dc74d404cad0726378053ab763d4e0/xtask/src/license_headers_check.rs#L1174-L1210","documentation":"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]`.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\n[dev-dependencies]\nslint = { workspace = true }\n// after\n[dev-dependencies]\nslint = { version = \"=1.8.0\", path = \"../../api/rs/slint\" }","handlingStrategy":"validation","validationCode":"const devDeps = toml.parse(fs.readFileSync('Cargo.toml'))['dev-dependencies'] ?? {};\nfor (const [n, d] of Object.entries(devDeps)) {\n  if ((n.startsWith('slint') || n.startsWith('i-slint')) && d?.workspace) {\n    throw new Error(`${n} dev-dependency must not use workspace inheritance`);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["cargo","dev-dependencies","workspace","ci"],"backgroundTag":"unsupported-operation","analyzedSha":"3a7e700487dc74d404cad0726378053ab763d4e0","analyzedAt":"2026-09-16T01:37:20.251Z","contentChangedAt":"2026-09-16T01:37:20.251Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}