Skip to main content

SPDX_EXPRESSION_MAX_LEN

Constant SPDX_EXPRESSION_MAX_LEN 

Source
pub const SPDX_EXPRESSION_MAX_LEN: usize = 256;
Expand description

Practical cap on a :licenca (SPDX-expression-shaped) value, in bytes. The SPDX specification places no length cap on expressions — the grammar admits arbitrarily-nested composite expressions — but every realistic pleme-io fixture stays well under this bound (MIT 3, Apache-2.0 10, Apache-2.0 OR MIT 17, the longest SPDX dual-license-with-exception shape Apache-2.0 WITH LLVM-exception 31; a (MIT OR Apache-2.0) AND BSD-3-Clause AND ISC composite caps near 50). 256 bytes is the substrate’s catch-the-paste-from-binary cap on the peer trajectory is_dns_1123_label (63), is_cargo_feature_name (64), is_wit_world_ref (128), is_nats_subject (256), is_wasi_keyvalue_slot (512), is_git_ref_name (255), is_git_oid (40/64), is_git_repo_url (2048) carry: an axis-appropriate ceiling above every legitimate authoring shape, tight enough to surface the “paste-from-license-text” / “multi-line license blob landed in the :licenca slot” footgun at validate time.