Files
zed/tooling/xtask/src/tasks/licenses.rs
T
morgankrey 27c566c212 Relicense Zed source code under GPL (#57948)
## Summary

This moves the remaining first-party AGPL surface to GPL, a less
restrictive license for these components. Apache-2.0 components are
unchanged.

Changes:
- Updates the `collab` crate from `AGPL-3.0-or-later` to
`GPL-3.0-or-later`
- Removes the root AGPL license file and first-party crate AGPL symlinks
- Updates web, documentation, Flatpak, README, and terms references to
reflect the GPL/Apache licensing split
- Updates the open-source component example list in the terms and
regenerates the RTF copy; no other terms changes are intended
- Adds guardrails so first-party crates cannot declare AGPL licensing or
carry `LICENSE-AGPL` files

Release timing: preview during the week of June 1, 2026; stable during
the week of June 8, 2026.

## Residual AGPL/Affero references

- `LICENSE-GPL`: GPLv3's own compatibility clause; unchanged official
license text.
- `crates/json_schema_store/src/schemas/package.json`: generic npm
package-license schema value, not Zed licensing.
- `script/check-licenses`, `script/new-crate`,
`script/licenses/zed-licenses.toml`: guardrails that reject or warn
against reintroducing AGPL.

## Verification

- `script/check-licenses`
- `script/generate-licenses`
- `script/generate-terms-rtf`
- `script/new-crate license_probe_for_gpl`, then discarded generated
crate
- `script/new-crate license_probe_for_agpl agpl` fails as expected
- `mdbook build docs`
- `./script/clippy`
- `git grep -n -I -E "AGPL|Affero"`
- `git diff --check`

Release Notes:

- The `collab` crate, used to implement Zed's collaboration backend, is
now licensed under the GPL instead of the AGPL. The AGPL license is no
longer used in the zed repository.
2026-05-28 20:19:17 +00:00

46 lines
1.2 KiB
Rust

use std::path::{Path, PathBuf};
use anyhow::{Context as _, Result};
use clap::Parser;
use crate::workspace::load_workspace;
#[derive(Parser)]
pub struct LicensesArgs {}
pub fn run_licenses(_args: LicensesArgs) -> Result<()> {
const LICENSE_FILES: &[&str] = &["LICENSE-APACHE", "LICENSE-GPL"];
let workspace = load_workspace()?;
for package in workspace.workspace_packages() {
let crate_dir = package
.manifest_path
.parent()
.with_context(|| format!("no crate directory for {}", package.name))?;
if let Some(license_file) = first_license_file(crate_dir, LICENSE_FILES) {
if !license_file.is_symlink() {
println!("{} is not a symlink", license_file.display());
}
continue;
}
println!("Missing license: {}", package.name);
}
Ok(())
}
fn first_license_file(path: impl AsRef<Path>, license_files: &[&str]) -> Option<PathBuf> {
for license_file in license_files {
let path_to_license = path.as_ref().join(license_file);
if path_to_license.exists() {
return Some(path_to_license);
}
}
None
}