slint-ui/slint · error
License ` ` of crate is not in the accepted list
Error message
License `{expression}` of crate {} {} is not in the accepted list What it means
The `xtask` license checker validates that every dependency crate's declared SPDX license expression is on the project's accepted-licenses list (with optional per-crate allow entries). When a crate's license is not accepted and not allowed, the `generate` step bails with this error. It guards the dependency set against licenses the project cannot ship.
Solutions
- Add an allow entry for the package in xtask's license allow list if the license is acceptable for this use
- Downgrade or pin the dependency to a version with an accepted license
- Replace the dependency with an alternative that has an accepted license, or negotiate/approve the new license and add its SPDX id to the accepted list
Example fix
// before (allow list in xtask license.rs / config)
let allow = ""; // crate with ISC license not listed
// after
let pkg_allow = Some("ISC"); // explicit per-crate allow added for the new dependency Defensive patterns
Strategy: validation
Validate before calling
# Check a crate's license before adding it cargo add foo --dry-run grep '^license' $(cargo metadata ... | jq -r '.packages[] | select(.name=="foo") | .manifest_path')
Prevention
- Check new dependencies' SPDX licenses before adding them
- After cargo update, run the xtask license check locally before pushing
- Keep the allow list documented so additions are deliberate
When it happens
Trigger: Adding or upgrading a dependency whose Cargo.toml `license` field contains an SPDX expression not present in the accepted list and not covered by a per-package entry in the allow list; a dependency changing its license in a new version.
Common situations: `cargo xtask` license/dependency checks in CI after `cargo update` pulls a crate version with a new license; introducing a crate with a copyleft or nonstandard license.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- Missing LICENSES directory for published crate
- Missing tag
- No license file found in root LICENSES/ for SPDX id
- unexpected header. expected
- cargo failed
AI-assisted analysis of slint-ui/slint@bb937076de (2026-09-16).
Data as JSON: /api/errors/fd5f7a2d7aed4ee6.
Report an issue: GitHub.
Appendix: source
Thrown at xtask/src/license.rs:161
// Lax parsing accepts the deprecated `/` OR-separator and imprecise
// identifiers (e.g. `apache2`) still found in older crates.
let expr =
spdx::Expression::parse_mode(&expression, spdx::ParseMode::LAX).with_context(|| {
format!("Cannot parse license `{expression}` of {} {}", pkg.name, pkg.version)
})?;
// A `[package.metadata.slint-license.allow]` entry in the analyzed
// crate's manifest extends the accepted set for *that one dependency
// only*, so an exceptional license (e.g. LGPL-3.0 via dynamic linking)
// is approved explicitly per-crate rather than relaxed project-wide.
let pkg_allow = allow.get(pkg.name.as_str()).map(String::as_str);
let pkg_accepted = |req: &spdx::LicenseReq| {
let id = license_string(req);
accepted.contains(id.as_str()) || pkg_allow == Some(id.as_str())
};
if !expr.evaluate(pkg_accepted) {
bail!(
"License `{expression}` of crate {} {} is not in the accepted list",
pkg.name,
pkg.version
);
}
// Record the license ids the crate uses, so each gets a body.
for req in expr.requirements() {
if !pkg_accepted(&req.req) {
continue;
}
let id = license_string(&req.req);
license_names.entry(id.clone()).or_insert_with(|| license_full_name(&req.req));
used_ids.insert(id);
}
// The `authors` field is optional and newer crates increasingly omit
// it; salvage the copyright holder(s) from the license files shippedView on GitHub (pinned to bb937076de)