Skip to content

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

Merged
merged 3 commits into from
Feb 20, 2025
Merged

Adapt to more recent haskell.nix #107

merged 3 commits into from
Feb 20, 2025

Conversation

angerman
Copy link
Collaborator

@angerman angerman commented Feb 20, 2025

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

  • Chores
    • Upgraded the Haskell compiler version for the code formatting tool.
    • Updated the compiler version used in another formatting project.
    • Modernized the development shell environment with the new Haskell compiler version for improved consistency.

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.
@angerman
Copy link
Collaborator Author

I'm still confused why we get so few cache hits.

Copy link

coderabbitai bot commented Feb 20, 2025

Walkthrough

The changes update the GHC compiler version used in three Nix configuration files. In src/ext/cabal-fmt.nix, the compiler-nix-name attribute is modified from "ghc92" to "ghc96". In src/ext/fourmolu.nix, the attribute is updated from "ghc982" to "ghc98". Additionally, in src/core/mkShellWith.nix, the GHC version is changed from "ghc8107" to "ghc96". No other parts of the project definitions have been altered.

Changes

File(s) Change Summary
src/ext/cabal-fmt.nix, src/ext/fourmolu.nix, src/core/mkShellWith.nix Updated compiler-nix-name: In cabal-fmt.nix, changed from "ghc92""ghc96"; in fourmolu.nix, changed from "ghc982""ghc98"; in mkShellWith.nix, changed from "ghc8107""ghc96".

Possibly related PRs

  • Upgrade fourmolu to 0.16.2.0 #95: The changes in the main PR are related to the modifications of the compiler-nix-name attribute in the src/ext/fourmolu.nix file, as both PRs involve updates to the GHC version used in their respective project configurations.

Poem

I'm a hopping rabbit with code so spry,
Skipping through versions as time marches by.
Changing compilers with a joyful leap,
Keeping our builds strong and our standards deep.
Cheers to new GHCs—my heart does a happy sigh!
🥕🐇


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 74fe0a9 and b7f1ab3.

📒 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:

  1. That this is the intended version (not a typo of ghc96).
  2. 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****:

2. Installation and dependency resolution:
- Installing via Cabal requires matching base library versions provided by specific [GHC releases[3][4]. For example:
- fourmlu vX.Y.Z built against base-Z.W.V requires installing via a [GHC release supporting that base[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 like base, verified via tools like Cabal.

Citations:


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";
Copy link

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:

  1. That cabal-fmt 0.1.12 is compatible with GHC 9.6.
  2. 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:


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.

Copy link

@coderabbitai coderabbitai bot left a 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:

  1. Adding a comment explaining why GHC 9.6 was chosen as the default
  2. 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

📥 Commits

Reviewing files that changed from the base of the PR and between b7f1ab3 and d72031a.

📒 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)

@zeme-wana zeme-wana merged commit 0cec4b1 into main Feb 20, 2025
7 checks passed
@zeme-wana zeme-wana deleted the angerman-patch-1 branch February 20, 2025 07:39
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