{"record":{"id":"7dabc9623b53fece","repo":"slint-ui/slint","slug":"points-to-expected","errorCode":null,"errorMessage":"{:?} points to {:?}, expected {:?}","messagePattern":"(.+?) points to (.+?), expected (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/src/license_headers_check.rs","lineNumber":1126,"sourceCode":"\n            if let Ok(meta) = std::fs::symlink_metadata(&symlink_path) {\n                if !meta.file_type().is_symlink() {\n                    return Err(anyhow!(\"{:?} exists but is not a symlink\", symlink_path));\n                }\n                let target = std::fs::read_link(&symlink_path)\n                    .context(\"Cannot read LICENSE symlink target\")?;\n                if target == expected_target {\n                    continue;\n                }\n                if self.fix_it {\n                    eprintln!(\n                        \"Fixing up {:?} as instructed. Symlink points to wrong target.\",\n                        symlink_path\n                    );\n                    std::fs::remove_file(&symlink_path)\n                        .context(\"Failed to remove incorrect symlink\")?;\n                } else {\n                    return Err(anyhow!(\n                        \"{:?} points to {:?}, expected {:?}\",\n                        symlink_path,\n                        target,\n                        expected_target\n                    ));\n                }\n            }\n\n            if self.fix_it {\n                eprintln!(\n                    \"Fixing up {:?} as instructed. Creating symlink -> {:?}.\",\n                    symlink_path, expected_target\n                );\n                #[cfg(unix)]\n                std::os::unix::fs::symlink(&expected_target, &symlink_path)\n                    .context(\"Failed to create LICENSE symlink\")?;\n                #[cfg(windows)]\n                std::os::windows::fs::symlink_file(&expected_target, &symlink_path)","sourceCodeStart":1108,"sourceCodeEnd":1144,"githubUrl":"https://github.com/slint-ui/slint/blob/3a7e700487dc74d404cad0726378053ab763d4e0/xtask/src/license_headers_check.rs#L1108-L1144","documentation":"The xtask license-header check found an existing LICENSE symlink in a crate directory whose target does not match the expected shared LICENSE file. Slint keeps a single top-level LICENSE file and symlinks it into every crate directory; a divergent symlink means the crate would ship a different (or stale) license than the rest of the repository. The check aborts so the wrong link is not silently rewritten without the `--fix` instruction that would have allowed removal and recreation.","triggerScenarios":"Running `cargo xtask` tasks that invoke check_cargo_toml -> check_licenses_dir when a crate's LICENSE symlink already exists but resolves to a path other than the expected relative target (e.g. `../../LICENSE`), typically after reorganizing directories or recreating the link manually with the wrong path.","commonSituations":"Moving/renaming a crate without updating its symlink; manually recreating the symlink by absolute path instead of the expected relative path; OS or tooling that copies files instead of preserving symlinks (e.g. on Windows or via some archive extraction); merge conflicts resolved by re-pointing the link incorrectly.","solutions":["Remove the incorrect symlink and recreate it pointing at the expected relative target (e.g. `ln -sfn ../../LICENSE <crate>/LICENSE`).","Re-run the xtask task with the fix-up instruction so the tool removes and recreates the symlink automatically (the code path above removes wrong symlinks when fixing is enabled).","Verify no tooling (editor, package manager, CI checkout) is converting symlinks into regular files or absolute links, then restore the relative symlink."],"exampleFix":"// before (wrong target)\n$ ls -l crates/foo/LICENSE\nLICENSE -> /abs/path/slint/LICENSE\n// after\n$ rm crates/foo/LICENSE && ln -s ../../LICENSE crates/foo/LICENSE","handlingStrategy":"validation","validationCode":"const target = fs.readlinkSync('crates/foo/LICENSE');\nif (target !== '../../LICENSE') throw new Error(`bad LICENSE target: ${target}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Recreate symlinks only with relative targets committed via git.","Run the xtask check locally before pushing.","Beware tooling (zip extraction, Windows checkouts) that breaks symlinks."],"tags":["licensing","symlink","ci","build-tooling"],"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"}