{"record":{"id":"778c8c52b869256a","repo":"slint-ui/slint","slug":"version-must-be-specified-for-dependency","errorCode":null,"errorMessage":"Version \"{}\" must be specified for dependency {}","messagePattern":"Version \"(.+?)\" must be specified for dependency (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/src/license_headers_check.rs","lineNumber":1177,"sourceCode":"        let expected_version = format!(\"={expected_version}\");\n\n        for (dep_name, dep) in doc\n            .dependencies(\"dependencies\")\n            .iter()\n            .chain(doc.dependencies(\"build-dependencies\").iter())\n        {\n            if dep_name.starts_with(\"slint\") || dep_name.starts_with(\"i-slint\") {\n                match dep {\n                    CargoDependency::Workspace => (),\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 != &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                    }","sourceCodeStart":1159,"sourceCodeEnd":1195,"githubUrl":"https://github.com/slint-ui/slint/blob/3a7e700487dc74d404cad0726378053ab763d4e0/xtask/src/license_headers_check.rs#L1159-L1195","documentation":"For in-repo `slint*`/`i-slint*` dependencies that do have a `path`, the version string must exactly match the expected version of the current release line (checked against `expected_version` in check_dependencies). A mismatched version would publish crates claiming compatibility with a different slint release than the one in-tree.","triggerScenarios":"Bumping the slint version in one place but not in a crate's Cargo.toml dependency declaration; hand-editing the version string; merging a release branch where the version constant and Cargo.toml files drifted.","commonSituations":"Release preparation (`xtask release`) where one Cargo.toml was missed; cherry-picking a crate from an older branch; adding a dependency by copying the version from docs instead of the current release version.","solutions":["Update the dependency's `version` in Cargo.toml to the expected version reported in the error (e.g. `version = \"=1.8.0\"`).","Run the xtask release/version-bump command so all Cargo.toml files are updated consistently.","Diff against another crate's Cargo.toml that passed the check to copy the correct version string."],"exampleFix":"// before\ni-slint-core = { version = \"=1.7.0\", path = \"../../internal/core\" }\n// after\ni-slint-core = { version = \"=1.8.0\", path = \"../../internal/core\" }","handlingStrategy":"validation","validationCode":"const EXPECTED = '1.8.0';\nconst v = toml.parse(fs.readFileSync('Cargo.toml')).dependencies['i-slint-core'].version;\nif (v !== `=${EXPECTED}`) throw new Error(`version ${v} != =${EXPECTED}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the xtask version-bump command instead of hand-editing versions.","Grep for old version strings across all Cargo.toml files during a release.","Keep dependency version strings identical to the workspace release version."],"tags":["cargo","dependencies","versioning","release"],"backgroundTag":"invalid-config-value","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"}