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

Add travis build matrix config. #179

Merged
merged 12 commits into from
Jan 13, 2018
Merged

Conversation

diogob
Copy link
Contributor

@diogob diogob commented Dec 16, 2017

I have kept only the stack tests in the matrix for the sake of simplicity, but I can add back the commands to ensure a build with cabal (although rerunning the tests using cabal seems unnecessary).

I changed some code in order to compile all tests. Now everything compiles but some tests are still failing.

Let me know what you think.

@diogob diogob force-pushed the travis-build-matrix branch 4 times, most recently from 9cb2d1b to 704779e Compare December 17, 2017 04:15
@agentm
Copy link
Owner

agentm commented Dec 17, 2017

Ugh- I temporarily forgot about nix/stack failing to find the GHC libraries necessary to test our scripting support. I will have to look into that again.

@diogob
Copy link
Contributor Author

diogob commented Dec 19, 2017

@agentm I can try to figure out this dependencies, do you know exactly what are the missing libraries, paths or binaries?

@agentm
Copy link
Owner

agentm commented Dec 19, 2017

Thanks! I probably won't have time to dig into this until after the Christmas break.

The issue is that the tests require access to the various GHC-built libraries (including GHC and project-m36 Haskell packages). I have this working for cabal sandboxes and I thought it was working for stack as well. You can see where our binaries look for the modules here. Presumably, the fix would require an additional path be added to the list.

Finding the correct library path on a machine to which you don't have ssh access will be challenging, needless to say, so don't feel discouraged if you can't find it. It's complicated to use GHC-as-a-compiler-service.

I have been toying with the idea of using an off-the-shelf Haskell alternative like Morte which would lower the dependency bar and allow for relocatable libraries (Haskell packages cannot be currently moved), but I haven't found anything suitable yet.

@diogob diogob force-pushed the travis-build-matrix branch 2 times, most recently from 19f5bcc to f21cb20 Compare December 24, 2017 16:05
@diogob
Copy link
Contributor Author

diogob commented Dec 24, 2017

Done! It's probably not the best solution since we could have some corner case where multiple stack snapshots will match the glob function, but is good enough to get the suite running on travis (as well as in my local machine) :D

.travis.yml Outdated

matrix:
fast_finish: true
Copy link
Owner

Choose a reason for hiding this comment

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

I read the docs on this flag, but I don't quite understand how the behavior will change. Could you explain with an example?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be honest I haven't tried without the flag, I just copied from the haskell-stack-travis-ci repo. But the idea is to fail the build as soon as any job fails.

Copy link
Owner

Choose a reason for hiding this comment

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

Ok- that's fine with me. Either way, it's not a deal-breaker.

@agentm
Copy link
Owner

agentm commented Dec 27, 2017

Fantastic! This looks great! I will look to merge it by the end of the week. Thanks for finding the proper paths!

.travis.yml Outdated
- |
set -ex
# Run tests
stack --no-terminal test --ghc-options="$GHC_OPTIONS"
Copy link
Owner

Choose a reason for hiding this comment

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

Won't this only build the tests? Before, we were building all binaries including examples and the haddock target.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will build and execute the tests. It won't build the haddock target though. I can add the haddock at the end of the build if it builds within our time window.

@agentm
Copy link
Owner

agentm commented Dec 27, 2017

I was expecting GHC 8.2 building to fail, so I am surprised that GHC 8.2 building is working here. Specifically, I know there are some incompatibilities with using GHC-8.2-as-a-library which have not been merged to master. Do you know what's going on?

@diogob
Copy link
Contributor Author

diogob commented Dec 28, 2017

About the 8.2 build, I'll try to run it manually and see if I can reproduce this build locally.

@agentm
Copy link
Owner

agentm commented Dec 30, 2017

stack refuses to build with GHC 8.2 in our master branch because the stack.yaml doesn't include a plan for it:

Compiler version mismatched, found ghc-8.2.1 (x86_64), but expected minor version match with ghc-8.0.2 (x86_64) (based on resolver setting in /home/agentm/Dev/project-m36/stack.yaml).

This suggests that this configuration is building with all the same version GHC compiler.

@agentm
Copy link
Owner

agentm commented Dec 30, 2017

From the travis log:

$ echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
/Users/travis/.travis/job_stages: line 57: ghc: command not found

This suggests that stack is not picking up the installed ghc and using its own. In the same log for GHC 8.2.1:

Linking /Users/travis/.stack/setup-exe-cache/x86_64-osx/tmp-Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 ...

so all the builders are using GHC 8.0.2, probably installed by stack.

@agentm
Copy link
Owner

agentm commented Dec 30, 2017

Looking at the travis template, shouldn't it be using stack --system-ghc?

@diogob
Copy link
Contributor Author

diogob commented Dec 30, 2017

@agentm yes, this script is compiling everything under 8.0.2. I'll try to change the stack flags. Worst case scenario I'll create separate stack.yml files

@agentm
Copy link
Owner

agentm commented Dec 30, 2017

Thanks for the update!

I see now that the macos builder is improperly succeeding because stack is still downloading GHC 8.0.2 there. I think the fix is to install GHC via stack setup $GHCVER on darwin.

The 7.10.3 builder is failing due to a missing version macro- I'll try to reproduce and fix that locally.

@diogob
Copy link
Contributor Author

diogob commented Dec 30, 2017

I have used the brew version on osx to use the system ghc flags. It is currently working, we can change this later to make it ghc version specific, since now it is bound to whatever version is available in brew (currently 8.2.2).

@agentm
Copy link
Owner

agentm commented Dec 30, 2017

Thanks! Would it be easier to use stack to download the proper version? We don't support GHC 8.2 yet in the master branch.

@diogob
Copy link
Contributor Author

diogob commented Dec 30, 2017

@agentm true, maybe it's better to keep the mac build just using the standard stack.yml setup. I'll move the osx conditional to the test command.

@diogob
Copy link
Contributor Author

diogob commented Dec 30, 2017

@agentm another question, do we want to allow 7.10.3 and 8.2.2 to fail without failing the build? So they would become informative only.

@diogob diogob force-pushed the travis-build-matrix branch from b0e21dd to 2aca43d Compare December 30, 2017 17:53
@diogob
Copy link
Contributor Author

diogob commented Dec 30, 2017

I have rebased to clean a bit the commit history since most commits were just experiments.

@agentm
Copy link
Owner

agentm commented Dec 30, 2017

GHC 7.10.3 should be supported on all platforms. I used GHC 7.10.3 on darwin just a few days ago but I built with cabal new-build, so something about the stack build is not passing the macro down. I'll take a look at that. For now, I would prefer to disable GHC 8.2 building- I don't want to give the impression it is supported (yet).

More specifically, we have to wait for an upstream package (distributed-process-systest) to bump some version bounds on hackage before we can support GHC 8.2.

@diogob diogob force-pushed the travis-build-matrix branch from 76a590f to 881174a Compare December 30, 2017 21:51
@agentm
Copy link
Owner

agentm commented Dec 31, 2017

stack won't build with GHC 7.10 without a dedicated yaml file since the master branch mentions the GHC 8.0 LTS one. I am testing a GHC 7.10-specific stack.yaml now.

@agentm
Copy link
Owner

agentm commented Dec 31, 2017

I patched the master branch in e0e4787 to allow for compilation with stack + GHC 7.10 + 6.35 LTS from stackage.

@agentm
Copy link
Owner

agentm commented Jan 11, 2018

We will have to wait until the backlog is cleared to continue. Even when we get macos time, it's so sluggish, it's useless.

@diogob diogob force-pushed the travis-build-matrix branch from 2fb93c7 to 79978d7 Compare January 11, 2018 04:32
@diogob
Copy link
Contributor Author

diogob commented Jan 11, 2018

@agentm we are green! Now with the timeout feature the dependencies will be partially uploaded even when the build fails.

@diogob
Copy link
Contributor Author

diogob commented Jan 11, 2018

I can rebase this to clear the history from experimental commits, what do you think?

@agentm
Copy link
Owner

agentm commented Jan 11, 2018

Could you comment on how the dependency installation timeout works? If the dependency installation takes longer than 15 minutes, what happens in the Travis UI?

@agentm
Copy link
Owner

agentm commented Jan 11, 2018

Sure, you can rebase if you like, but the history of our experiments could be useful too. When I merge to mater, I would just add --no-ff to reduce log pollution.

@diogob
Copy link
Contributor Author

diogob commented Jan 11, 2018

@agentm when the dependencies timeout the build will be red (as failed, not errored). A message about the dependencies timeout will show up in the logs. From then one can hit the rebuild button (if they are collaborators in the repo) or just send another push to trigger a new build and incrementally build the cache.

@diogob
Copy link
Contributor Author

diogob commented Jan 11, 2018

Once this is in master the failures due to dependencies timing out should become rare, since new pull requests use the master branch cache according to Travis docs.

@diogob diogob force-pushed the travis-build-matrix branch from 71cdbfc to 7142828 Compare January 12, 2018 01:41
@agentm
Copy link
Owner

agentm commented Jan 12, 2018

Great news! I didn't realize that failed builds will also upload the cache.

I hope travis can resolve the macos build backlog soon.

@agentm agentm merged commit 0fc9e09 into agentm:master Jan 13, 2018
@agentm
Copy link
Owner

agentm commented Jan 13, 2018

Thanks again for your hard work on this issue! We both got close to giving up but successfully bounced ideas back-and-forth until we got it.

This patch will help us to catch stackage LTS mistakes which I have missed in the past.

The hassles we faced here make me even more worried about the mess the automated Windows builders will face. Next stop: AppVeyor!

@diogob diogob deleted the travis-build-matrix branch January 13, 2018 16:04
@agentm
Copy link
Owner

agentm commented Jan 14, 2018

@diogob, I am having trouble with dependency-building timeouts in the master branch after 3 commits. Is there anything I need to do to prime the cache?

@diogob
Copy link
Contributor Author

diogob commented Jan 14, 2018

there is an error that is invalidating the macos build:

/Users/travis/.travis/job_stages: line 57: shell_session_update: command not found

But for the linux build I don't have an explanation, unless their cache upload is coupled with the global state of the build.

@diogob
Copy link
Contributor Author

diogob commented Jan 14, 2018

I'm making some tests on a branch of my own

@diogob
Copy link
Contributor Author

diogob commented Jan 14, 2018

I found this: travis-ci/travis-ci#6307

@agentm
Copy link
Owner

agentm commented Jan 14, 2018

The macos builds are backlogged for over 16 hours, so we probably won't have complete macos builds for a while. I am experimenting with increasing the dependency timeout to prime the cache. For whatever reason, I don't see a cache upload after a timed out dependency step.

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