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
WIP: Add nix to travis matrix #344
Conversation
@srid Thanks for your work on this issue! Looking forward to seeing the end result 👍 Creating Kowainik cache is not a problem at all 👌 @vrom911 and I can create and maintain Kowainik account for this cache. |
Nix does use the official cache; but since our default.nix overrides certain source dependencies - they lead to re-building a bunch of packages manually. Travis times out building them all. So, the proposed idea is to use a secondary cache (i.e., in addition to the official cache), and run It is not perfect solution though, because every time we change default.nix source deps we might have to re-build and re-push to the cache before the PR travis builds use them successfully. |
I can write up a small guide (as a section in README.md) on how to use cachix to push/use cache for this project. Let me know if you'd like that. I would use my own cache bucket. Before merging this PR, you can follow the guide but use your's (instead of mine) - so that you have control over the cache. |
@srid Is it enough to create cache locally on my machine and then use it on Travis CI? Because operating systems on my machine and on Travis can be different... I don't know how sensitive If |
Also, do we still need to pin this version? Line 5 in be71488
Can we use just |
Yes, it is recommended to pin nixpkgs for evaluation reproducibility. Only the default compiler ( |
Good question; it probably needs to be same arch (Linux64?). I already run NixOS, but I imagine if I build the binaries on Mac, it probably won't work on travis. |
@srid When trying to push
Could you, please, help to understand, what does it mean and how to resolve it? |
.travis.yml
Outdated
@@ -24,6 +28,10 @@ matrix: | |||
- ghc: 8.6.5 | |||
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack.yaml" DEPLOY=yes | |||
|
|||
- language: nix | |||
install: echo 'Running nix...' | |||
script: nix-shell --run 'cabal new-test all --enable-tests' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably the before-script
part should be written under this matrix
item near script
. Also, I would prefer uniform style, like this:
install:
- ...
before_script:
- ...
- ...
script:
- ...
@srid I've pushed One thing I noticed while building with
|
@@ -24,6 +24,15 @@ matrix: | |||
- ghc: 8.6.5 | |||
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack.yaml" DEPLOY=yes | |||
|
|||
- language: nix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it doesn't use my cachix
cache because by default Travi CI is using nix-env
and nix-build
version 2.0.4
but on my machine it's 2.3
- language: nix | |
- language: nix | |
nix: 2.3 |
Hmm. Looking at the log, I see that it is indeed pulling some packages from your cache: |
At first glance, I think it might be because of the extra Haskell dependencies used in Let me think. |
Note to self (when I come back to this): This might be relevant: cachix/cachix#52 |
I'm happy to help, but have a few questions:
|
@domenkozar I appreciate any help! But I can't answer the questions, I have only basic familiarity with |
I think it should be! Wouldn't that require adding @chshersh 's private key on the Travis' machine? How is it that normally done?
It could be that the |
You need to encrypt secrets via travis
Ah so nix-shell provides haskell dependencies? That would make sense. BTW, we released cachix-action for github, I'd recommend switching to that since it's going to be much easier. Although for your use case you might want to check cachix/cachix-action#8 |
@srid @domenkozar I propose to close this PR and configure Nix build using GitHub actions. I've already done this successfully for our repositories @domenkozar Thank you for your work on |
Sounds good. I'm not at all familiar with Github Actions, but looking forward to how this project will use it ... |
Resolves #336
Travis is expected to timeout during the Nix build. The proposed fix is to use cachix. Perhaps a
kowainik
cache can be created by someone (who?) who will retain its private keys (and be authorized to push to it)?Checklist:
stylish-haskell
file.summoner
and check that the changes work as expected.Hint: Add the
[ci skip]
text to the docs-only related commit's name, so no need to wait for CI to pass.