Package Apache license and standardize notices
Adopt the conventional NOTICE layout and include required license material in published crate archives. Verify workspace license metadata and the host coordinator's bundled ncurses notices.
This commit is contained in:
parent
30fc02d79f
commit
465c40822a
1 changed files with 129 additions and 34 deletions
|
|
@ -597,6 +597,50 @@ def audit_dependencies(metadata: dict) -> None:
|
|||
print("PASS dependency source, wildcard, and license audit")
|
||||
|
||||
|
||||
def audit_distribution_licenses(metadata: dict) -> None:
|
||||
packages = {package["id"]: package for package in metadata["packages"]}
|
||||
for package_id in metadata["workspace_members"]:
|
||||
package = packages[package_id]
|
||||
manifest_root = Path(package["manifest_path"]).resolve().parent
|
||||
license_file = manifest_root / (package.get("license_file") or "")
|
||||
require(
|
||||
package.get("license") == "Apache-2.0",
|
||||
f"{package['name']}: package must declare Apache-2.0",
|
||||
)
|
||||
require(
|
||||
license_file.resolve() == ROOT / "LICENSE",
|
||||
f"{package['name']}: package must distribute the repository license",
|
||||
)
|
||||
|
||||
result = subprocess.run(
|
||||
[
|
||||
"cargo",
|
||||
"package",
|
||||
"--package",
|
||||
"lazaret-host-coordinator",
|
||||
"--list",
|
||||
"--allow-dirty",
|
||||
],
|
||||
cwd=ROOT,
|
||||
text=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
)
|
||||
require(result.returncode == 0, result.stderr.strip())
|
||||
packaged = set(result.stdout.splitlines())
|
||||
required = {
|
||||
"LICENSE",
|
||||
"NOTICE",
|
||||
"LICENSES/ncurses-MIT-open-group.txt",
|
||||
"assets/tmux-256color.base64",
|
||||
}
|
||||
require(
|
||||
required <= packaged,
|
||||
"lazaret-host-coordinator package omits required license material",
|
||||
)
|
||||
print("PASS source distribution license material")
|
||||
|
||||
|
||||
def is_materialized_fuser(package: dict) -> bool:
|
||||
return (
|
||||
package.get("name") == "fuser"
|
||||
|
|
@ -822,6 +866,7 @@ def verify(process_syscalls: bool) -> None:
|
|||
audit_rust_module_boundaries(metadata)
|
||||
audit_rust_file_sizes(metadata)
|
||||
audit_dependencies(metadata)
|
||||
audit_distribution_licenses(metadata)
|
||||
run_models()
|
||||
if process_syscalls:
|
||||
audit_process_syscalls(metadata)
|
||||
|
|
|
|||
Loading…
Reference in a new issue