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

Test improvements #179

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

Conversation

lucafavatella
Copy link

Hi @jameysharp ,

I find this project interesting. Would you be willing to include these continuous integration and Docker image improvements?

This pull request considers PRs #147, #145 and #161: if you merge this PR without squashing or rebasing, those shall get closed automatically by GitHub.


I see there are some useful open pull requests, though there has not been much activity in the master branch in the last couple of years. It would be nice to get most of those changes reviewed and merged to a common branch that can be based upon. I started such an effort in the following branch:

https://github.com/lucafavatella/corrode/commits/develop-2019

(Deletion of that ^^^ branch planned for end of year 2019.)

I started from non-invasive tests (reflected in this PR), I may in the following months continue with including changes in other PRs. Though before doing so I wanted to check the activity in this repo hence this PR.

Marwes and others added 13 commits April 30, 2017 00:21
Docker was broken because stack required a GHC version newer than the one included in 16.04.
... by merging remote-tracking branch 'upstream/pull/161' into HEAD.

Symptom:
```
Compiler version mismatched, found ghc-7.10.3 (x86_64), but expected minor version match with ghc-8.0.2 (x86_64) (based on resolver setting in /corrode/stack.yaml).
```
... by preferring a supported (LTS) Ubuntu version.

Symptom:
```
...
Step 1/5 : FROM ubuntu:17.04
...
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/zesty-security/universe/source/Sources  404  Not Found [IP: 91.189.91.26 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/zesty/universe/source/Sources  404  Not Found [IP: 91.189.88.161 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/zesty-updates/universe/source/Sources  404  Not Found [IP: 91.189.88.161 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/zesty-backports/restricted/binary-amd64/Packages  404  Not Found [IP: 91.189.88.161 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
The command '/bin/sh -c apt-get update && apt-get install git ghc haskell-stack -y' returned a non-zero code: 100
make: *** [docker] Error 100
```
Symptom:
```
No compiler found, expected minor version match with ghc-8.0.2 (x86_64-nopie) (based on resolver setting in /corrode/stack.yaml).
To install the correct GHC into /root/.stack/programs/x86_64-linux/, try running "stack setup" or use the "--install-ghc" flag. To use your system GHC installation, run "stack config set system-ghc --global true", or use the "--system-ghc" flag.
The command '/bin/sh -c cd corrode && stack build && stack install' returned a non-zero code: 1
```
... by merging remote-tracking branch 'upstream/pull/147' into HEAD.

Symptom (on fresh Docker image `haskell:8.0.2`):
```
Warning: The package list for 'hackage.haskell.org' does not exist. Run 'cabal
update' to download it.
cabal: There is no package named 'happy'.
There is no package named 'alex'.
You may need to run 'cabal update' to get the latest list of available
packages.
```
* Change the Dockerfile to use the working copy of the local git repo
  rather than checking out a remote git repo.  Irrelevant portions of
  the local git repo are ignored.

* Leverage Docker build cache.

* Parametrize Dockerfile on version of GHC and deps.

Also:

* Prefer [Docker official haskell
  image](https://docs.docker.com/samples/library/haskell/) as base.

* Move Docker image from stack to cabal - following most maintained
  build instructions.  As the original author commented in pull
  request 104 of repo jameysharp/corrode:

  > For what it's worth, you might have more luck with the build
    instructions for using `cabal` than for `stack`. The `stack`
    instructions were contributed by someone else and I can't
    personally vouch for them.

* Keep in Docker image [same (default) version of GHC and deps as in
  previous stack-based one](https://www.stackage.org/lts-8.05).

* Teach CI to test build using stack - as Docker image moved from
  stack to cabal.  References:
  * Old Dockerfile.
  * https://docs.haskellstack.org/en/stable/travis_ci/
  * https://docs.haskellstack.org/en/stable/GUIDE/#stacks-functions
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.

4 participants