{"record":{"id":"40ae253d7bb5397a","repo":"slint-ui/slint","slug":"is-a-not-a-symlink","errorCode":null,"errorMessage":"\"{}\" is a not a symlink!","messagePattern":"\"(.+?)\" is a not a symlink!","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/src/reuse_compliance_check.rs","lineNumber":161,"sourceCode":"    let mut to_add = Vec::new();\n    let mut to_remove = Vec::new();\n\n    for d in lic_dir\n        .read_dir()\n        .with_context(|| format!(\"Failed to read \\\"{}\\\" directory\", lic_dir.to_string_lossy()))?\n    {\n        let child = d\n            .with_context(|| {\n                format!(\"Failed to read in LICENSES directory \\\"{}\\\"\", lic_dir.to_string_lossy())\n            })?\n            .path();\n\n        if !is_symlink(&child) {\n            if child.is_file() && fix_it {\n                to_remove.push(child.clone());\n                continue;\n            } else {\n                anyhow::bail!(\"\\\"{}\\\" is a not a symlink!\", child.to_string_lossy());\n            }\n        }\n\n        let ext = child.extension().unwrap_or_default();\n        let file_stem = child.file_stem().unwrap_or_default().to_string_lossy().to_string();\n\n        if ext.is_empty() || (ext != \"txt\" && ext != \"md\" && ext != \"html\") {\n            anyhow::bail!(\"Invalid extension for LICENSE symlink \\\"{}\\\"\", child.to_string_lossy());\n        }\n\n        if file_stem.is_empty() || !licenses.contains(&file_stem) {\n            if !fix_it {\n                anyhow::bail!(\"LICENSE symlink \\\"{}\\\" is not necessary\", child.to_string_lossy());\n            } else {\n                to_remove.push(child.clone());\n                continue;\n            }\n        } else {","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/slint-ui/slint/blob/bb937076de3f7919766c1f25e2e969367cf77e9a/xtask/src/reuse_compliance_check.rs#L143-L179","documentation":"The xtask REUSE compliance check requires every entry of a subdirectory's LICENSES folder to be a symlink pointing at the repository's top-level LICENSES files. This bail fires in validate_license_directory when a directory entry is neither a symlink nor (in fix mode) a removable regular file. It aborts the scan because non-symlink entries would defeat the license-mirroring scheme.","triggerScenarios":"Running `cargo xtask reuse-compliance-check` (scan_symlinks → validate_license_directory) when a LICENSES/ subdirectory contains a regular file or another directory, or a regular file exists and --fix-symlinks was not passed.","commonSituations":"A developer copied a real LICENSE file into a package's LICENSES/ dir instead of creating a symlink; a build step materialized symlinks into regular files (e.g. zip/tar extraction on Windows or CI without symlink support); a stray directory was created in LICENSES/.","solutions":["Replace the regular file in the sub-LICENSES/ directory with a relative symlink to the corresponding file in the top-level LICENSES/ directory, e.g. `ln -sf ../../../LICENSES/Apache-2.0.txt Apache-2.0.txt`","Re-run with `cargo xtask reuse-compliance-check --fix-symlinks` so regular files are removed and correct symlinks are recreated","Check how the repo was checked out/archived; ensure symlinks are preserved (git config core.symlinks true; avoid zip archives)"],"exampleFix":"// before\npackage/LICENSES/Apache-2.0.txt   (regular copy of the license)\n// after\nln -sf ../../../LICENSES/Apache-2.0.txt package/LICENSES/Apache-2.0.txt","handlingStrategy":"validation","validationCode":"let bad: Vec<_> = std::fs::read_dir(\"path/to/LICENSES\")?.filter_map(|e| e.ok()).map(|e| e.path()).filter(|p| !is_symlink(p)).collect();\nif !bad.is_empty() { eprintln!(\"non-symlinks: {:?}\", bad); }","typeGuard":"fn is_symlink(path: &std::path::Path) -> bool {\n    std::fs::symlink_metadata(path).map(|m| m.file_type().is_symlink()).unwrap_or(false)\n}","tryCatchPattern":"match validate_result {\n    Err(e) if e.to_string().contains(\"is a not a symlink\") => {\n        // re-run with --fix-symlinks or fix the entry manually\n    }\n    Err(e) => return Err(e),\n    Ok(()) => {}\n}","preventionTips":["Never copy license files into sub-LICENSES/ dirs; always symlink to the top-level LICENSES/ file","Ensure git and CI archives preserve symlinks (core.symlinks=true on Windows, avoid zip artifacts)","Run the check with --fix-symlinks after bulk refactors"],"tags":["reuse","symlink","licensing","filesystem"],"backgroundTag":"invalid-argument-value","analyzedSha":"bb937076de3f7919766c1f25e2e969367cf77e9a","analyzedAt":"2026-09-16T01:37:20.251Z","contentChangedAt":"2026-09-16T01:37:20.251Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}