Skip to content

Changes necessary to build on GHC 8.4.3#3372

Merged
kritzcreek merged 10 commits into
purescript:masterfrom
kritzcreek:ghc-8.4.2
Aug 9, 2018
Merged

Changes necessary to build on GHC 8.4.3#3372
kritzcreek merged 10 commits into
purescript:masterfrom
kritzcreek:ghc-8.4.2

Conversation

@kritzcreek

Copy link
Copy Markdown
Member

This isn't ready just yet, because we need to depend on a GIT version of spdx right now. The master for that package already builds, it just hasn't been released to Hackage yet.

@kritzcreek

Copy link
Copy Markdown
Member Author

Reminder, ping @cnd when we merge this

Cynede added a commit to gentoo-haskell/gentoo-haskell that referenced this pull request May 31, 2018
Cynede added a commit to gentoo-haskell/gentoo-haskell that referenced this pull request May 31, 2018
@Cynede

Cynede commented May 31, 2018

Copy link
Copy Markdown

@kritzcreek thank you! I can verify that this patch works for me with 0.12 release and ghc 8.4.3 on Gentoo 👍

@kritzcreek

Copy link
Copy Markdown
Member Author

Looks like we're running into haskell/network#313 / commercialhaskell/stack#3944 for our AppVeyor build.

Presumably that'll be fixed with network 2.7.0.1 but we'll have to old off until that's released and we tested that it fixes the Windows issues.

@kritzcreek kritzcreek changed the title Changes necessary to build on GHC 8.4.2 Changes necessary to build on GHC 8.4.3 Jun 18, 2018
@ilovezfs

ilovezfs commented Jul 5, 2018

Copy link
Copy Markdown
Contributor

@angerman

Copy link
Copy Markdown

What's this blocked on? As far as I can tell from travis the jobs just timed out?

@kritzcreek

Copy link
Copy Markdown
Member Author

@angerman We need a release of spdx here: phadej/spdx#12 but the author is unresponsive so we might need to consider forking and maintaining it ourselves.

@hdgarrood I think you introduced spdx to verify a proper LICENSE is set before updating documentation to Pursuit? Can we simplify that check and vendor it or should we fork the package instead?

@angerman

Copy link
Copy Markdown

@phadej any advice on how to handle that?

@hdgarrood

Copy link
Copy Markdown
Contributor

I don’t think it’s particularly complex, it’s just not the kind of thing I’d want to vendor if i could avoid to because it could be quite annoying for users if we get it wrong. Although I suppose we might not have much choice.

I don’t have any strong preference for forking vs vendoring except that I suppose the former might imply more of a maintenance commitment which perhaps makes it less desirable. Do you mind if I leave it up to you?

@hdgarrood

Copy link
Copy Markdown
Contributor

I suppose we could also simplify the check to “is the license field present and not equal to AllRightsReserved” or something similar, but I think it’s important to at least have something in place which helps prevent people uploading things to Pursuit without a genuine open source license.

@angerman

Copy link
Copy Markdown

Could you use lib:Cabal for this?

http://hackage.haskell.org/package/Cabal-2.2.0.1/docs/Distribution-SPDX.html

/cc @phadej, @hvr

@kritzcreek

Copy link
Copy Markdown
Member Author

I suppose we could also simplify the check to “is the license field present and not equal to AllRightsReserved” or something similar, but I think it’s important to at least have something in place which helps prevent people uploading things to Pursuit without a genuine open source license.

So this is purely a client-side check? Is the check just meant to discourage people from uploading non-open-source licensed library or strictly prevent them? You can just upload things to Pursuit via HTTP so I don't think it's sufficient if we want the latter.

Do you mind if I leave it up to you?

I don't have the capacities to maintain a fork, nor do I know my way around licenses to make a good educated decision, sorry... I'm just going to delete the SPDX dependent code in this PR, and if you can come up with a better solution you can just commit to my branch (collaborators have push access)

@phadej

phadej commented Jul 29, 2018

Copy link
Copy Markdown
Contributor

Why purescript is using spdx, is there something not in Cabal-2.2 http://hackage.haskell.org/package/Cabal-2.2.0.1/docs/Distribution-SPDX.html (note Parsec and Pretty instances).

I'd not recommend to use spdx as is any longer, next version will reuse Cabal definitions anyway.

@phadej

phadej commented Jul 29, 2018

Copy link
Copy Markdown
Contributor

As for why it's not released: I haven't updated spdx license list in spdx since 2017. spdx uses has 2.6, iCabal-2.2 has 3.0, and latest one is Version 3.2 2018-07-10; (there was 3.1 in between)

@hdgarrood

Copy link
Copy Markdown
Contributor

I wasn't aware that the Cabal library provided this; I think that would be a good option as well.

@phadej

phadej commented Jul 30, 2018

Copy link
Copy Markdown
Contributor

@hdgarrood I'm more committed to updating Cabal than spdx. The plan to spdx is to have "legal" stuff, e.g. it have satisfies and equivalent functions to compare SPDX expressions - but those are out of scope of Cabal for now

@kritzcreek

Copy link
Copy Markdown
Member Author

We're currently having trouble with our CI builds timing out and work towards reducing the compilation times (eg. see #3400). So pulling in a dependency on the Cabal library for a check that should really live in Pursuit anyway doesn't excite me.

@phadej

phadej commented Jul 31, 2018

Copy link
Copy Markdown
Contributor

Cabal-2.2 comes with GHC-8.4, you don't need to install it.

@kritzcreek

Copy link
Copy Markdown
Member Author

Do I also not need to compile and link it?

@phadej

phadej commented Jul 31, 2018

Copy link
Copy Markdown
Contributor

You obviously need to link it, but as it comes with GHC you don't need to compile it (the objects files are there already); In the some way you don't need to compile containers or deepseq, for example.

@kritzcreek

Copy link
Copy Markdown
Member Author

That's good to know, thanks!

@kritzcreek

Copy link
Copy Markdown
Member Author

Allright, so I've changed the code to use Distribution.SPDX and added a dependency on Cabal. I'll open another issue about it because I think ideally we'd just not check these licenses inside the compiler, but for now I just want to get this merged so we don't lag behind too far.

Does this work for you @hdgarrood?

Comment thread src/Language/PureScript/Publish.hs Outdated
--
isValidSPDX :: String -> Bool
isValidSPDX = (== 1) . length . SPDX.parseExpression
isValidSPDX = isJust . SPDX.mkLicenseId

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As I understand it, this will attempt to parse a license ID rather than a license expression, which means that e.g. "GPL-2.0+", meaning GPL 2.0 or any later version, would not be accepted. From looking at the docs, I think we need to use the Parsec instance for License, and then check that a) the parse succeeds and b) that the result is not NONE.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I see, thanks for checking. How about now?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good now, thanks!

@kritzcreek

Copy link
Copy Markdown
Member Author

@LiamGoodacre or @garyb could I get a review on this?

@LiamGoodacre LiamGoodacre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great!

@kritzcreek kritzcreek merged commit e184fca into purescript:master Aug 9, 2018
@kritzcreek

Copy link
Copy Markdown
Member Author

Thanks!

@kritzcreek kritzcreek deleted the ghc-8.4.2 branch August 9, 2018 09:20
@kritzcreek

Copy link
Copy Markdown
Member Author

Ping @cnd as promised ;)

justinwoo pushed a commit to justinwoo/purescript that referenced this pull request Aug 12, 2018
* changes necessary to build on GHC 8.4.2

* remove redundant Monoid imports

* bumps to a 8.4.3 resolver

* Updates for LTS-12

* Work around cabal/stack bug

* Update node and stack versions on appveyor

* removes spdx dependent code

* Revert "removes spdx dependent code"

This reverts commit 9432705.

* use Cabal's SPDX parsing

* use Cabal's Parsec class to parse licenses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants