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

Allow compilation with ghc 8.10.7 #51

Merged
merged 11 commits into from Jan 5, 2022
Merged

Conversation

nitinprakash96
Copy link
Member

Need to allow GHC 8.10.7.
Current build on master:

λ  servant-hmac-auth git:(master) ✗ stack build --resolver lts-18.21

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for servant-hmac-auth-0.1.3:
    base64-bytestring-1.1.0.0 from stack configuration does not match ^>=1.0  (latest matching version is 1.0.0.3)
needed since servant-hmac-auth is a build target.

Some different approaches to resolving this:

  * Set 'allow-newer: true' in /Users/nitin/.stack/config.yaml to ignore all version constraints and build anyway.

  * Recommended action: try adding the following to your extra-deps in /Users/nitin/Documents/temp/servant-hmac-auth/stack.yaml:

- base64-bytestring-1.0.0.3@sha256:d5027ea6d63eab27cfa34eb1f5a05b6a5ee521dd176a06da3f7d80e117a88259,2352

- name: Install dependencies
run: |
stack build --test --bench --no-run-tests --no-run-benchmarks --only-dependencies
Copy link
Contributor

@jhrcek jhrcek Jan 4, 2022

Choose a reason for hiding this comment

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

If you want these stack commands to use the stack yaml files, you'll have to specify it on cli,
something like stack build .... --stack-yaml stack-${{ matrix.ghc }}.yaml

Otherwise they'll just use the stack.yaml.

Also if you want to use the ghc installed by haskell/actions/setup@v1
you should add --system-ghc to all the stack commands (otherwise stack will install its own GHC and ignore the ghc installation provided by that setup action.

Copy link
Contributor

@jhrcek jhrcek Jan 4, 2022

Choose a reason for hiding this comment

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

You can see it's downloading ghc-8.8.3 in 8.10.7 job
which is because the stack.yaml specifies lts-16.2 which uses ghc 8.8.3

Screenshot from 2022-01-04 13-04-39

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for pointing this out. I did not realise this was happening.

Copy link
Member

Choose a reason for hiding this comment

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

I like to use lazy approach to this. Rather than being forced to check everything all the time use the workflow where it's hard to miss the problem. If you want to make something build with new version of compiler, start by replicating compilation error in ci. Only then attempt to fix it.

Copy link
Contributor

@jhrcek jhrcek left a comment

Choose a reason for hiding this comment

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

Please add cli arguments to use --system-ghc and --stack-yaml stack-${{ matrix.ghc }}.yaml to all stack invocations. You'll also probably need to rename stack.yaml to stack-8.8.4.yaml and use some resolver that depends on 8.8.4 (e.g. latest 17: https://www.stackage.org/lts-17.15)

Copy link
Contributor

@jhrcek jhrcek left a comment

Choose a reason for hiding this comment

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

Sorry, forgot to click "request changes"

.gitignore Outdated Show resolved Hide resolved
@jhrcek
Copy link
Contributor

jhrcek commented Jan 4, 2022

It's possible you'll no longer be able to build with GHC 8.6.5, due to constraints introduced in 75599c2

In that case I'd recommend simply dropping ghc 8.6.5.
Also I'd recommend using GHC 8.8.4 (latest in 8.8 series) instead of 8.8.3.

@jhrcek
Copy link
Contributor

jhrcek commented Jan 4, 2022

Or alternatively you can just add appropriate extra-deps to stack-8.6.5.yaml.

Copy link
Contributor

@jhrcek jhrcek left a comment

Choose a reason for hiding this comment

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

Almost there 😄

stack-8.8.4.yaml Outdated Show resolved Hide resolved
.github/workflows/haskell-ci.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@jhrcek jhrcek left a comment

Choose a reason for hiding this comment

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

Looks great, thank you!
I love the consistent formatting 👍

servant-hmac-auth.cabal Show resolved Hide resolved
.github/workflows/haskell-ci.yml Outdated Show resolved Hide resolved
@nitinprakash96 nitinprakash96 merged commit 9f48e85 into master Jan 5, 2022
@nitinprakash96 nitinprakash96 deleted the bump-resolver-lts branch January 5, 2022 06:24
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.

None yet

3 participants