{"record":{"id":"07ac36e531dca4e9","repo":"slint-ui/slint","slug":"is-not-a-directory","errorCode":null,"errorMessage":"\"{}\" is not a directory","messagePattern":"\"(.+?)\" is not a directory","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/src/reuse_compliance_check.rs","lineNumber":139,"sourceCode":"                break;\n            }\n        }\n    }\n}\n\nfn is_symlink(path: &Path) -> bool {\n    std::fs::symlink_metadata(path).is_ok_and(|m| m.file_type().is_symlink())\n}\n\nfn validate_license_directory(dir: &Path, licenses: &[String], fix_it: bool) -> Result<()> {\n    let top_dir =\n        PathBuf::from(\".\").canonicalize().context(\"Failed to canonicalize the top directory\")?;\n    let lic_dir = dir.join(\"LICENSES\").canonicalize().with_context(|| {\n        format!(\"Failed to canonicalize \\\"{}\\\"\", dir.join(\"LICENSES\").to_string_lossy())\n    })?;\n\n    if !lic_dir.is_dir() {\n        anyhow::bail!(\"\\\"{}\\\" is not a directory\", lic_dir.to_string_lossy());\n    }\n\n    let mut linked_licenses = Vec::new();\n    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 {","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/slint-ui/slint/blob/bb937076de3f7919766c1f25e2e969367cf77e9a/xtask/src/reuse_compliance_check.rs#L121-L157","documentation":"The xtask license-directory validator canonicalizes the repo's `LICENSES` directory and bails if the resulting path is not a directory. This catches a missing or wrongly-typed LICENSES location (e.g. a symlink or file standing in for it) before scanning license symlinks.","triggerScenarios":"Running `validate_license_directory` (via scan_symlinks) in a checkout where `LICENSES/` is absent, is a regular file instead of a directory, or where canonicalization resolved a symlink to a non-directory target.","commonSituations":"Shallow/partial clones or archives that dropped the LICENSES directory; a broken symlink replacing LICENSES; running xtask from a workspace without the REUSE layout (or wrong working directory).","solutions":["Ensure the repository contains a LICENSES directory at its root containing the license text files","Fix or recreate the LICENSES entry if it is a dangling symlink or a regular file","Run xtask from the repository root so the LICENSES path resolves correctly"],"exampleFix":"// before\nLICENSES -> /nonexistent/target   (dangling symlink)\n// after\nLICENSES/  (real directory containing MIT.txt, GPL-3.0-only.txt, ...)","handlingStrategy":"validation","validationCode":"test -d LICENSES || echo \"LICENSES directory missing; restore it before running xtask\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always clone the full repository (avoid archive exports that drop directories)","Verify git symlinks were materialized correctly on Windows clones","Run xtask from the repo root"],"tags":["license","filesystem","xtask"],"backgroundTag":"path-is-not-a-directory","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"}