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

Reuse Compatability #53

Open
schmidtw opened this issue Jul 30, 2022 · 2 comments
Open

Reuse Compatability #53

schmidtw opened this issue Jul 30, 2022 · 2 comments

Comments

@schmidtw
Copy link

I changed a go project I have over to use spdx & the FSF's reuse tooling to attempt to make things more clear & simpler to manage. It looks like this license checker doesn't handle looking in a LICENSES directory for the SPDX licenses. The purpose for this issue is to see if that is something the maintainers here would be willing to accept a change for.

For reference, this is what reuse shows for it's structuring:
https://reuse.software/tutorial/#result

Here is my project (that uses the reuse cli tool):
https://github.com/schmidtw/goschtalt/tree/main/LICENSES

Of note is that the code isn't dual licensed (meaning it's available under both) but parts are covered by one license and other are covered by a different license.

@oliverpool
Copy link

I face the same issue with my repo: https://codeberg.org/pfad.fr/vanitydoc/src/branch/main/LICENSES (I don't even have a LICENSE file, since it shouldn't be needed).

Instead of looking for the LICENSES folder, the tool should directly check the SPDX-License-Identifier headers.

As such, the documentation of my package is not displayed on pkg.go.dev (luckily the goal of this package is to enable self-hosting documentation: https://code.pfad.fr/vanitydoc ;)

@wombelix
Copy link

I hit the same problem today, but I wonder if this repo is the right place to propose a fix?
My understanding is that licensecheck accepts a license text as input and then detects which license it is.
I don't see a reason why this would fail in the context of Reuse.

The actual logic to use it and identify which file to scan sits in https://github.com/golang/pkgsite. And that repo expects issues to be raised in https://github.com/golang/go, where the related one (golang/go#40586) was then closed last week:

We currently have no cycles to add the LICENSES directory. I would pursue other options.

And as far I can tell from a brief check, this line is part of the logic that would need to be changed:
https://github.com/golang/pkgsite/blob/8bad909da0cbaf239510644c5a91d1be27376d9f/internal/licenses/licenses.go#L452
Seem to bail out on Directories and only consider Files, not even Symlinks, in the project root.

So I guess the only way forward for a permanent solution would be to contribute a PR in https://github.com/golang/pkgsite.

The workaround till then is a redundant copy of the relevant license file in the project root as it's for example brought up in gocsaf/csaf#599.

wombelix added a commit to wombelix/sourcehut-go that referenced this issue Dec 29, 2024
Copy of primary license in project root created to address error 'Documentation not displayed due to license restrictions.' when using pkg.go.dev. It's caused by missing support for 'LICENSE/' sub-folder and Reuse structure.

Required till appropriate fix in https://github.com/golang/pkgsite

Refs: golang/go#40586

Refs: google/licensecheck#53
wombelix added a commit to wombelix/terraform-provider-sourcehut that referenced this issue Dec 29, 2024
Copy of primary license in project root created to address error 'Documentation not displayed due to license restrictions.' when using pkg.go.dev. It's caused by missing support for 'LICENSE/' sub-folder and Reuse structure.

Required till appropriate fix in https://github.com/golang/pkgsite

Refs: golang/go#40586

Refs: google/licensecheck#53
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

3 participants