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

fix non-GHCJS compilation #1566

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

peterbecich
Copy link
Contributor

With GHC 8.6.5 this succeeds locally for me:

% cabal build all
Up to date

cabal.project Outdated
@@ -10,3 +10,6 @@ packages:
codeworld-server/
codeworld-base/
funblocks-client/

constraints:
ghcjs-dom ==0.9.5.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should really go in the cabal file (presumably in codeworld-api/codeworld-api.cabal) rather than here. To be honest, I'm a little surprised that there's a cabal.project file checked in. That seems wrong...

Copy link
Contributor Author

@peterbecich peterbecich Jan 17, 2022

Choose a reason for hiding this comment

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

Good idea; moved to funblocks-client.cabal.

Regarding the cabal.project file, I know the primary way to build CodeWorld is with the scripts provided; needed for GHC patches, etc. IMO the cabal.project file is useful nonetheless. For one, I'm trying to get the whole project building with Nix #1523 and cabal.project is needed for that (if using https://github.com/input-output-hk/haskell.nix).

cabal.project Outdated
@@ -10,3 +10,6 @@ packages:
codeworld-server/
codeworld-base/
funblocks-client/

constraints:
haskell-src-meta ==0.8.7
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think this can go anywhere else, because it is a transient dependency.

haskell-src-meta is only used directly by codeworld-available-pkgs, which is not in this cabal.project file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think reflex fails to build with haskell-src-meta-0.8.8, but only as a dependency of CodeWorld. I can't reproduce the error in reflex by itself.

The transitive dependency is here
https://github.com/peterbecich/reflex/blob/823afd9424234cbe0134051f09a6710e54509cec/reflex.cabal#L183-L189

cabal build all --flags="use-template-haskell"

succeeds with haskell-src-meta-0.8.8.

Copy link
Collaborator

@cdsmith cdsmith Jan 20, 2022

Choose a reason for hiding this comment

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

Okay, I'll try to reproduce the failure and understand what's going on. If this is the case, though, I still think the constraint should be added in codeworld-api.cabal By adding it in cabal.project, you make builds initially appear to succeed, but then the codeworld-api that gets deployed to hackage may still fail to build for actual users. Honestly, I'd rather know that it's broken than make it appear to work in development and then break when deployed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here is the error with haskell-src-meta-0.8.8:


src/Language/Haskell/Meta/Syntax/Translate.hs:493:19: error:
    Not in scope: data constructor ‘Exts.DerivVia’
    Perhaps you meant ‘Exts.Deriving’ (imported from Language.Haskell.Exts.Syntax)
    Module ‘Language.Haskell.Exts.Syntax’ does not export ‘DerivVia’.
    |
493 | toDerivStrategy [email protected]{}      = noTHyet "toDerivStrategy" "2.14" d
    |                   ^^^^^^^^^^^^^
cabal: Failed to build haskell-src-meta-0.8.8 (which is required by
test:unit-tests from codeworld-api-0.7.0, exe:codeworld-game-bot from
codeworld-game-server-0.1 and others). See the build log above for details.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this will solve it: haskell-party/haskell-src-meta#32

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

Successfully merging this pull request may close these issues.

2 participants