-
Notifications
You must be signed in to change notification settings - Fork 711
Change license :: License to Either SPDX.License License #5050
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
Conversation
|
2532243
to
eeb957a
Compare
I made |
eeb957a
to
1b057fa
Compare
-- If GHC >= 8.4 we register with SDPX, otherwise with legacy license | ||
IPI.license = | ||
if ghc84 | ||
then Left $ either id licenseToSPDX $ licenseRaw pkg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This choice converts everything to SPDX, so in GHC-8.4 package databases will only contain SPDX expressions.
Alternatively we can let licenseRaw
to go though unmodified, or convert only "sure" things (e.g. MIT, BSD3, GPL-3, not PublicDomain
or OtherLicense
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me :-)
How it's possible that in GHC-7.8.4 output https://travis-ci.org/haskell/cabal/jobs/330116951#L2091 I see
ping @ezyang, any ideas? |
ping @ezyang , any ideas why tests fail on older GHC? For example https://travis-ci.org/haskell/cabal/jobs/330116951 |
Ah I see, it actually tests with |
You can change the GHC version check to |
@23Skidoo head is 8.5 so that won't work, I'll just temporarily skip the test for 8.4+ and unskip it when Cabal is updated in GHC-tree. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks all right from a quick glance.
Resolves haskell#2547 I introduce SimpleLicenseExpression to make "OrAnyLater LicenseRef" unrepresentable. That also simplifies types. license field is parsed as old `License` when cabal-version <2.2, and as SPDX expression otherwise. `NONE` is recognised. There are best-effort functions to convert between `License` and `SPDX.License`. There are also IPI changes: parser accepts both `License` and `SPDX.License`, as both can occur in package database. Cabal will `register` a SDPX expression as `license` for GHC >= 8.4, and legacy `License` for other (we are smart when converting `PackageDescription` + LBI and other data to `InstalledPackageInfo`) Also add NFData InstalledPackageInfo
569c123
to
ffbfafd
Compare
@23Skidoo do you want to take a closer look, or should I merge? (when travis is green, at least mostly) |
I'll try to later today, feel free to merge if I won't. |
I merged this now, any comments are still welcome |
WIP: [ci skip] Have to fix cabal-tests and check that we don't breakolder (i.e all) ghc-pkgs
Resolves #2547
I introduce SimpleLicenseExpression to make "OrAnyLater LicenseRef"
unrepresentable. That also simplifies types.
license field is parsed as old License when cabal-version <2.2,
and as SPDX expression otherwise. NONE is recognised.
There are also IPI changes, there both old and SPDX license expressions
are accepted, as both can occur in package database.
Please include the following checklist in your PR:
[ci skip]
is used to avoid triggering the build bots.Please also shortly describe how you tested your change. Bonus points for added tests!