-
Notifications
You must be signed in to change notification settings - Fork 79
Description
A number of packages in the PureScript ecosystem have LICENSE files containing multiple licenses. This is for various reasons, but often this happens when a library is ported from another language (ie. Haskell) and needs to retain license contents from that library. For some examples, see:
- https://github.com/slamdata/purescript-markdown/blob/master/LICENSE
- https://github.com/purescript-contrib/purescript-parsing/blob/main/LICENSE
These license files are parsed by licensee
as NOASSERTION, meaning it can't figure out what the license type is, and eventually they fail the import pipeline.
In the case of these two packages, they're combinations of MIT and BSD-2-Clause, which means we can manually fix them up when importing to the registry. However, a lot of packages are failing this way (~360 versions across ~50 packages), so it may be unrealistic that we fix them manually.
Still, these are packages that ought to be in the registry and which do have valid license files, despite the errors resulting from our attempt to parse them.
One possible solution: we could some sort of "resolutions" step, where if we find a license parsed as NOASSERTION, we:
- Print the LICENSE contents to the console
- Ask the user to review the LICENSE and manually choose licenses (providing an empty array if it's not a valid license file)
- Save the user's manual feedback to a
license-resolutions.json
file - On subsequent runs, skip detecting from the LICENSE file if the package version is present in the license-resolutions file
This could be a reasonably quick way to run through the ~360 versions that are failing for this reason.
There may also be a more automated solution, but we start getting into diminishing returns vs. manual processing in these last few packages.