-
Notifications
You must be signed in to change notification settings - Fork 9
Adapt to more recent haskell.nix #107
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
Conversation
Move from 9.2 to 9.6. haskell.nix will drop support ghc < 9.6 in the future. And currently 9.2. doesn't even build on Darwin, as it requires 8.10 to bootstrap and that's broken, and will be removed from haskell.nix in the not too distant future.
I'm still confused why we get so few cache hits. |
WalkthroughThe changes update the GHC compiler version used in three Nix configuration files. In Changes
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration 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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/ext/cabal-fmt.nix (1)
12-14
: Update the comment to reflect current Cabal version.The comment mentions "currently 3.2" when referring to the Cabal version from compiler-nix-name. This might need updating if GHC 9.6 comes with a different Cabal version.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/ext/cabal-fmt.nix
(1 hunks)src/ext/fourmolu.nix
(1 hunks)
🔇 Additional comments (1)
src/ext/fourmolu.nix (1)
10-10
:❓ Verification inconclusive
Verify GHC version change and fourmolu compatibility.
The change to
ghc98
(GHC 9.8) seems to go beyond the PR's stated objective of updating to GHC 9.6. While using a newer version might be intentional, please verify:
- That this is the intended version (not a typo of
ghc96
).- That fourmolu 0.16.2.0 is compatible with GHC 9.8.
🌐 Web query:
Is fourmolu 0.16.2.0 compatible with GHC 9.8?
💡 Result:
Fourmolu version compatibility with GHC versions can be determined from its upstream dependencies and changelog entries:
1. Fourmolu v****ersion compatibility with GHC****:
- v****ersion supports
ghc-lib-parser
(GHC) versions:
- v****ersion uses
ghc-lib-parser
version corresponding to [GHC version features:2. Installation and dependency resolution:
- Installing viaCabal
requires matchingbase
library versions provided by specific [GHC releases[3][4]. For example:
-fourmlu vX.Y.Z
built againstbase-Z.W.V
requires installing via a [GHC release supporting thatbase
[3].3. Practical verification:
- Testing installation via$ cabal install --dry-run
shows dependency resolution failures when using incompatible [GHC versions[3][4].Summary
Yes**,** based on changelog entries[1][7], Fourmlu v16 supports parsing code using syntactic features introduced in [
ghc-lib-parser
v10][1], which corresponds roughly to [GHC] (version range)[1][7]. However**, installation requires ensuring your build environment’s [GHC] supports dependencies likebase
, verified via tools likeCabal
.Citations:
- 1: https://github.com/fourmolu/fourmolu/blob/main/CHANGELOG.md
- 2: https://hackage.haskell.org/package/fourmolu/docs/Ormolu.html
- 3: Note which GHC versions contributors can use for installing fourmolu haskell/cabal#10472
- 4: https://www.stackage.org/lts-19.3/package/fourmolu-0.3.0.0
- 5: https://fourmolu.github.io
- 6: https://www.stackage.org/nightly-2024-11-08/package/fourmolu-0.15.0.0
- 7: http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/devel/fourmolu/Makefile
- 8: https://www.mozilla.org/en-us/firefox/2.0.0.16/releasenotes/
- 9: https://hackage.haskell.org/package/fourmolu-0.18.0.0/src/CHANGELOG.md
- 10: https://www.stackage.org/nightly-2021-05-28/package/fourmolu-0.3.0.0
Action: Confirm Intended GHC Upgrade & Compatibility
- In src/ext/fourmolu.nix, line 10 sets:
compiler-nix-name = "ghc98";- The PR stated its objective was to update to GHC 9.6, yet the code now indicates GHC 9.8.
- Based on the Fourmolu changelog and upstream dependency information, Fourmolu 0.16.2.0 is compatible with GHC 9.8 (provided that the surrounding environment—especially the matching
base
versions—is appropriately configured).- Please verify:
- Is the shift to GHC 9.8 intentional?
- If so, update the PR description/documentation accordingly.
- If not, revert the change to use GHC 9.6.
@@ -7,7 +7,7 @@ let | |||
|
|||
version = "0.1.12"; | |||
|
|||
compiler-nix-name = "ghc92"; | |||
compiler-nix-name = "ghc96"; |
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.
💡 Verification agent
🧩 Analysis chain
Verify cabal-fmt compatibility and dependencies.
The change to ghc96
aligns with the PR objectives. Please verify:
- That cabal-fmt 0.1.12 is compatible with GHC 9.6.
- That Cabal 3.6 is still the required version when using GHC 9.6 (referenced in the comment at line 14).
🌐 Web query:
Is cabal-fmt 0.1.12 compatible with GHC 9.6? What version of Cabal library does it require?
💡 Result:
cabal-fmt 0.1.12 is compatible with GHC 9.6 and requires Cabal-syntax ≥3.12. The Hackage entry explicitly lists ghc ==... || ==9.6...
in its tested-with configurations[7], confirming compatibility with GHC 9.x versions including 9.6.x.
For dependencies:
- Cabal-syntax ≥3.12 is explicitly required[7]
- This version of Cabal-syntax corresponds to Cabal ≥3.x (Cabal-syntax split from Cabal in later versions)
While standard GHC 9.x installations bundle older Cabal versions (e.g., Cabal-3.10 with GHC-9.6[3]), cabal-fmt can still work by pulling newer Cabal-syntax versions through dependency resolution during installation[7].
Citations:
- 1: https://github.com/phadej/cabal-fmt
- 2: https://taylor.fausak.me/2024/02/17/gild/
- 3: https://www.snoyman.com/base/
- 4: https://oleg.fi/gists/posts/2020-08-30-cabal-fmt-0.1.4.html
- 5: cabal install uses wrong internal library haskell/cabal#6211
- 6: https://cabal.readthedocs.io/en/stable/cabal-commands.html
- 7: https://hackage.haskell.org/package/cabal-fmt
- 8: https://discourse.haskell.org/t/convenience-in-haskell-ergonomics-of-cabal/7897
- 9: https://github.com/haskell/haskell-language-server/blob/master/haskell-language-server.cabal
- 10: https://cabal.readthedocs.io/en/3.4/cabal-package.html
Action Required: Update Dependency Documentation
- Compatibility Confirmed: cabal-fmt 0.1.12 is compatible with GHC 9.6.
- Dependency Update: cabal-fmt now requires Cabal-syntax ≥3.12 (which implies using a Cabal ≥3.x) rather than specifically Cabal 3.6.
- Note: Although standard GHC 9.6 installations may bundle an older Cabal version (e.g., Cabal-3.10), dependency resolution will fetch the required Cabal-syntax version. The comment at line 14 referencing Cabal 3.6 should be updated accordingly.
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/core/mkShellWith.nix (1)
36-39
: Consider documenting this significant version change.Since this is a major version jump from GHC 8.10.7 to 9.6, consider:
- Adding a comment explaining why GHC 9.6 was chosen as the default
- Documenting any known breaking changes that might affect users
ghc = if shell.tools.haskellCompilerVersion == null then + # Default to GHC 9.6 as haskell.nix is dropping support for older versions + # and GHC 9.2 doesn't build on Darwin due to GHC 8.10 bootstrap requirement "ghc96" else shell.tools.haskellCompilerVersion;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/core/mkShellWith.nix
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: ci/eval
🔇 Additional comments (1)
src/core/mkShellWith.nix (1)
36-39
: LGTM! The GHC version update aligns with project objectives.The change from GHC 8.10.7 to 9.6 as the default version:
- Removes dependency on the broken GHC 8.10 bootstrap requirement on Darwin
- Ensures compatibility with future haskell.nix updates
Note that this change affects the build of several dependent tools. Please verify that the following tools work correctly with GHC 9.6:
- Haskell Language Server (line 41)
- cabal-install (line 46)
- stylish-haskell, hlint (lines 55-58)
Move from 9.2 to 9.6.
haskell.nix will drop support ghc < 9.6 in the future. And currently 9.2. doesn't even build on Darwin, as it requires 8.10 to bootstrap and that's broken, and will be removed from haskell.nix in the not too distant future.
Summary by CodeRabbit