-
Notifications
You must be signed in to change notification settings - Fork 5
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
Switch everything over to Cabal #116
Conversation
There's now a single `default.nix` file that exposes the environment, so the client library and s server application don't have their own `default.nix`. The build style has been moved to a Haskell overlay, and `release.nix` exposes the two packages as attributes.
Hoff also has this, so why not do the same thing for icepeak.
This lets you easily enable or disable it through the command line or by overriding it in `cabal.project.local`.
These .hs files are a bit hacky and would probably need to be reworked to be usable again.
Asking @HugoPeters1024 to take a look, because I'm rather busy. @HugoPeters1024 Do you have time to look at this? Thanks! |
@@ -1,6 +1,9 @@ | |||
#!/usr/bin/env stack | |||
-- stack --stack-yaml ../../client-haskell/stack.yaml runghc --package QuickCheck --package quickcheck-text | |||
|
|||
-- FIXME: These scripts will either need to be dropped, or they should be moved |
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.
Do we want to postpone this? Altough I'm assuming this script is rarely used.
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.
They probably haven't been used in years since they won't run correctly as is. @fatho was the last one who worked on this. We can probably also just leave them as is and fix them up once they're needed again.
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.
I tried this before but I now found the actual ticket that was closed with a #wontfix. I had already tried converting the scripts to cabal run scripts but that didn't work. This is why: haskell/cabal#8562
exit 1 | ||
fi | ||
cd "$(dirname "$0")" | ||
cd .. |
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.
Thanks I hate it (but can't think of why this is objectively bad)
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.
cd "$(dirname "$(dirname "$0")")"
doesn't work if the script is invoked relatively from the same directory or through a couple other names. This works, and I've done it in the Hoff repo, but it's a bit uglier so just doing the two cd
s is probably better:
cd "$(dirname "$(dirname "$(realname "$0")")")"
@@ -8,47 +8,7 @@ agent: | |||
os_image: "ubuntu2004" | |||
|
|||
blocks: | |||
- name: "Run checks" |
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.
are we just getting rid of running tests in CI?
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.
No, they're still run. From the OP:
- I haven't fully modernized the Seamaphore build, but I did remove the explicit stack step since it's redundant with the
nix-build
and that invokes Cabal anyways.
@@ -85,11 +45,11 @@ blocks: | |||
jobs: | |||
- name: "Build client" | |||
commands: | |||
- "nix-build --no-out-link -E '(import ./nix/nixpkgs.nix {}).haskellPackages.callPackage ./client-haskell/client.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.
could you also incorporate running cabal-fmt
somewhere in the CI? (formatter for the cabal file)
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.
In the other repos it's part of build.py
but we don't have a build.py
here. Or any other lints for that matter. The CI just checks if it builds and the tests pass. There are currently no lints or style checks at all.
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.
I suppose the cabal file will almost never change in this project, LGTM
Since they currently don't run cleanly anyways, we decided to just look into fixing up the @OpsBotPrime merge |
Pull request approved for merge by @robbert-vdh, rebasing now. |
Approved-by: robbert-vdh Auto-deploy: false
Rebased as 2109f59, waiting for CI … |
CI job 🟡 started. |
Just like in our other projects. I also took the opportunity to move the Nix builds overt to the more modern overlay style where the
icepeak
andicepeak-client
packages are added to the Haskell packages as an overlay. They're then exposed inbuild.py
so the CI can easily build both of them separately. I've made these changes:stack.yaml
, there's now a singledefault.nix
file and thecabal.project
file in the repository's root now references both packages. That means you can runcabal run <icepeak/icepeak-client/all>
from anywhere in the repo to build/run the packages..envrc
file for Nix integration with direnv, since Hoff and all our other repos also have this.nix-build
and that invokes Cabal anyways.