You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems like we have two sets of repos - some on MIT, others on Apache :(. This property will need to change anyways since NuGet now requires including the license file in the package and not setting the URL.
Since license file is required to be in the repository (usually in the root) we can define a convention that the file is /License.txt in all our repos, include that file in the package automatically and report an error if it is not present.
@Eilon would be able to answer better on our requirements for license urls in aspnet packages. I haven't yet looked into embedded license files instead of using a stable license urls. We keep a license.txt file in the root in all aspnet repos
Yeah, then we rename those that do not. Some repos use lower case, some upper case, some extension some not. I don't think we should do all permutations.
I'm not suggesting you support everything. Just think about how folks would set it themselves in their own repo before you hardcode it. I've noticed a lot of properties in Arcade don't take into account that they are providing a default that folks can override.
Suppose someone has one project in the repo with a different license. Just allow for a project to overwrite $(PackageLicenseFile): don't set it in targets unconditionally. If you have a target that does anything (add it to package, check for existence) make sure it honors the value of the property and not a hardcoded path.
I think it would naturally work this way by replacing PackageLicenseUrl with PackageLicenseFile in the props, but I just wanted to point it out with your suggestion around the default convention.
Yes, it will probably be just naturally overridable. But my point is that allowing customization just for the sake of customization adds negative value.
Renaming license files that are checked in is not without its own peril - it is sometimes (arguably incorrectly) linked via a branch name in the URL, so if you rename it (even just changing case), old links will break. Ideally URLs would refer to specific tags/commits, but that is probably not always the case.
But, as to the other things mentioned in the thread:
For ASP.NET/EF Core yeah we use Apache for legacy reasons, so we need to stick to that
Using the new NuGet format for license sounds good (and valuable) to me
it is sometimes (arguably incorrectly) linked via a branch name in the URL, so if you rename it (even just changing case), old links will break.
@Eilon Good point. Do we want to correct such links, if there are any? I noticed in a few repos where license headers in source files mention "See {file} in the repository root" but {file} does not match the name of the actual license file. One reason why having different names in different repos is not desirable. At some point I hope we'll have an analyzer that checks for a predefined license header in source files, so perhaps the analyzer can also be checking for the existence of the file name, but still it is just simpler if they are all the same ...
For ASP.NET/EF Core yeah we use Apache for legacy reasons, so we need to stick to that
Sure, I'm not suggesting changing the content of the file.
Re: defaults - it's still on my plate to get official guidance out there that we can agree on. But what seems to be emerging is that a) Arcade should provide "defaults" which teams are strongly recommended to use because that's where the most value and support is found, and b) "defaults" can (almost) always be overwritten - with the team knowing that they are thus trading short term cost for (perhaps) more long term support cost.
@Eilon It's similar to enforcing code formatting. That's for humans too, the compiler doesn't care about whitespace. We provide an analyzer to enforce code formatting rules. Customers actually also ask about enforcing license header. It's likely we'll provide analyzer for that as well.
Curious why you think corefx and coreclr aren't identified as MIT. I did a quick diff with core-setup and they are showing up as identical 😕 ironically it looks like golang has the same issue.
So, NuGet supports PackageLicenseExpression or PackageLicenseFile. The former is essentially a well-known identifier for a license, such as MIT or Apache-2.0 for our repos. The later means including the license file in the package. I believe the expression is preferable, since one doesn't need to check that the license file is exactly what it's supposed to be.
How do we make sure that the license file in the root matches the license specified by PackageLicenseExpression in Directory.Build.props file? We can implement a simple content check for the licenses we need - we include the text file in Arcade SDK and then we compare the content and it must match exactly.
If repo does not specify PackageLicenseExpression that means their license is non-standard and we can set PackageLicenseFile to the license file in the root of the repo and include it in the packages built from the repo automatically.
We would require the license file in the root to be named license.(txt|md|), ignoring case.
Activity
[-]Is default package license URL[/-][+]Is default package license URL correct?[/+]ericstj commentedon Feb 1, 2019
/cc @tmat @markwilkie
tmat commentedon Feb 4, 2019
Seems like we have two sets of repos - some on MIT, others on Apache :(. This property will need to change anyways since NuGet now requires including the license file in the package and not setting the URL.
tmat commentedon Feb 4, 2019
Related: #1373
tmat commentedon Feb 4, 2019
Since license file is required to be in the repository (usually in the root) we can define a convention that the file is
/License.txtin all our repos, include that file in the package automatically and report an error if it is not present.@natemcmaster Would that work for ASP.NET repos?
ericstj commentedon Feb 4, 2019
Allow for it to to be defined as a different path (for example /LICENSE) but it seems reasonable.
natemcmaster commentedon Feb 4, 2019
@Eilon would be able to answer better on our requirements for license urls in aspnet packages. I haven't yet looked into embedded license files instead of using a stable license urls. We keep a license.txt file in the root in all aspnet repos
tmat commentedon Feb 4, 2019
@ericstj
Why?
ericstj commentedon Feb 4, 2019
Because not all repositories use .txt extension. We do but that's not a requirement. EG: https://github.com/dotnet/machinelearning/blob/master/LICENSE
tmat commentedon Feb 4, 2019
Yeah, then we rename those that do not. Some repos use lower case, some upper case, some extension some not. I don't think we should do all permutations.
tmat commentedon Feb 4, 2019
Perhaps we can allow two variants:
LICENSEandLicense.txt.ericstj commentedon Feb 4, 2019
I'm not suggesting you support everything. Just think about how folks would set it themselves in their own repo before you hardcode it. I've noticed a lot of properties in Arcade don't take into account that they are providing a default that folks can override.
tmat commentedon Feb 4, 2019
That's intentional. There is no point in being different here.
ericstj commentedon Feb 5, 2019
Suppose someone has one project in the repo with a different license. Just allow for a project to overwrite $(PackageLicenseFile): don't set it in targets unconditionally. If you have a target that does anything (add it to package, check for existence) make sure it honors the value of the property and not a hardcoded path.
I think it would naturally work this way by replacing PackageLicenseUrl with PackageLicenseFile in the props, but I just wanted to point it out with your suggestion around the default convention.
tmat commentedon Feb 5, 2019
Yes, it will probably be just naturally overridable. But my point is that allowing customization just for the sake of customization adds negative value.
tmat commentedon Feb 5, 2019
We should just decide on one name and use it everywhere, so that no one will ever need to think about it again.
Eilon commentedon Feb 5, 2019
Renaming license files that are checked in is not without its own peril - it is sometimes (arguably incorrectly) linked via a branch name in the URL, so if you rename it (even just changing case), old links will break. Ideally URLs would refer to specific tags/commits, but that is probably not always the case.
But, as to the other things mentioned in the thread:
tmat commentedon Feb 5, 2019
@Eilon Good point. Do we want to correct such links, if there are any? I noticed in a few repos where license headers in source files mention "See {file} in the repository root" but
{file}does not match the name of the actual license file. One reason why having different names in different repos is not desirable. At some point I hope we'll have an analyzer that checks for a predefined license header in source files, so perhaps the analyzer can also be checking for the existence of the file name, but still it is just simpler if they are all the same ...Sure, I'm not suggesting changing the content of the file.
markwilkie commentedon Feb 5, 2019
Re: defaults - it's still on my plate to get official guidance out there that we can agree on. But what seems to be emerging is that a) Arcade should provide "defaults" which teams are strongly recommended to use because that's where the most value and support is found, and b) "defaults" can (almost) always be overwritten - with the team knowing that they are thus trading short term cost for (perhaps) more long term support cost.
Regardless - more soon on this....
Eilon commentedon Feb 5, 2019
Re: The filename mentioned in the file headers
That's for humans, not machines. I agree it would be nice if it was correct, but I don't think any "errors" there are worth fixing.
tmat commentedon Feb 5, 2019
@Eilon It's similar to enforcing code formatting. That's for humans too, the compiler doesn't care about whitespace. We provide an analyzer to enforce code formatting rules. Customers actually also ask about enforcing license header. It's likely we'll provide analyzer for that as well.
tmat commentedon Feb 7, 2019
Some data:
ericstj commentedon Feb 7, 2019
Curious why you think corefx and coreclr aren't identified as MIT. I did a quick diff with core-setup and they are showing up as identical 😕 ironically it looks like golang has the same issue.
ericstj commentedon Feb 8, 2019
Looks like we need to email GitHub support: licensee/licensee#147 (comment)
I reached out to GH support.
tmat commentedon Feb 8, 2019
It's odd, I didn't dig into it. Just used github license API to query.
tmat commentedon Feb 8, 2019
So, NuGet supports
PackageLicenseExpressionorPackageLicenseFile. The former is essentially a well-known identifier for a license, such asMITorApache-2.0for our repos. The later means including the license file in the package. I believe the expression is preferable, since one doesn't need to check that the license file is exactly what it's supposed to be.How do we make sure that the license file in the root matches the license specified by
PackageLicenseExpressionin Directory.Build.props file? We can implement a simple content check for the licenses we need - we include the text file in Arcade SDK and then we compare the content and it must match exactly.If repo does not specify
PackageLicenseExpressionthat means their license is non-standard and we can setPackageLicenseFileto the license file in the root of the repo and include it in the packages built from the repo automatically.We would require the license file in the root to be named
license.(txt|md|), ignoring case.tmat commentedon Feb 8, 2019
Work in progress: #2003
danmoseley commentedon Mar 5, 2019
@ericstj See https://github.com/dotnet/corefx/issues/35159 my tentative conclusion from messing with it is it's the PATENTS.TXT, which it's mis-recognizing (with low confidence) as containing the MS-PL, and Github puts all this together and decides it's not clearly MIT.