Skip to content
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

Add license header to files that have no header #2469

Merged
merged 1 commit into from
Mar 31, 2022
Merged

Conversation

tlakollo
Copy link
Contributor

This PR adds the following message as header

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

for files that dont contain any license information

@tlakollo
Copy link
Contributor Author

tlakollo commented Dec 29, 2021

The runtime repository has license headers for tests and files. Currently, the linker repo does not have a license displayed in all files, with most testing files not having any header. Some concern brought by @MichalStrehovsky is that some of these files may precede the acquisition made by Microsoft and in that case is not clear if we can copyright them.
Having said that, the files under some other license haven't been changed and this PR only adds to files with no license explicitly displayed

@marek-safar
Copy link
Contributor

I'd not be too concerned with copyright for test files, especially if they are small.

@mrvoorhe could you comment with explicit approval too?

@vitek-karas
Copy link
Member

I'm perfectly OK adding the license header to everything - makes it simple and consistent.
That said, maybe we should change the editor config to make this into a warning:

linker/.editorconfig

Lines 103 to 105 in 1a6468f

# IDE0073: File header
dotnet_diagnostic.IDE0073.severity = suggestion
file_header_template = Licensed to the .NET Foundation under one or more agreements.\nThe .NET Foundation licenses this file to you under the MIT license.

In that case linter would catch missing headers and fail the CI (and running it locally should actually add the header there for you).

@tlakollo
Copy link
Contributor Author

tlakollo commented Jan 4, 2022

I'm perfectly OK adding the license header to everything - makes it simple and consistent.

What about files that currently have a different license header for example AssemblyResolver.cs which has a Novell license?

@vitek-karas
Copy link
Member

I guess we will need to involve somebody who understands licensing. The LICENSE.txt in the root doesn't mention Novell at all, it's purely a .NET Foundation license. I assume that we would need to either change the license for the file or add something to the main license.

@MichalStrehovsky
Copy link
Member

I would not touch the files that have existing license headers - see dotnet/runtime#63146 (comment).

I don't know if we have existing guidance from CELA on source files that are old, but don't have any licensing header whatsoever.

It should be fine to add the header to any files added in the past ~5 years (and it is our policy to have those headers).

@tlakollo
Copy link
Contributor Author

tlakollo commented Jan 24, 2022

Following CELA guidance we can:

  • Add Novel, Xamarin, and others to our notice file
  • Add the DFN license information at the start of the file once Microsoft had made changes to the file

@tlakollo
Copy link
Contributor Author

Files that still have previous license headers and haven't been modified are:

  • linker\src\linker\Linker\TypePreserve.cs
  • linker\src\linker\Linker\Tracer.cs
  • linker\src\linker\Linker\MethodAction.cs
  • linker\src\linker\Linker.Steps\RegenerateGuidStep.cs

Files from project:

  • linker\src\analyzer\analyzer.csproj

@vitek-karas
Copy link
Member

If these files are not modified, then we should keep them as-is.
For the rest I think this makes sense. But please get a review from @richlander at least.

@richlander
Copy link
Member

The LICENSE.txt in the root doesn't mention Novell at all

That's what the 3PN is for.

Here are some good rules:

  • Do: Add .NET Foundation copyright notice to all files, including those with no notice.
  • Do: Add .NET Foundation notice to the top even if there are other notices. That's just a sanity win for consistency for our project.
  • Do: Add .NET Foundation notice for files we never modified. It makes it clear that these files are covered by our MIT license and our 3PN. Also, it just helps with our sanity. Let's avoid special rules where we can. Also, if someone complains about this practice, we can address it at the time. We can beg for forgiveness based on a legit intent to improve clarity.
  • Do not: remove/modify the Novell notice (ever).
  • Do: If something feels odd of wrong, ask.

Copy link
Member

@sbomer sbomer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! It's probably worth re-doing the changes on top of the latest commit from a fresh state to make sure there are no unrelated changes introduced by accident.

@tlakollo
Copy link
Contributor Author

@richlander I think this PR is ready for review, PTAL

@tlakollo
Copy link
Contributor Author

Every commit now is potentially a merge conflict, so it will be nice to merge this as soon as possible to prevent unnecessary rework

…ginning of the file

Some of the files that hold a license from a third party now have the two licenses as header files
Linker now uses the sdk format of license header instead of the runtime one
Added having the license header as warning in the editor config
Added THIRD-PARTY-NOTICES.TXT file to the repo root
Copy link
Member

@sbomer sbomer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks a lot!

@tlakollo tlakollo merged commit 4f0d349 into main Mar 31, 2022
@tlakollo tlakollo deleted the AddLicenseHeaders branch March 31, 2022 22:21
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
…ginning of the file (dotnet/linker#2469)

Some of the files that hold a license from a third party now have the two licenses as header files
Linker now uses the sdk format of license header instead of the runtime one
Added having the license header as warning in the editor config
Added THIRD-PARTY-NOTICES.TXT file to the repo root

Commit migrated from dotnet/linker@4f0d349
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

Successfully merging this pull request may close these issues.

6 participants