Skip to content

License file missing from published crate #564

@damaestro

Description

@damaestro

License file missing from published crate

When gl is published to crates.io, the resulting .crate archive does not contain a LICENSE-APACHE file, despite it existing in the repository root.

Why this matters

Linux distributions (Fedora, openSUSE, Debian, etc.) package Rust crates as system packages. Fedora packaging policy requires that every package ships the full license text — see Fedora Licensing Guidelines § License Text. It cannot simply reference a URL or rely on license = "..." in Cargo.toml. When a crate does not bundle a license file, packagers are forced to either:

  • Download the license file out-of-band from the GitHub repository (fragile, and breaks if the repo moves or branch names change), or
  • Synthesize a license file from a template (legally questionable), or
  • Block the package entirely until this is fixed.

How to fix

Add the license file to the crate by including it in Cargo.toml's include list (or by removing an overly restrictive include that excludes it):

[package]
# ...
license = "Apache-2.0"

include = [
    "src/**",
    "LICENSE-APACHE",
    "README.md",
]

If your Cargo.toml does not have an explicit include list, Cargo will include LICENSE* files automatically — so the fix may be as simple as ensuring the license file is present in the crate directory.

Verification

After publishing a new version you can verify the license file is present by running:

tar tf ~/.cargo/registry/cache/index.crates.io-*/gl-*.crate | grep -i license

Thank you for maintaining this crate!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions