slint-ui/slint · error

Missing LICENSE symlink

Error message

Missing LICENSE symlink {:?} -> {:?}

What it means

The license-header check expects every crate directory to contain a LICENSE symlink pointing at the repository's shared LICENSE file. When the symlink (or the checked symlink target) is absent and the check is not running in fix-up mode, it errors instead of silently creating files. This guarantees every published crate ships the correct license text.

Solutions

  1. Create the missing symlink with the expected relative target: `ln -s ../../LICENSE <crate-dir>/LICENSE`.
  2. Run the xtask task in fix-up mode so it creates the symlink automatically (`std::os::unix::fs::symlink` path above).
  3. On Windows, enable Developer Mode / git `core.symlinks=true` and re-checkout so symlinks materialize, then re-run the check.

Example fix

// before
crates/foo/   # no LICENSE
// after
$ ln -s ../../LICENSE crates/foo/LICENSE
Defensive patterns

Strategy: validation

Validate before calling

if (!fs.lstatSync('crates/foo/LICENSE', { throwIfNoEntry: false })?.isSymbolicLink()) {
  throw new Error('LICENSE symlink missing');
}

Prevention

When it happens

Trigger: Adding a new crate directory without creating the LICENSE symlink; accidentally deleting the symlink; running the check on a checkout where symlinks were not materialized (e.g. git `core.symlinks=false` on Windows).

Common situations: Bootstrapping a new crate and forgetting the link; Windows checkouts without symlink support or developer mode enabled; CI containers checking out the repo with symlinks disabled; a `git clean -fd` that removed links.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of slint-ui/slint@3a7e700487 (2026-09-16). Data as JSON: /api/errors/d9aa519ac14e682f. Report an issue: GitHub.

Appendix: source

Thrown at xtask/src/license_headers_check.rs:1147

                        target,
                        expected_target
                    ));
                }
            }

            if self.fix_it {
                eprintln!(
                    "Fixing up {:?} as instructed. Creating symlink -> {:?}.",
                    symlink_path, expected_target
                );
                #[cfg(unix)]
                std::os::unix::fs::symlink(&expected_target, &symlink_path)
                    .context("Failed to create LICENSE symlink")?;
                #[cfg(windows)]
                std::os::windows::fs::symlink_file(&expected_target, &symlink_path)
                    .context("Failed to create LICENSE symlink")?;
            } else {
                return Err(anyhow!(
                    "Missing LICENSE symlink {:?} -> {:?}",
                    symlink_path,
                    expected_target
                ));
            }
        }

        Ok(())
    }

    fn check_dependencies(&self, doc: &CargoToml, expected_version: &str) -> Result<()> {
        let expected_version = format!("={expected_version}");

        for (dep_name, dep) in doc
            .dependencies("dependencies")
            .iter()
            .chain(doc.dependencies("build-dependencies").iter())
        {

View on GitHub (pinned to 3a7e700487)