ziglang / zig

General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
https://ziglang.org
MIT License
34.96k stars 2.55k forks source link

Reintroduce license headers #18480

Open perillo opened 10 months ago

perillo commented 10 months ago

I think the decision to remove license headers should be reconsidered.

See https://matija.suklje.name/how-and-why-to-properly-write-copyright-statements-in-your-code for an article advocating the use of license headers, using the SPDX-FileCopyrightText and SPDX-License-Identifier tags.

Thanks.

tauoverpi commented 10 months ago

It would also work towards REUSE compliance which requires at least a machine readable description of the licenses for each file within the project.

mlugg commented 10 months ago

Whilst that article does state that every file should have a license header, it doesn't actually seem to give an indication as to why: it just explains why copyright notices in general are a good idea. The reason it gives - making it clear what the copyright situation of any work is to any interested party with a copy of the code - is served perfectly well by a single LICENSE file, particularly for a codebase like this where a standalone file is virtually useless.

Including license headers in every file not only wastes bytes, but also places a non-trivial maintenance burden on the project. For something which is legally unnecessary and seems useful only in rather esoteric scenarios, this tradeoff does not seem even remotely worthwhile.

If you have specific reasons you would like to reintroduce license headers, please include them in this issue (quotes from other sites are fine). This makes it clearer to anyone reading (as well as preventing any link rot issues).

It would also work towards REUSE compliance [...]

From a quick look over their website, it's unclear to me what problem is solved by REUSE. The homepage states: "We solve a fundamental issue that Free Software licensing has at the very source: what license is a file licensed under, and who owns the copyright?". I don't agree that there is any "fundamental problem" here: in most projects, including Zig, this licensing is made perfectly clear by the presence of the LICENSE file. I'm not convinced that there's any practical benefit to duplicating this information across every file and introducing the risk of this information being incorrect in any single one of them.

In addition, if we were to aim for REUSE compliance, it seems to me far more desirable to use the DEP5 strategy to mark copyright over entire directory trees, to avoid redundancy and prevent the chance of missing/incorrect headers.

perillo commented 10 months ago

@mlugg, one use case was described in d29871977.

About wasting bytes and maintenance burden:

  1. Using SPDX tags does not waste bytes, compared to the header generated by the update-license-headers tool.
  2. I don't think it is a maintenance burden on the project. The headers are create once (when a file is created) and never updated again (since the only copyright holder is Zig contributors). There is no need to update the year.

About a specific reason for reintroducing license headers (and adding the year in LICENSE file):

  1. The linked article actually cite an U.S. Code: (https://www.law.cornell.edu/uscode/text/17/401) "Notice of copyright: Visually perceptible copies". I'm not quoting it since I don't know if it is allowed.

About REUSE:

  1. There is a draft PR introducing a REUSE.toml file: fsfe/reuse-tool#863

Thanks

exxjob commented 10 months ago

https://github.com/ziglang/zig/issues/14342 ... to back up what @mlugg said, namedropping rights expression schemes to comply with, of which there are many, benefits their proliferation, but not so much Zig. Either they don't fix some problem as they purport to, or it's a problem you've yet to identify in Zig. What they're really good for is confusing people.

As for license headers, they're effectively a measure of convenience - an extra acknowledgement, there's no legal reprecussions for not having them. You're legally obliged to include the license with all copies of Zig regardless.