Skip to content

Only build pretty-simple package in cabal CI. Build web with Nix in CI.#117

Merged
cdepillabout merged 3 commits intowebfrom
web-ci
Sep 28, 2022
Merged

Only build pretty-simple package in cabal CI. Build web with Nix in CI.#117
cdepillabout merged 3 commits intowebfrom
web-ci

Conversation

@cdepillabout
Copy link
Copy Markdown
Owner

@cdepillabout cdepillabout commented Sep 25, 2022

This PR just modifies CI to only build web with Nix, and have the cabal CI jobs only build the pretty-simple package, not web.

It also updates the GHC versions used in CI.

This PR should hopefull be able to be directly merged into #116.

run: |
stack test

nix-build-web:
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

We should probably setup some sort of caching for this, but I don't necessarily think that should hold-up this PR from being merged.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Note that Miso has it's own Cachix cache: https://github.com/dmjio/miso/blob/master/README.md#begin.

@georgefst
Copy link
Copy Markdown
Collaborator

Awesome, thanks!

@georgefst
Copy link
Copy Markdown
Collaborator

CI failure looks related to ghcjs/jsaddle#133. But cabal.project is pointing to that branch, so I don't know why the looser bound isn't being used.

@cdepillabout
Copy link
Copy Markdown
Owner Author

cdepillabout commented Sep 25, 2022

@georgefst I came up with a hacky workaround of just removing the ./cabal.project file before running cabal build in CI. That way, cabal won't see the web package, and won't take it into account when running its solver.

This is definitely hacky, but hopefully it works.

@cdepillabout
Copy link
Copy Markdown
Owner Author

@georgefst Looks like the Nix build is now failing: https://github.com/cdepillabout/pretty-simple/actions/runs/3123785920/jobs/5066666069

Maybe just a temporary network problem with GitHub?

@georgefst
Copy link
Copy Markdown
Collaborator

@georgefst Looks like the Nix build is now failing: https://github.com/cdepillabout/pretty-simple/actions/runs/3123785920/jobs/5066666069

Maybe just a temporary network problem with GitHub?

Hopefully. I've kicked it to try again.

@georgefst
Copy link
Copy Markdown
Collaborator

Hopefully. I've kicked it to try again.

Hmm, it happened again. No idea what that's about.

@cdepillabout
Copy link
Copy Markdown
Owner Author

@georgefst As far as I can tell, this wasn't caused by this PR, so what about just merging in this PR and then trying to figure out a fix in #116?

@georgefst
Copy link
Copy Markdown
Collaborator

I think we really need to do something about caching first. It looks to me like CI might have been about to go and build GHCJS. And if we get that from Cachix instead, the current failure (whatever its cause) looks like it might be avoided.

@cdepillabout
Copy link
Copy Markdown
Owner Author

cdepillabout commented Sep 26, 2022

In my opinion, there are really two problems here:

  1. The Nix build doesn't seem to build as-is. We probably don't want a build that can only succeed when you're getting artifacts from a cache, since people who don't have that cache setup will not be able to build. I'm also not able to build locally, because I'm getting the same error as on CI.
  2. Even if we were able to build, without setting up an additional cache, the Nix CI would take a really long time. I think our two options would be to use some sort of GHCJS or Miso Nix cache (if it is available), or setup our own cachix cache. Do you know if there is a GHCJS or Miso Nix cache we could use? It should be relatively easy to setup our Nix action to use an additional cache: https://github.com/marketplace/actions/install-nix#how-do-i-add-a-binary-cache

But I don't think either of these should prevent us from at least merging this PR in, since this PR should still be a strict improvement on #116

@georgefst
Copy link
Copy Markdown
Collaborator

Do you know if there is a GHCJS or Miso Nix cache we could use?

Yes. I mentioned this in #117 (comment). It's the reason I can build this locally.

The Nix build doesn't seem to build as-is. We probably don't want a build that can only succeed when you're getting artifacts from a cache, since people who don't have that cache setup will not be able to build. I'm also not able to build locally, because I'm getting the same error as on CI.

In principle, I totally agree with you. But the whole GHCJS ecosystem is very fragile (for now, there's exciting progress around it being merged to GHC proper), and I think caches are all-but-necessary. Even though, Nix being what it is, in theory it should be possible to reproduce.

@cdepillabout
Copy link
Copy Markdown
Owner Author

But the whole GHCJS ecosystem is very fragile (for now, there's exciting progress around it being merged to GHC proper), and I think caches are all-but-necessary.

Ah, that's unfortunate, but makes sense.

I added the cache in ceaaa96 so hopefully this should be good to merge, if you're happy with it.

The Nix build now only takes a few minutes.

@cdepillabout cdepillabout merged commit a33d5e6 into web Sep 28, 2022
@cdepillabout cdepillabout deleted the web-ci branch September 28, 2022 00:54
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