Skip to content

Move system headers to checkedc-clang repository? #957

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mattmccutchen-cci opened this issue Dec 9, 2020 · 1 comment
Closed

Move system headers to checkedc-clang repository? #957

mattmccutchen-cci opened this issue Dec 9, 2020 · 1 comment

Comments

@mattmccutchen-cci
Copy link
Member

mattmccutchen-cci commented Dec 9, 2020

Currently, users of the Checked C compiler have to take an extra step in every Git working tree to place a copy of the Checked C system headers under llvm/projects/checkedc-wrapper. This could be avoided if the checkedc-clang repository already included the headers in that location. (If including the headers in this repository unblocks us from moving them to a more appropriate location in the repository, we could do that later, though we might have to consider backward compatibility issues.)

The only information I've been able to find about why the headers were not included in the first place is this documentation, which cites a licensing concern; apologies if I've overlooked something. But I don't think the licensing concern is valid. There is rarely any legal problem (and certainly isn't with the liberal non-copyleft licenses we're dealing with here) with collecting several directories under different licenses in the same repository as long as we clearly document what license applies to what directory.

Were you concerned that someone is currently making the assumption that the entire checkedc-clang repository is under the LLVM license? If so, yes, we should notify them to avoid surprising them, but if they want a repository with everything under the LLVM license, they can always modify their process to delete the system headers from their repository again.

The documentation mentions a license "conflict", but as that term is generally used in the free software community, it occurs when there is a "derivative work" C (as defined by copyright law) of two works A and B that are under different licenses and there is no way to distribute C that satisfies the conditions of both licenses. I don't know whether anyone could realistically argue that distributing the system headers with our Clang-based code creates a derivative work, but even if they did, it's easy to satisfy all of the non-copyleft licenses involved here simply by retaining the required notices on the combination.

In case you're concerned that Apache 2.0 would force Microsoft to license any patents it controls that are infringed by the system headers (I doubt there are any such patents): Since Apache 2.0 is non-copyleft, when you create a derivative work of an Apache 2.0 work, you are not required to grant Apache 2.0 (and in particular, not the patent license) on material you add. The patent license would only come into play if you contributed the Checked C system headers to LLVM in the future and the LLVM project required you to grant Apache 2.0 on them, for example.

The usual caveat that I am not a lawyer, but I have many years of experience with this stuff as a hobbyist free software developer. If you have any other licensing questions, I'll be happy to try to answer them, though you might be wise to confirm my answers with your own lawyer.

So, would you be willing to move (or copy?) the system headers from checkedc to checkedc-clang? If so, I may try my hand at a simple PR (though I'd have to prioritize that against other CCI work). Would you want to move anything else along with them?

@sulekhark
Copy link
Contributor

@mattmccutchen-cci, Thank you for your suggestion. However, after an internal discussion regarding your suggestion, we do prefer to retain the existing structure in which the Checked C system headers live only in the checkedc repository. We feel that the extra step of placing the system headers under llvm/projects/checkedc-wrapper is incremental and automatable. We wish to highlight the deliberate choice of the MIT license (which is short, simple and has fewer restrictions) for the Checked C language spec, the Checked C language tests, and the header files in order to make it easier for the adoption of Checked C. Additionally, validating the suggested change with our legal department is a long-drawn and involved process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants